<?xml version="1.0" encoding="UTF-8"?>
<book title="ActionScript 3.0 Language and Components Reference" directory="ActionScriptLangRef" categories="as3" language="en" version="3.0">
<page href="fl/data/TileListCollectionItem.html" title="TileListCollectionItem class" text="TileListCollectionItem The TileListCollectionItem class defines a single item in an inspectable property that represents a data provider. A TileListCollectionItem object is a collection list item that contains only label and source properties, and is primarily used in the TileList component."/>
<page href="fl/data/TileListCollectionItem.html#TileListCollectionItem()" title="TileListCollectionItem.TileListCollectionItem()" text="TileListCollectionItem Creates a new TileListCollectionItem object."/>
<page href="fl/data/TileListCollectionItem.html#label" title="TileListCollectionItem.label" text="label The label property of the object. The default value is label(n), where n is the ordinal index."/>
<page href="fl/data/TileListCollectionItem.html#source" title="TileListCollectionItem.source" text="source The source property of the object. This can be the path or a class name of the image that is displayed in the image cell of the TileList."/>
<page href="fl/data/SimpleCollectionItem.html" title="SimpleCollectionItem class" text="SimpleCollectionItem The SimpleCollectionItem class defines a single item in an inspectable property that represents a data provider. A SimpleCollectionItem object is a collection list item that contains only label and data properties--for example, a ComboBox or List component."/>
<page href="fl/data/SimpleCollectionItem.html#SimpleCollectionItem()" title="SimpleCollectionItem.SimpleCollectionItem()" text="SimpleCollectionItem Creates a new SimpleCollectionItem object."/>
<page href="fl/data/SimpleCollectionItem.html#data" title="SimpleCollectionItem.data" text="data The data property of the object."/>
<page href="fl/data/SimpleCollectionItem.html#label" title="SimpleCollectionItem.label" text="label The label property of the object. The default value is label(n), where n is the ordinal index."/>
<page href="fl/data/DataProvider.html" title="DataProvider class" text="DataProvider The DataProvider class provides methods and properties that allow you to query and modify the data in any list-based component--for example, in a List, DataGrid, TileList, or ComboBox component. A data provider is a linear collection of items that serve as a data source--for example, an array. Each item in a data provider is an object or XML object that contains one or more fields of data. You can access the items that are contained in a data provider by index, by using the DataProvider.getItemAt() method."/>
<page href="fl/data/DataProvider.html#DataProvider()" title="DataProvider.DataProvider()" text="DataProvider Creates a new DataProvider object using a list, XML instance or an array of data objects as the data source. value The data that is used to create the DataProvider. The following example creates a new data provider using the addItem() method: import fl.controls.ComboBox; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem({label:&quot;item 1a&quot;}); dp.addItem({label:&quot;item 2a&quot;}); var myComboBox:ComboBox = new ComboBox() myComboBox.dataProvider = dp; myComboBox.move(10, 10); addChild(myComboBox);"/>
<page href="fl/data/DataProvider.html#addItem()" title="DataProvider.addItem()" text="addItem Appends an item to the end of the data provider. item The item to be appended to the end of the current data provider. The following example creates a new data provider using the addItem() method: import fl.controls.ComboBox; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem({label:&quot;item 1a&quot;}); dp.addItem({label:&quot;item 2a&quot;}); var myComboBox:ComboBox = new ComboBox() myComboBox.dataProvider = dp; myComboBox.move(10, 10); addChild(myComboBox);"/>
<page href="fl/data/DataProvider.html#addItemAt()" title="DataProvider.addItemAt()" text="addItemAt Adds a new item to the data provider at the specified index. If the index that is specified exceeds the length of the data provider, the index is ignored. item index An object that contains the data for the item to be added. The index at which the item is to be added. The specified index is less than 0 or greater than or equal to the length of the data provider."/>
<page href="fl/data/DataProvider.html#addItems()" title="DataProvider.addItems()" text="addItems Appends multiple items to the end of the DataProvider and dispatches a DataChangeType.ADD event. The items are added in the order in which they are specified. items The items to be appended to the data provider. The following example uses the addItems() method to add several items to the data provider: import fl.controls.DataGrid; import fl.controls.dataGridClasses.DataGridColumn; import fl.data.DataProvider; var arr:Array = [{col1:&quot;1.A&quot;, col2:&quot;1.B&quot;}, {col1:&quot;2.A&quot;, col2:&quot;2.B&quot;}] var dp:DataProvider = new DataProvider(); dp.addItems(arr); trace(dp.length); // 2 var c1:DataGridColumn = new DataGridColumn(&quot;col1&quot;); var c2:DataGridColumn = new DataGridColumn(&quot;col2&quot;); var myDataGrid:DataGrid = new DataGrid(); myDataGrid.addColumn(c1); myDataGrid.addColumn(c2); myDataGrid.dataProvider = dp; myDataGrid.setSize(200, 160); myDataGrid.move(10, 10); addChild(myDataGrid);"/>
<page href="fl/data/DataProvider.html#addItemsAt()" title="DataProvider.addItemsAt()" text="addItemsAt Adds several items to the data provider at the specified index and dispatches a DataChangeType.ADD event. items index The items to be added to the data provider. The index at which the items are to be inserted. The specified index is less than 0 or greater than or equal to the length of the data provider."/>
<page href="fl/data/DataProvider.html#clone()" title="DataProvider.clone()" text="clone Creates a copy of the current DataProvider object."/>
<page href="fl/data/DataProvider.html#concat()" title="DataProvider.concat()" text="concat Concatenates the specified items to the end of the current data provider. This method dispatches a DataChangeType.ADD event. items The items to be added to the data provider."/>
<page href="fl/data/DataProvider.html#getItemAt()" title="DataProvider.getItemAt()" text="getItemAt Returns the item at the specified index. index Location of the item to be returned. The specified index is less than 0 or greater than or equal to the length of the data provider."/>
<page href="fl/data/DataProvider.html#getItemIndex()" title="DataProvider.getItemIndex()" text="getItemIndex Returns the index of the specified item. item The item to be located."/>
<page href="fl/data/DataProvider.html#invalidate()" title="DataProvider.invalidate()" text="invalidate Invalidates all the data items that the DataProvider contains and dispatches a DataChangeEvent.INVALIDATE_ALL event. Items are invalidated after they are changed; the DataProvider automatically redraws the invalidated items."/>
<page href="fl/data/DataProvider.html#invalidateItem()" title="DataProvider.invalidateItem()" text="invalidateItem Invalidates the specified item. An item is invalidated after it is changed; the DataProvider automatically redraws the invalidated item. item Item to be invalidated."/>
<page href="fl/data/DataProvider.html#invalidateItemAt()" title="DataProvider.invalidateItemAt()" text="invalidateItemAt Invalidates the item at the specified index. An item is invalidated after it is changed; the DataProvider automatically redraws the invalidated item. index Index of the item to be invalidated. The specified index is less than 0 or greater than or equal to the length of the data provider."/>
<page href="fl/data/DataProvider.html#merge()" title="DataProvider.merge()" text="merge Appends the specified data into the data that the data provider contains and removes any duplicate items. This method dispatches a DataChangeType.ADD event. newData Data to be merged into the data provider."/>
<page href="fl/data/DataProvider.html#removeAll()" title="DataProvider.removeAll()" text="removeAll Removes all items from the data provider and dispatches a DataChangeType.REMOVE_ALL event."/>
<page href="fl/data/DataProvider.html#removeItem()" title="DataProvider.removeItem()" text="removeItem Removes the specified item from the data provider and dispatches a DataChangeType.REMOVE event. item Item to be removed."/>
<page href="fl/data/DataProvider.html#removeItemAt()" title="DataProvider.removeItemAt()" text="removeItemAt Removes the item at the specified index and dispatches a DataChangeType.REMOVE event. index Index of the item to be removed. The specified index is less than 0 or greater than or equal to the length of the data provider."/>
<page href="fl/data/DataProvider.html#replaceItem()" title="DataProvider.replaceItem()" text="replaceItem Replaces an existing item with a new item and dispatches a DataChangeType.REPLACE event. newItem oldItem The item to be replaced. The replacement item. The item could not be found in the data provider."/>
<page href="fl/data/DataProvider.html#replaceItemAt()" title="DataProvider.replaceItemAt()" text="replaceItemAt Replaces the item at the specified index and dispatches a DataChangeType.REPLACE event. newItem index The replacement item. The index of the item to be replaced. The specified index is less than 0 or greater than or equal to the length of the data provider."/>
<page href="fl/data/DataProvider.html#sort()" title="DataProvider.sort()" text="sort Sorts the items that the data provider contains and dispatches a DataChangeType.SORT event. sortArgs The arguments to use for sorting."/>
<page href="fl/data/DataProvider.html#sortOn()" title="DataProvider.sortOn()" text="sortOn Sorts the items that the data provider contains by the specified field and dispatches a DataChangeType.SORT event. The specified field can be a string, or an array of string values that designate multiple fields to sort on in order of precedence. fieldName options The item field by which to sort. This value can be a string or an array of string values. Options for sorting."/>
<page href="fl/data/DataProvider.html#toArray()" title="DataProvider.toArray()" text="toArray Creates an Array object representation of the data that the data provider contains."/>
<page href="fl/data/DataProvider.html#toString()" title="DataProvider.toString()" text="toString Creates a string representation of the data that the data provider contains."/>
<page href="fl/data/DataProvider.html#length" title="DataProvider.length" text="length The number of items that the data provider contains. The following example creates a List component instance and resizes the list to match the number of items in its data provider: import fl.controls.List; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem({label:&quot;Item 1&quot;}); dp.addItem({label:&quot;Item 2&quot;}); dp.addItem({label:&quot;Item 3&quot;}); dp.addItem({label:&quot;Item 4&quot;}); var myList:List = new List(); myList.dataProvider = dp; myList.rowHeight = 35; myList.rowCount = dp.length; myList.move(10, 10); addChild(myList);"/>
<page href="fl/data/DataProvider.html#event:dataChange" title="DataProvider.dataChange" text="dataChange Dispatched after the data is changed."/>
<page href="fl/data/DataProvider.html#event:preDataChange" title="DataProvider.preDataChange" text="preDataChange Dispatched before the data is changed."/>
<page href="fl/core/InvalidationType.html" title="InvalidationType class" text="InvalidationType The InvalidationType class defines InvalidationType constants that are used by the type property of an event object that is dispatched after a component is invalidated. These constants are used by component developers to specify the portion of the component that is to be redrawn after the component is invalidated."/>
<page href="fl/core/InvalidationType.html#ALL" title="InvalidationType.ALL" text="ALL The InvalidationType.ALL constant defines the value of the type property of the event object that is dispatched to indicate that the component should redraw itself entirely."/>
<page href="fl/core/InvalidationType.html#DATA" title="InvalidationType.DATA" text="DATA The InvalidationType.DATA constant defines the value of the type property of the event object that is dispatched to indicate that the data that belongs to a component is invalid."/>
<page href="fl/core/InvalidationType.html#RENDERER_STYLES" title="InvalidationType.RENDERER_STYLES" text="RENDERER_STYLES The InvalidationType.RENDERER_STYLES constant defines the value of the type property of the event object that is dispatched to indicate that the renderer styles of the component are invalid."/>
<page href="fl/core/InvalidationType.html#SCROLL" title="InvalidationType.SCROLL" text="SCROLL The InvalidationType.SCROLL constant defines the value of the type property of the event object that is dispatched to indicate that the scroll position of the component is invalid."/>
<page href="fl/core/InvalidationType.html#SELECTED" title="InvalidationType.SELECTED" text="SELECTED The InvalidationType.SELECTED constant defines the value of the type property of the event object that is dispatched to indicate that the selected property of the component is invalid."/>
<page href="fl/core/InvalidationType.html#SIZE" title="InvalidationType.SIZE" text="SIZE The InvalidationType.SIZE constant defines the value of the type property of the event object that is dispatched to indicate that the screen dimensions of the component are invalid."/>
<page href="fl/core/InvalidationType.html#STATE" title="InvalidationType.STATE" text="STATE The InvalidationType.STATE constant defines the value of the type property of the event object that is dispatched to indicate that the state of the component is invalid. For example, this constant is used when the enabled state of a component is no longer valid."/>
<page href="fl/core/InvalidationType.html#STYLES" title="InvalidationType.STYLES" text="STYLES The InvalidationType.STYLES constant defines the value of the type property of the event object that is dispatched to indicate that the styles of the component are invalid."/>
<page href="fl/core/UIComponent.html" title="UIComponent class" text="UIComponent The UIComponent class is the base class for all visual components, both interactive and noninteractive. Interactive components are defined as components that receive user input such as keyboard or mouse activity. Noninteractive components are used to display data; they do not respond to user interaction. The ProgressBar and UILoader components are examples of noninteractive components. The Tab and arrow keys can be used to move focus to and over an interactive component; an interactive component can accept low-level events such as input from mouse and keyboard devices. An interactive component can also be disabled so that it cannot receive mouse and keyboard input."/>
<page href="fl/core/UIComponent.html#UIComponent()" title="UIComponent.UIComponent()" text="UIComponent Creates a new UIComponent component instance."/>
<page href="fl/core/UIComponent.html#clearStyle()" title="UIComponent.clearStyle()" text="clearStyle Deletes a style property from this component instance. This does not necessarily cause the getStyle() method to return a value of undefined. style The name of the style property."/>
<page href="fl/core/UIComponent.html#drawFocus()" title="UIComponent.drawFocus()" text="drawFocus Shows or hides the focus indicator on this component. The UIComponent class implements this method by creating and positioning an instance of the class that is specified by the focusSkin style. focused Indicates whether to show or hide the focus indicator. If this value is true, the focus indicator is shown; if this value is false, the focus indicator is hidden."/>
<page href="fl/core/UIComponent.html#drawNow()" title="UIComponent.drawNow()" text="drawNow Initiates an immediate draw operation, without invalidating everything as invalidateNow does."/>
<page href="fl/core/UIComponent.html#getFocus()" title="UIComponent.getFocus()" text="getFocus Retrieves the object that currently has focus. Note that this method does not necessarily return the component that has focus. It may return the internal subcomponent of the component that has focus. To get the component that has focus, use the focusManager.focus property."/>
<page href="fl/core/UIComponent.html#getStyle()" title="UIComponent.getStyle()" text="getStyle Retrieves a style property that is set in the style lookup chain of the component. The type that this method returns varies depending on the style property that the method retrieves. The range of possible types includes Boolean; String; Number; int; a uint for an RGB color; a Class for a skin; or any kind of object. If you call this method to retrieve a particular style property, it will be of a known type that you can store in a variable of the same type. Type casting is not necessary. Instead, a simple assignment statement like the following will work: var backgroundColor:uint = getStyle(&quot;backgroundColor&quot;); If the style property is not set in the style lookup chain, this method returns a value of undefined. Note that undefined is a special value that is not the same as false, &quot;&quot;, NaN, 0, or null. No valid style value is ever undefined. You can use the static method StyleManager.isValidStyleValue() to test whether a value was set. style The name of the style property. The following example creates a DataGrid component instance and displays the default and current styles for a ComboBox component: import fl.controls.ComboBox; import fl.controls.DataGrid; import fl.controls.dataGridClasses.DataGridColumn; import fl.data.DataProvider; var myComboBox:ComboBox = new ComboBox(); myComboBox.setStyle(&quot;textPadding&quot;, 6); myComboBox.setStyle(&quot;disabledAlpha&quot;, 0.8); var styleObject:Object = ComboBox.getStyleDefinition(); var styleDP:DataProvider = new DataProvider(); var styleName:String; var styleDefaultValue:String; var styleCurrentValue:String; for (styleName in styleObject) { styleDefaultValue = String(styleObject[styleName]); styleCurrentValue = String(myComboBox.getStyle(styleName)); styleDP.addItem({name:styleName, defaultValue:styleDefaultValue, currentValue:styleCurrentValue}); } styleDP.sortOn(&quot;name&quot;, Array.CASEINSENSITIVE); var c1:DataGridColumn = new DataGridColumn(&quot;name&quot;); c1.headerText = &quot;Style name:&quot;; var c2:DataGridColumn = new DataGridColumn(&quot;defaultValue&quot;); c2.headerText = &quot;Default style value:&quot;; var c3:DataGridColumn = new DataGridColumn(&quot;currentValue&quot;); c3.headerText = &quot;Current style value:&quot; var styleDataGrid:DataGrid = new DataGrid(); styleDataGrid.addColumn(c1); // name styleDataGrid.addColumn(c2); // defaultValue styleDataGrid.addColumn(c3); // currentValue styleDataGrid.dataProvider = styleDP; styleDataGrid.setSize(stage.stageWidth - 20, stage.stageHeight - 20); styleDataGrid.move(10, 10); addChild(styleDataGrid);"/>
<page href="fl/core/UIComponent.html#getStyleDefinition()" title="UIComponent.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/core/UIComponent.html#invalidate()" title="UIComponent.invalidate()" text="invalidate Marks a property as invalid and redraws the component on the next frame unless otherwise specified. property callLater The property to be invalidated. A Boolean value that indicates whether the component should be redrawn on the next frame. The default value is true."/>
<page href="fl/core/UIComponent.html#mergeStyles()" title="UIComponent.mergeStyles()" text="mergeStyles Merges the styles from multiple classes into one object. If a style is defined in multiple objects, the first occurrence that is found is used. list A comma-delimited list of objects that contain the default styles to be merged."/>
<page href="fl/core/UIComponent.html#move()" title="UIComponent.move()" text="move Moves the component to the specified position within its parent. This has the same effect as changing the component location by setting its x and y properties. Calling this method triggers the ComponentEvent.MOVE event to be dispatched. To override the updateDisplayList() method in a custom component, use the move() method instead of setting the x and y properties. This is because a call to the move() method causes a move event object to be dispatched immediately after the move operation is complete. In contrast, when you change the component location by setting the x and y properties, the event object is dispatched on the next screen refresh. x y The x coordinate value that specifies the position of the component within its parent, in pixels. This value is calculated from the left. The y coordinate value that specifies the position of the component within its parent, in pixels. This value is calculated from the top."/>
<page href="fl/core/UIComponent.html#setFocus()" title="UIComponent.setFocus()" text="setFocus Sets the focus to this component. The component may in turn give the focus to a subcomponent. Note: Only the TextInput and TextArea components show a focus indicator when this method sets the focus. All components show a focus indicator when the user tabs to the component."/>
<page href="fl/core/UIComponent.html#setSize()" title="UIComponent.setSize()" text="setSize Sets the component to the specified width and height. width height The width of the component, in pixels. The height of the component, in pixels."/>
<page href="fl/core/UIComponent.html#setStyle()" title="UIComponent.setStyle()" text="setStyle Sets a style property on this component instance. This style may override a style that was set globally. Calling this method can result in decreased performance. Use it only when necessary. style value The name of the style property. The value of the style. The following example sets a button to use the Georgia font: import fl.controls.Button; var myFormat:TextFormat = new TextFormat(); myFormat.font = &quot;Georgia&quot;; var b:Button = new Button(); b.label = &quot;Hello World&quot;; b.setStyle(&quot;textFormat&quot;, myFormat); addChild(b);"/>
<page href="fl/core/UIComponent.html#validateNow()" title="UIComponent.validateNow()" text="validateNow Validates and updates the properties and layout of this object, redrawing it if necessary. Properties that require substantial computation are normally not processed until the script finishes executing. This is because setting one property could require the processing of other properties. For example, setting the width property may require that the widths of the children or parent of the object also be recalculated. And if the script recalculates the width of the object more than once, these interdependent properties may also require recalculating. Use this method to manually override this behavior."/>
<page href="fl/core/UIComponent.html#enabled" title="UIComponent.enabled" text="enabled Gets or sets a value that indicates whether the component can accept user interaction. A value of true indicates that the component can accept user interaction; a value of false indicates that it cannot. If you set the enabled property to false, the color of the container is dimmed and user input is blocked (with the exception of the Label and ProgressBar components)."/>
<page href="fl/core/UIComponent.html#focusEnabled" title="UIComponent.focusEnabled" text="focusEnabled Gets or sets a Boolean value that indicates whether the component can receive focus after the user clicks it. A value of true indicates that it can receive focus; a value of false indicates that it cannot. If this property is false, focus is transferred to the first parent whose mouseFocusEnabled property is set to true."/>
<page href="fl/core/UIComponent.html#focusManager" title="UIComponent.focusManager" text="focusManager Gets or sets the FocusManager that controls focus for this component and its peers. Each pop-up component maintains its own focus loop and FocusManager instance. Use this property to access the correct FocusManager for this component."/>
<page href="fl/core/UIComponent.html#height" title="UIComponent.height" text="height Gets or sets the height of the component, in pixels. Setting this property causes a resize event to be dispatched. See the resize event for detailed information about when it is dispatched. If the scaleY property of the component is not 1.0, the height of the component that is obtained from its internal coordinates will not match the height value from the parent coordinates. For example, a component that is 100 pixels in height and has a scaleY of 2 has a value of 100 pixels in the parent, but internally stores a value indicating that it is 50 pixels in height."/>
<page href="fl/core/UIComponent.html#mouseFocusEnabled" title="UIComponent.mouseFocusEnabled" text="mouseFocusEnabled Gets or sets a value that indicates whether the component can receive focus after the user clicks it. A value of true indicates that it can receive focus; a value of false indicates that it cannot. If this property is false, focus is transferred to the first parent whose mouseFocusEnabled property is set to true."/>
<page href="fl/core/UIComponent.html#scaleX" title="UIComponent.scaleX" text="scaleX Multiplies the current width of the component by a scale factor."/>
<page href="fl/core/UIComponent.html#scaleY" title="UIComponent.scaleY" text="scaleY Multiplies the current height of the component by a scale factor."/>
<page href="fl/core/UIComponent.html#version" title="UIComponent.version" text="version The version number of the components. The following example traces the version number for the CheckBox component instance: import fl.controls.CheckBox; var myCheckBox:CheckBox = new CheckBox(); trace(myCheckBox.version);"/>
<page href="fl/core/UIComponent.html#visible" title="UIComponent.visible" text="visible Gets or sets a value that indicates whether the current component instance is visible. A value of true indicates that the current component is visible; a value of false indicates that it is not. When this property is set to true, the object dispatches a show event. When this property is set to false, the object dispatches a hide event. In either case, the children of the object do not generate a show or hide event unless the object specifically writes an implementation to do so."/>
<page href="fl/core/UIComponent.html#width" title="UIComponent.width" text="width Gets or sets the width of the component, in pixels. Setting this property causes a resize event to be dispatched. See the resize event for detailed information about when it is dispatched. If the scaleX property of the component is not 1.0, the width of the component that is obtained from its internal coordinates will not match the width value from the parent coordinates. For example, a component that is 100 pixels in width and has a scaleX of 2 has a value of 100 pixels in the parent, but internally stores a value indicating that it is 50 pixels wide."/>
<page href="fl/core/UIComponent.html#x" title="UIComponent.x" text="x Gets or sets the x coordinate that represents the position of the component along the x axis within its parent container. This value is described in pixels and is calculated from the left. Setting this property causes the ComponentEvent.MOVE event to be dispatched."/>
<page href="fl/core/UIComponent.html#y" title="UIComponent.y" text="y Gets or sets the y coordinate that represents the position of the component along the y axis within its parent container. This value is described in pixels and is calculated from the top. Setting this property causes the move event to be dispatched."/>
<page href="fl/core/UIComponent.html#event:hide" title="UIComponent.hide" text="hide Dispatched after the component visibility changes from visible to invisible. The following example creates a Button component that toggles a List component's visibility: import fl.controls.Button; import fl.controls.List; import fl.events.ComponentEvent; import fl.events.ListEvent; var toggleButton:Button = new Button(); toggleButton.label = &quot;toggle visibility&quot;; toggleButton.toggle = true; toggleButton.selected = true; toggleButton.emphasized = toggleButton.selected; toggleButton.addEventListener(Event.CHANGE, changeHandler); toggleButton.width = 150; toggleButton.move(10, 10); addChild(toggleButton); var myList:List = new List(); myList.addItem({label:&quot;Item 1&quot;}); myList.addItem({label:&quot;Item 2&quot;}); myList.addItem({label:&quot;Item 3&quot;}); myList.addItem({label:&quot;Item 4&quot;}); myList.addItem({label:&quot;Item 5&quot;}); myList.move(10, 40); myList.addEventListener(ComponentEvent.HIDE, hideHandler); myList.addEventListener(ComponentEvent.SHOW, showHandler); myList.addEventListener(ListEvent.ITEM_ROLL_OVER, itemRollOverHandler); myList.addEventListener(ListEvent.ITEM_ROLL_OUT, itemRollOverHandler); addChild(myList); function changeHandler(event:Event):void { toggleButton.emphasized = toggleButton.selected; myList.visible = toggleButton.selected; } function hideHandler(event:ComponentEvent):void { trace(&quot;hiding list&quot;); myList.removeEventListener(ListEvent.ITEM_ROLL_OVER, itemRollOverHandler); myList.removeEventListener(ListEvent.ITEM_ROLL_OUT, itemRollOverHandler); } function showHandler(event:ComponentEvent):void { trace(&quot;showing list&quot;); myList.addEventListener(ListEvent.ITEM_ROLL_OVER, itemRollOverHandler); myList.addEventListener(ListEvent.ITEM_ROLL_OUT, itemRollOverHandler); } function itemRollOverHandler(event:ListEvent):void { trace(event.type + &quot;:&quot;, event.item.label); } function itemRollOutHandler(event:ListEvent):void { trace(event.type + &quot;:&quot;, event.item.label); }"/>
<page href="fl/core/UIComponent.html#event:move" title="UIComponent.move" text="move Dispatched after the component is moved. The following example repositions a UILoader component instance on the Stage based on the value of a Slider component: import fl.controls.Slider; import fl.containers.UILoader; import fl.events.ComponentEvent; import fl.events.SliderEvent; var myUILoader:UILoader = new UILoader(); myUILoader.source = &quot;http://www.helpexamples.com/flash/images/image3.jpg&quot;; myUILoader.move(10, 20); myUILoader.addEventListener(ComponentEvent.MOVE, moveHandler); addChild(myUILoader); var mySlider:Slider = new Slider(); mySlider.liveDragging = true; mySlider.minimum = myUILoader.x; mySlider.maximum = myUILoader.x + 200; mySlider.snapInterval = 1; mySlider.tickInterval = 10; mySlider.move(10, 10); mySlider.addEventListener(SliderEvent.CHANGE, changeHandler); addChild(mySlider); function changeHandler(event:SliderEvent):void { myUILoader.x = event.value; } function moveHandler(event:ComponentEvent):void { trace(&quot;[move] x:&quot; + event.currentTarget.x + &quot;, y:&quot; + event.currentTarget.y); }"/>
<page href="fl/core/UIComponent.html#event:resize" title="UIComponent.resize" text="resize Dispatched after the component is resized. The following example loads an external image into a UILoader component instance and centers it on the Stage using the resize event and move() method: import fl.containers.UILoader; import fl.events.ComponentEvent; var myUILoader:UILoader = new UILoader(); myUILoader.scaleContent = false; myUILoader.addEventListener(ComponentEvent.RESIZE, resizeHandler); myUILoader.source = &quot;http://www.helpexamples.com/flash/images/image3.jpg&quot;; addChild(myUILoader); function resizeHandler(event:ComponentEvent):void { var myImg:UILoader = event.currentTarget as UILoader; var newX:uint = (stage.stageWidth - myImg.width) / 2; var newY:uint = (stage.stageHeight - myImg.height) / 2; myImg.move(newX, newY); }"/>
<page href="fl/core/UIComponent.html#event:show" title="UIComponent.show" text="show Dispatched after the component visibility changes from invisible to visible. The following example creates a Button component that toggles a List component's visibility: import fl.controls.Button; import fl.controls.List; import fl.events.ComponentEvent; import fl.events.ListEvent; var toggleButton:Button = new Button(); toggleButton.label = &quot;toggle visibility&quot;; toggleButton.toggle = true; toggleButton.selected = true; toggleButton.emphasized = toggleButton.selected; toggleButton.addEventListener(Event.CHANGE, changeHandler); toggleButton.width = 150; toggleButton.move(10, 10); addChild(toggleButton); var myList:List = new List(); myList.addItem({label:&quot;Item 1&quot;}); myList.addItem({label:&quot;Item 2&quot;}); myList.addItem({label:&quot;Item 3&quot;}); myList.addItem({label:&quot;Item 4&quot;}); myList.addItem({label:&quot;Item 5&quot;}); myList.move(10, 40); myList.addEventListener(ComponentEvent.HIDE, hideHandler); myList.addEventListener(ComponentEvent.SHOW, showHandler); myList.addEventListener(ListEvent.ITEM_ROLL_OVER, itemRollOverHandler); myList.addEventListener(ListEvent.ITEM_ROLL_OUT, itemRollOverHandler); addChild(myList); function changeHandler(event:Event):void { toggleButton.emphasized = toggleButton.selected; myList.visible = toggleButton.selected; } function hideHandler(event:ComponentEvent):void { trace(&quot;hiding list&quot;); myList.removeEventListener(ListEvent.ITEM_ROLL_OVER, itemRollOverHandler); myList.removeEventListener(ListEvent.ITEM_ROLL_OUT, itemRollOverHandler); } function showHandler(event:ComponentEvent):void { trace(&quot;showing list&quot;); myList.addEventListener(ListEvent.ITEM_ROLL_OVER, itemRollOverHandler); myList.addEventListener(ListEvent.ITEM_ROLL_OUT, itemRollOverHandler); } function itemRollOverHandler(event:ListEvent):void { trace(event.type + &quot;:&quot;, event.item.label); } function itemRollOutHandler(event:ListEvent):void { trace(event.type + &quot;:&quot;, event.item.label); }"/>
<page href="fl/core/UIComponent.html#style:disabledTextFormat" title="UIComponent.disabledTextFormat" text="disabledTextFormat The TextFormat object to use to render the component label when the button is disabled."/>
<page href="fl/core/UIComponent.html#style:focusRectPadding" title="UIComponent.focusRectPadding" text="focusRectPadding The padding that separates the outside boundaries of the component from the outside edges of the focus indicator, in pixels."/>
<page href="fl/core/UIComponent.html#style:focusRectSkin" title="UIComponent.focusRectSkin" text="focusRectSkin The skin to be used to display focus indicators."/>
<page href="fl/core/UIComponent.html#style:textFormat" title="UIComponent.textFormat" text="textFormat The TextFormat object to use to render the component label."/>
<page href="fl/lang/Locale.html" title="Locale class" text="Locale The fl.lang.Locale class allows you to control how multilanguage text is displayed in a SWF file. The Flash Strings panel allows you to use string IDs instead of string literals in dynamic text fields. This allows you to create a SWF file that displays text loaded from a language-specific XML file. The XML file must use the XML Localization Interchange File Format (XLIFF). There are three ways to display the language-specific strings contained in the XLIFF files: &quot;automatically at runtime&quot;—Flash Player replaces string IDs with strings from the XML file matching the default system language code returned by flash.system.capabilities.language. &quot;manually using stage language&quot;—String IDs are replaced by strings at compile time and cannot be changed by Flash Player. &quot;via ActionScript at runtime&quot;—String ID replacement is controlled using ActionScript at runtime. This option gives you control over both the timing and language of string ID replacement. You can use the properties and methods of this class when you want to replace the string IDs &quot;via ActionScript at runtime.&quot; All of the properties and methods available are static, which means that they are accessed through the fl.lang.Locale class itself rather than through an instance of the class. Note: The Locale class is installed in the Flash Authoring classpath and is automatically compiled into your SWF files. Using the Locale class increases the SWF file size slightly since the class is compiled into the SWF."/>
<page href="fl/lang/Locale.html#addDelayedInstance()" title="Locale.addDelayedInstance()" text="addDelayedInstance Adds the {instance, string ID} pair into the internal array for later use. This is primarily used by Flash when the strings replacement method is &quot;automatically at runtime&quot;. instance stringID Instance name of the text field to populate. Language string ID. The following example uses the autoReplace property and addDelayedInstance() method to populate a text field on the Stage with the IDS_GREETING string from the English XML language file. greeting_txt.autoSize = TextFieldAutoSize.LEFT; Locale.autoReplace = true; Locale.addDelayedInstance(greeting_txt, &quot;IDS_GREETING&quot;); Locale.loadLanguageXML(&quot;en&quot;);"/>
<page href="fl/lang/Locale.html#addXMLPath()" title="Locale.addXMLPath()" text="addXMLPath Adds the {languageCode and languagePath} pair into the internal array for later use. This is primarily used by Flash when the strings replacement method is &quot;automatically at runtime&quot; or &quot;via ActionScript at runtime&quot;. langCode path The language code. The XML path to add. The following example uses the setInterval() method to check whether the language XML file has successfully loaded. Locale.setLoadCallback(localeCallback); Locale.loadLanguageXML(&quot;en&quot;); // create interval to check if language XML file is loaded var locale_int:Number = setInterval(checkLocaleStatus, 10); function checkLocaleStatus():void { if (Locale.checkXMLStatus()) { clearInterval(locale_int); trace(&quot;clearing interval @ &quot; + getTimer() + &quot; ms&quot;); } } // callback function for Locale.setLoadCallback() function localeCallback(success:Boolean):void { greeting_txt.text = Locale.loadString(&quot;IDS_GREETING&quot;); }"/>
<page href="fl/lang/Locale.html#checkXMLStatus()" title="Locale.checkXMLStatus()" text="checkXMLStatus Returns true if the XML file is loaded; false otherwise. The following example uses an interval to check every 10 milliseconds to see if the language file has successfully loaded. Once the XML file has loaded, the greeting_txt text field instance on the Stage is populated with the IDS_GREETING string from the language XML file. Locale.setLoadCallback(localeCallback); Locale.loadLanguageXML(&quot;en&quot;); // create interval to check if language XML file is loaded var locale_int:Number = setInterval(checkLocaleStatus, 10); function checkLocaleStatus():void { if (Locale.checkXMLStatus()) { clearInterval(locale_int); trace(&quot;clearing interval @ &quot; + getTimer() + &quot; ms&quot;); } } // callback function for Locale.setLoadCallback() function localeCallback(success:Boolean):void { greeting_txt.text = Locale.loadString(&quot;IDS_GREETING&quot;); }"/>
<page href="fl/lang/Locale.html#getDefaultLang()" title="Locale.getDefaultLang()" text="getDefaultLang The default language code as set in the Strings panel dialog box or by calling the setDefaultLang() method. The following example creates a variable called defLang, which is used to hold the initial default language for the Flash document. You click the Settings button in the Strings panel to launch the Settings dialog box. Then you add two active languages: English (en) and French (fr), set the replace strings radio control to &quot;via ActionScript at runtime&quot;, and click OK. In the Strings panel, you add a string ID of IDS_GREETING, and then add text for each active language. var defLang:String = &quot;fr&quot;; Locale.setDefaultLang(defLang); Locale.setLoadCallback(localeCallback); Locale.loadLanguageXML(Locale.getDefaultLang()); function localeCallback(success:Boolean) { if (success) { trace(Locale.stringIDArray); // IDS_GREETING trace(Locale.loadString(&quot;IDS_GREETING&quot;)); } else { trace(&quot;unable to load XML&quot;); } }"/>
<page href="fl/lang/Locale.html#initialize()" title="Locale.initialize()" text="initialize Automatically determines the language to use and loads the XML language file. This is primarily used by Flash when the strings replacement method is &quot;automatically at runtime&quot;. This example shows how to use the initialize() method to automatically populate the greeting_txt text field on the Stage with the user's current OS language. Instead of using the initialize() method directly, use the string replacement method of &quot;automatically at runtime&quot;. trace(System.capabilities.language); Locale.autoReplace = true; Locale.addDelayedInstance(greeting_txt, &quot;IDS_GREETING&quot;); Locale.initialize();"/>
<page href="fl/lang/Locale.html#loadLanguageXML()" title="Locale.loadLanguageXML()" text="loadLanguageXML Loads the specified XML language file. xmlLanguageCode customXmlCompleteCallback The language code for the XML language file that you want to load. Custom callback function to call when XML language file loads. The following example uses the loadLanguageXML() method to load the English (en) XML language file. Once the language file loads, the localeCallback() method is called and populates the greeting_txt text field on the Stage with the contents of the IDS_GREETING string in the XML file. Locale.setLoadCallback(localeCallback); Locale.loadLanguageXML(&quot;en&quot;); // create interval to check if language XML file is loaded var locale_int:Number = setInterval(checkLocaleStatus, 10); function checkLocaleStatus():void { if (Locale.checkXMLStatus()) { clearInterval(locale_int); trace(&quot;clearing interval @ &quot; + getTimer() + &quot; ms&quot;); } } // callback function for Locale.setLoadCallback() function localeCallback(success:Boolean):void { greeting_txt.text = Locale.loadString(&quot;IDS_GREETING&quot;); }"/>
<page href="fl/lang/Locale.html#loadString()" title="Locale.loadString()" text="loadString Returns the string value associated with the given string ID in the current language. id The identification (ID) number of the string to load. The following example uses an interval to check every 10 milliseconds to see if the language file has successfully loaded. Once the XML file has loaded, the greeting_txt text field instance on the Stage is populated with the IDS_GREETING string from the XML language file. Locale.setLoadCallback(localeCallback); Locale.loadLanguageXML(&quot;en&quot;); // create interval to check if language XML file is loaded var locale_int:Number = setInterval(checkLocaleStatus, 10); function checkLocaleStatus():void { if (Locale.checkXMLStatus()) { clearInterval(locale_int); trace(&quot;clearing interval @ &quot; + getTimer() + &quot; ms&quot;); } } // callback function for Locale.setLoadCallback() function localeCallback(success:Boolean):void { greeting_txt.text = Locale.loadString(&quot;IDS_GREETING&quot;); }"/>
<page href="fl/lang/Locale.html#loadStringEx()" title="Locale.loadStringEx()" text="loadStringEx Returns the string value associated with the given string ID and language code. To avoid unexpected XML file loading, loadStringEx() does not load the XML language file if the XML file is not already loaded. You should decide on the right time to call the loadLanguageXML() method if you want to load a XML language file. stringID languageCode The identification (ID) number of the string to load. The language code. The following example uses the loadStringEx() method to trace the value of the IDS_GREETING string for the currently loaded French language XML file. Locale.setLoadCallback(localeCallback); Locale.loadLanguageXML(&quot;fr&quot;); function localeCallback(success:Boolean) { trace(success); trace(Locale.stringIDArray); // IDS_GREETING trace(Locale.loadStringEx(&quot;IDS_GREETING&quot;, &quot;fr&quot;)); // bonjour }"/>
<page href="fl/lang/Locale.html#setDefaultLang()" title="Locale.setDefaultLang()" text="setDefaultLang Sets the default language code. langCode A string representing a language code. The following example creates a variable called defLang, which is used to hold the initial default language for the Flash document. You click the Settings button in the Strings panel to open the Settings dialog box. Then you add two active languages: English (en) and French (fr), set the replace strings radio control to &quot;via ActionScript at runtime&quot;, and click OK. In the Strings panel, you add a string ID of IDS_GREETING, and then add text for each active language. var defLang:String = &quot;fr&quot;; Locale.setDefaultLang(defLang); Locale.setLoadCallback(localeCallback); Locale.loadLanguageXML(Locale.getDefaultLang()); function localeCallback(success:Boolean) { if (success) { trace(Locale.stringIDArray); // IDS_GREETING trace(Locale.loadString(&quot;IDS_GREETING&quot;)); } else { trace(&quot;unable to load XML&quot;); } }"/>
<page href="fl/lang/Locale.html#setLoadCallback()" title="Locale.setLoadCallback()" text="setLoadCallback Sets the callback function that is called after the XML file is loaded. loadCallback The function to call when the XML language file loads. The following example uses an interval to check every 10 milliseconds to see if the language file has successfully loaded. Once the XML file has loaded, the greeting_txt text field instance on the Stage is populated with the IDS_GREETING string from the XML language file. Locale.setLoadCallback(localeCallback); Locale.loadLanguageXML(&quot;en&quot;); // create interval to check if language XML file is loaded var locale_int:Number = setInterval(checkLocaleStatus, 10); function checkLocaleStatus():void { if (Locale.checkXMLStatus()) { clearInterval(locale_int); trace(&quot;clearing interval @ &quot; + getTimer() + &quot; ms&quot;); } } // callback function for Locale.setLoadCallback() function localeCallback(success:Boolean):void { greeting_txt.text = Locale.loadString(&quot;IDS_GREETING&quot;); }"/>
<page href="fl/lang/Locale.html#setString()" title="Locale.setString()" text="setString Sets the new string value of a given string ID and language code. stringID languageCode stringValue The identification (ID) number of the string to set. The language code. A string value. The following example uses the setString() method to set the IDS_WELCOME string for both English (en) and French (fr). Locale.setString(&quot;IDS_WELCOME&quot;, &quot;en&quot;, &quot;hello&quot;); Locale.setString(&quot;IDS_WELCOME&quot;, &quot;fr&quot;, &quot;bonjour&quot;); trace(Locale.loadStringEx(&quot;IDS_WELCOME&quot;, &quot;en&quot;)); // hello"/>
<page href="fl/lang/Locale.html#autoReplace" title="Locale.autoReplace" text="autoReplace Determines whether strings are replaced automatically after loading the XML file. If set to true, the text replacement method is equivalent to the Strings panel setting &quot;automatically at runtime&quot;. This means that Flash Player will determine the default language of the host environment and automatically display the text in that language. If set to false, the text replacement method is equivalent to the Strings panel setting &quot;via ActionScript at runtime&quot;. This means that you are responsible for loading the appropriate XML file to display the text. The default value of this property reflects the setting that you select for Replace strings in the Strings panel dialog box: true for &quot;automatically at runtime&quot; (the default setting) and false for &quot;via ActionScript at runtime&quot;. The following example uses the Locale.autoReplace property to populate the dynamically created greeting_txt text field on the Stage with the contents of the IDS_GREETING string in the English XML file. In the Strings panel, click the Settings button to open the Settings dialog box. You can add two active languages using the Settings dialog box: English (en) and French (fr), set the replacement strings radio option to &quot;via ActionScript at runtime&quot;, and click OK. Finally, enter a string ID of IDS_GREETING in the Strings panel, and add text for each active language. var greeting_txt:TextField = new TextField(); greeting_txt.x = 40; greeting_txt.y = 40; greeting_txt.width = 200; greeting_txt.height = 20; greeting_txt.autoSize = TextFieldAutoSize.LEFT; Locale.autoReplace = true; Locale.addDelayedInstance(greeting_txt, &quot;IDS_GREETING&quot;); Locale.loadLanguageXML(&quot;en&quot;);"/>
<page href="fl/lang/Locale.html#languageCodeArray" title="Locale.languageCodeArray" text="languageCodeArray An array containing language codes for the languages that have been specified or loaded into the FLA file. The language codes are not sorted alphabetically. The following example loads a language XML file based on the current value of a ComboBox component. You drag a ComboBox component onto the Stage and give it an instance name of lang_cb. Using the Text tool, you create a dynamic text field and give it an instance name of greeting_txt. In the Strings panel, you add at least two active languages, set the replace strings radio option to &quot;via ActionScript at runtime&quot;, and click OK. Next, you add a string ID of IDS_GREETING and enter text for each active language. Finally, you add the following ActionScript code to Frame 1 of the main Timeline: Locale.setLoadCallback(localeListener); lang_cb.dataProvider = Locale.languageCodeArray.sort(); lang_cb.addEventListener(&quot;change&quot;, langListener); function langListener(eventObj:Object):void { Locale.loadLanguageXML(eventObj.target.value); } function localeListener(success:Boolean):void { if (success) { greeting_txt.text = Locale.loadString(&quot;IDS_GREETING&quot;); } else { greeting_txt.text = &quot;unable to load language XML file.&quot;; } }"/>
<page href="fl/lang/Locale.html#stringIDArray" title="Locale.stringIDArray" text="stringIDArray An array containing all the string IDs in the FLA file. The string IDs are not sorted alphabetically. The following example traces the Locale.stringIDArray property for the currently loaded language XML file. Click the Settings button in the Strings panel to open the Settings dialog box. Next, you add two active languages: English (en) and French (fr), set the replace strings radio control to &quot;via ActionScript at runtime&quot;, and click OK. In the Strings panel, you add a string ID of IDS_GREETING, and then add text for each active language. Locale.setLoadCallback(localeCallback); Locale.loadLanguageXML(&quot;fr&quot;); function localeCallback(success:Boolean) { trace(success); trace(Locale.stringIDArray); // IDS_GREETING trace(Locale.loadStringEx(&quot;IDS_GREETING&quot;, &quot;fr&quot;)); // bonjour }"/>
<page href="flash/ui/Keyboard.html" title="Keyboard class" text="Keyboard The Keyboard class is used to build an interface that can be controlled by a user with a standard keyboard. You can use the methods and properties of the Keyboard class without using a constructor. The properties of the Keyboard class are constants representing the keys that are most commonly used to control games."/>
<page href="flash/ui/Keyboard.html#isAccessible()" title="Keyboard.isAccessible()" text="isAccessible Specifies whether the last key pressed is accessible by other SWF files. By default, security restrictions prevent code from a SWF file in one domain from accessing a keystroke generated from a SWF file in another domain."/>
<page href="flash/ui/Keyboard.html#BACKSPACE" title="Keyboard.BACKSPACE" text="BACKSPACE Constant associated with the key code value for the Backspace key (8)."/>
<page href="flash/ui/Keyboard.html#CAPS_LOCK" title="Keyboard.CAPS_LOCK" text="CAPS_LOCK Constant associated with the key code value for the Caps Lock key (20)."/>
<page href="flash/ui/Keyboard.html#capsLock" title="Keyboard.capsLock" text="capsLock Specifies whether the Caps Lock key is activated (true) or not (false)."/>
<page href="flash/ui/Keyboard.html#CONTROL" title="Keyboard.CONTROL" text="CONTROL Constant associated with the key code value for the Control key (17)."/>
<page href="flash/ui/Keyboard.html#DELETE" title="Keyboard.DELETE" text="DELETE Constant associated with the key code value for the Delete key (46)."/>
<page href="flash/ui/Keyboard.html#DOWN" title="Keyboard.DOWN" text="DOWN Constant associated with the key code value for the Down Arrow key (40)."/>
<page href="flash/ui/Keyboard.html#END" title="Keyboard.END" text="END Constant associated with the key code value for the End key (35)."/>
<page href="flash/ui/Keyboard.html#ENTER" title="Keyboard.ENTER" text="ENTER Constant associated with the key code value for the Enter key (13)."/>
<page href="flash/ui/Keyboard.html#ESCAPE" title="Keyboard.ESCAPE" text="ESCAPE Constant associated with the key code value for the Escape key (27)."/>
<page href="flash/ui/Keyboard.html#F1" title="Keyboard.F1" text="F1 Constant associated with the key code value for the F1 key (112)."/>
<page href="flash/ui/Keyboard.html#F10" title="Keyboard.F10" text="F10 Constant associated with the key code value for the F10 key (121)."/>
<page href="flash/ui/Keyboard.html#F11" title="Keyboard.F11" text="F11 Constant associated with the key code value for the F11 key (122)."/>
<page href="flash/ui/Keyboard.html#F12" title="Keyboard.F12" text="F12 Constant associated with the key code value for the F12 key (123)."/>
<page href="flash/ui/Keyboard.html#F13" title="Keyboard.F13" text="F13 Constant associated with the key code value for the F13 key (124)."/>
<page href="flash/ui/Keyboard.html#F14" title="Keyboard.F14" text="F14 Constant associated with the key code value for the F14 key (125)."/>
<page href="flash/ui/Keyboard.html#F15" title="Keyboard.F15" text="F15 Constant associated with the key code value for the F15 key (126)."/>
<page href="flash/ui/Keyboard.html#F2" title="Keyboard.F2" text="F2 Constant associated with the key code value for the F2 key (113)."/>
<page href="flash/ui/Keyboard.html#F3" title="Keyboard.F3" text="F3 Constant associated with the key code value for the F3 key (114)."/>
<page href="flash/ui/Keyboard.html#F4" title="Keyboard.F4" text="F4 Constant associated with the key code value for the F4 key (115)."/>
<page href="flash/ui/Keyboard.html#F5" title="Keyboard.F5" text="F5 Constant associated with the key code value for the F5 key (116)."/>
<page href="flash/ui/Keyboard.html#F6" title="Keyboard.F6" text="F6 Constant associated with the key code value for the F6 key (117)."/>
<page href="flash/ui/Keyboard.html#F7" title="Keyboard.F7" text="F7 Constant associated with the key code value for the F7 key (118)."/>
<page href="flash/ui/Keyboard.html#F8" title="Keyboard.F8" text="F8 Constant associated with the key code value for the F8 key (119)."/>
<page href="flash/ui/Keyboard.html#F9" title="Keyboard.F9" text="F9 Constant associated with the key code value for the F9 key (120)."/>
<page href="flash/ui/Keyboard.html#HOME" title="Keyboard.HOME" text="HOME Constant associated with the key code value for the Home key (36)."/>
<page href="flash/ui/Keyboard.html#INSERT" title="Keyboard.INSERT" text="INSERT Constant associated with the key code value for the Insert key (45)."/>
<page href="flash/ui/Keyboard.html#LEFT" title="Keyboard.LEFT" text="LEFT Constant associated with the key code value for the Left Arrow key (37)."/>
<page href="flash/ui/Keyboard.html#numLock" title="Keyboard.numLock" text="numLock Specifies whether the Num Lock key is activated (true) or not (false)."/>
<page href="flash/ui/Keyboard.html#NUMPAD_0" title="Keyboard.NUMPAD_0" text="NUMPAD_0 Constant associated with the key code value for the number 0 key on the number pad (96)."/>
<page href="flash/ui/Keyboard.html#NUMPAD_1" title="Keyboard.NUMPAD_1" text="NUMPAD_1 Constant associated with the key code value for the number 1 key on the number pad (97)."/>
<page href="flash/ui/Keyboard.html#NUMPAD_2" title="Keyboard.NUMPAD_2" text="NUMPAD_2 Constant associated with the key code value for the number 2 key on the number pad (98)."/>
<page href="flash/ui/Keyboard.html#NUMPAD_3" title="Keyboard.NUMPAD_3" text="NUMPAD_3 Constant associated with the key code value for the number 3 key on the number pad (99)."/>
<page href="flash/ui/Keyboard.html#NUMPAD_4" title="Keyboard.NUMPAD_4" text="NUMPAD_4 Constant associated with the key code value for the number 4 key on the number pad (100)."/>
<page href="flash/ui/Keyboard.html#NUMPAD_5" title="Keyboard.NUMPAD_5" text="NUMPAD_5 Constant associated with the key code value for the number 5 key on the number pad (101)."/>
<page href="flash/ui/Keyboard.html#NUMPAD_6" title="Keyboard.NUMPAD_6" text="NUMPAD_6 Constant associated with the key code value for the number 6 key on the number pad (102)."/>
<page href="flash/ui/Keyboard.html#NUMPAD_7" title="Keyboard.NUMPAD_7" text="NUMPAD_7 Constant associated with the key code value for the number 7 key on the number pad (103)."/>
<page href="flash/ui/Keyboard.html#NUMPAD_8" title="Keyboard.NUMPAD_8" text="NUMPAD_8 Constant associated with the key code value for the number 8 key on the number pad (104)."/>
<page href="flash/ui/Keyboard.html#NUMPAD_9" title="Keyboard.NUMPAD_9" text="NUMPAD_9 Constant associated with the key code value for the number 9 key on the number pad (105)."/>
<page href="flash/ui/Keyboard.html#NUMPAD_ADD" title="Keyboard.NUMPAD_ADD" text="NUMPAD_ADD Constant associated with the key code value for the addition key on the number pad (107)."/>
<page href="flash/ui/Keyboard.html#NUMPAD_DECIMAL" title="Keyboard.NUMPAD_DECIMAL" text="NUMPAD_DECIMAL Constant associated with the key code value for the decimal key on the number pad (110)."/>
<page href="flash/ui/Keyboard.html#NUMPAD_DIVIDE" title="Keyboard.NUMPAD_DIVIDE" text="NUMPAD_DIVIDE Constant associated with the key code value for the division key on the number pad (111)."/>
<page href="flash/ui/Keyboard.html#NUMPAD_ENTER" title="Keyboard.NUMPAD_ENTER" text="NUMPAD_ENTER Constant associated with the key code value for the Enter key on the number pad (108)."/>
<page href="flash/ui/Keyboard.html#NUMPAD_MULTIPLY" title="Keyboard.NUMPAD_MULTIPLY" text="NUMPAD_MULTIPLY Constant associated with the key code value for the multiplication key on the number pad (106)."/>
<page href="flash/ui/Keyboard.html#NUMPAD_SUBTRACT" title="Keyboard.NUMPAD_SUBTRACT" text="NUMPAD_SUBTRACT Constant associated with the key code value for the subtraction key on the number pad (109)."/>
<page href="flash/ui/Keyboard.html#PAGE_DOWN" title="Keyboard.PAGE_DOWN" text="PAGE_DOWN Constant associated with the key code value for the Page Down key (34)."/>
<page href="flash/ui/Keyboard.html#PAGE_UP" title="Keyboard.PAGE_UP" text="PAGE_UP Constant associated with the key code value for the Page Up key (33)."/>
<page href="flash/ui/Keyboard.html#RIGHT" title="Keyboard.RIGHT" text="RIGHT Constant associated with the key code value for the Right Arrow key (39)."/>
<page href="flash/ui/Keyboard.html#SHIFT" title="Keyboard.SHIFT" text="SHIFT Constant associated with the key code value for the Shift key (16)."/>
<page href="flash/ui/Keyboard.html#SPACE" title="Keyboard.SPACE" text="SPACE Constant associated with the key code value for the Spacebar (32)."/>
<page href="flash/ui/Keyboard.html#TAB" title="Keyboard.TAB" text="TAB Constant associated with the key code value for the Tab key (9)."/>
<page href="flash/ui/Keyboard.html#UP" title="Keyboard.UP" text="UP Constant associated with the key code value for the Up Arrow key (38)."/>
<page href="flash/ui/ContextMenu.html" title="ContextMenu class" text="ContextMenu The ContextMenu class provides control over the items in the Flash Player context menu. Users open the context menu by right-clicking (Windows) or Control-clicking (Macintosh) Flash Player. You can use the methods and properties of the ContextMenu class to add custom menu items, control the display of the built-in context menu items (for example, Zoom In and Print), or create copies of menus. You can attach a ContextMenu object to a specific button, movie clip, or text field object, or to an entire movie level. You use the menu property of the Button, MovieClip, or TextField class to do this. For more information about the menu property, see Button.menu, MovieClip.menu, and TextField.menu. To add new items to a ContextMenu object, you create a ContextMenuItem object, and then add that object to the ContextMenu.customItems array. For more information about creating context menu items, see the ContextMenuItem class entry. Flash Player has three types of context menus: the standard menu (which appears when you right-click in Flash Player), the edit menu (which appears when you right-click a selectable or editable text field), and an error menu (which appears when a SWF file has failed to load into Flash Player). Only the standard and edit menus can be modified with the ContextMenu class. Custom menu items always appear at the top of the Flash Player context menu, above any visible built-in menu items; a separator bar distinguishes built-in and custom menu items. You can add no more than 15 custom items to a context menu. You cannot remove the Settings menu item from the context menu. The Settings menu item is required in Flash so that users can access the settings that affect privacy and storage on their computers. You also cannot remove the About menu item, which is required so that users can find out what version of Flash Player they are using. You must use the ContextMenu() constructor to create a ContextMenu object before calling its methods."/>
<page href="flash/ui/ContextMenu.html#ContextMenu()" title="ContextMenu.ContextMenu()" text="ContextMenu Creates a ContextMenu object."/>
<page href="flash/ui/ContextMenu.html#clone()" title="ContextMenu.clone()" text="clone Creates a copy of the specified ContextMenu object. The copy inherits all the properties of the original menu object."/>
<page href="flash/ui/ContextMenu.html#hideBuiltInItems()" title="ContextMenu.hideBuiltInItems()" text="hideBuiltInItems Hides all built-in menu items (except Settings) in the specified ContextMenu object. If the debugger version of Flash Player is running, the Debugging menu item appears, although it is dimmed for SWF files that do not have remote debugging enabled. This method hides only menu items that appear in the standard context menu; it does not affect items that appear in the edit and error menus. This method works by setting all the Boolean members of my_cm.builtInItems to false. You can selectively make a built-in item visible by setting its corresponding member in my_cm.builtInItems to true."/>
<page href="flash/ui/ContextMenu.html#builtInItems" title="ContextMenu.builtInItems" text="builtInItems An object that has the following properties of the ContextMenuBuiltInItems class: forwardAndBack, loop, play, print, quality, rewind, save, and zoom. Setting these properties to false removes the corresponding menu items from the specified ContextMenu object. These properties are enumerable and are set to true by default."/>
<page href="flash/ui/ContextMenu.html#customItems" title="ContextMenu.customItems" text="customItems An array of ContextMenuItem objects. Each object in the array represents a context menu item that you have defined. Use this property to add, remove, or modify these custom menu items. To add new menu items, you create a ContextMenuItem object and then add it to the customItems array (for example, by using Array.push()). For more information about creating menu items, see the ContextMenuItem class entry."/>
<page href="flash/ui/ContextMenu.html#event:menuSelect" title="ContextMenu.menuSelect" text="menuSelect Dispatched when a user first generates a context menu but before the contents of the context menu are displayed. This allows your program to modify the set of context menu items before displaying the menu. The user generates the context menu by right-clicking the pointing device."/>
<page href="flash/ui/ContextMenuItem.html" title="ContextMenuItem class" text="ContextMenuItem Use the ContextMenuItem class to create custom menu items to display in the Flash Player context menu. Each ContextMenuItem object has a caption (text) that is displayed in the context menu. To add a new item to a context menu, you add it to the customItems array of a ContextMenu object. With the properties of the ContextMenuItem class you can enable or disable specific menu items, and you can make items visible or invisible. You write an event handler for the menuItemSelect event to add functionality to the menu item when the user selects it. Custom menu items appear at the top of the context menu, above any built-in items. A separator bar always divides custom menu items from built-in items. Restrictions: You can add no more than 15 custom items to a context menu. Each caption must contain at least one visible character. Control characters, newlines, and other white space characters are ignored. No caption can be more than 100 characters long. Captions that are identical to any built-in menu item, or to another custom item, are ignored, whether the matching item is visible or not. Menu captions are compared to built-in captions or existing custom captions without regard to case, punctuation, or white space. The following captions are not allowed, but the words may be used in conjunction with other words to form a custom caption (for example, although &quot;Paste&quot; is not allowed, &quot;Paste tastes great&quot; is allowed): Save Zoom In Zoom Out 100% Show All Quality Play Loop Rewind Forward Back Movie not loaded About Print Show Redraw Regions Debugger Undo Cut Copy Paste Delete Select All Open Open in new window Copy link None of the following words can appear in a custom caption on their own or in conjunction with other words: Adobe Macromedia Flash Player Settings Note: When the player is running on a non-English system, the caption strings are compared to both the English list and the localized equivalents."/>
<page href="flash/ui/ContextMenuItem.html#ContextMenuItem()" title="ContextMenuItem.ContextMenuItem()" text="ContextMenuItem Creates a new ContextMenuItem object that can be added to the ContextMenu.customItems array. caption separatorBefore enabled visible Specifies the text associated with the menu item. See the ContextMenuItem class overview for caption value restrictions. Specifies whether a separator bar appears above the menu item in the context menu. The default value is false. Specifies whether the menu item is enabled or disabled in the context menu. The default value is true (enabled). This parameter is optional. Specifies whether the menu item is visible or invisible. The default value is true (visible)."/>
<page href="flash/ui/ContextMenuItem.html#clone()" title="ContextMenuItem.clone()" text="clone Creates and returns a copy of the specified ContextMenuItem object. The copy includes all properties of the original object."/>
<page href="flash/ui/ContextMenuItem.html#caption" title="ContextMenuItem.caption" text="caption Specifies the menu item caption (text) displayed in the context menu. See the ContextMenuItem class overview for caption value restrictions."/>
<page href="flash/ui/ContextMenuItem.html#enabled" title="ContextMenuItem.enabled" text="enabled Indicates whether the specified menu item is enabled or disabled."/>
<page href="flash/ui/ContextMenuItem.html#separatorBefore" title="ContextMenuItem.separatorBefore" text="separatorBefore Indicates whether a separator bar should appear above the specified menu item. Note: A separator bar always appears between any custom menu items and the built-in menu items."/>
<page href="flash/ui/ContextMenuItem.html#visible" title="ContextMenuItem.visible" text="visible Indicates whether the specified menu item is visible when the Flash Player context menu is displayed."/>
<page href="flash/ui/ContextMenuItem.html#event:menuItemSelect" title="ContextMenuItem.menuItemSelect" text="menuItemSelect Dispatched when a user selects an item from a context menu. The user generates the context menu by clicking the secondary button of the user's pointing device."/>
<page href="flash/ui/KeyLocation.html" title="KeyLocation class" text="KeyLocation The KeyLocation class contains constants that indicate the location of a key pressed on the keyboard. The KeyLocation constants are used in the KeyboardEvent.keyLocation property."/>
<page href="flash/ui/KeyLocation.html#LEFT" title="KeyLocation.LEFT" text="LEFT Indicates the key activated is in the left key location (there is more than one possible location for this key). Example: The left Shift key on a PC 101 Key US keyboard."/>
<page href="flash/ui/KeyLocation.html#NUM_PAD" title="KeyLocation.NUM_PAD" text="NUM_PAD Indicates the key activation originated on the numeric keypad or with a virtual key corresponding to the numeric keypad. Example: The 1 key on a PC 101 Key US keyboard located on the numeric pad."/>
<page href="flash/ui/KeyLocation.html#RIGHT" title="KeyLocation.RIGHT" text="RIGHT Indicates the key activated is in the right key location (there is more than one possible location for this key). Example: The right Shift key on a PC 101 Key US keyboard."/>
<page href="flash/ui/KeyLocation.html#STANDARD" title="KeyLocation.STANDARD" text="STANDARD Indicates the key activation is not distinguished as the left or right version of the key, and did not originate on the numeric keypad (or did not originate with a virtual key corresponding to the numeric keypad). Example: The Q key on a PC 101 Key US keyboard."/>
<page href="flash/ui/Mouse.html" title="Mouse class" text="Mouse The methods of the Mouse class are used to hide and show the mouse pointer. The Mouse class is a top-level class whose properties and methods you can access without using a constructor. The pointer is visible by default, but you can hide it and implement a custom pointer."/>
<page href="flash/ui/Mouse.html#hide()" title="Mouse.hide()" text="hide Hides the pointer. The pointer is visible by default."/>
<page href="flash/ui/Mouse.html#show()" title="Mouse.show()" text="show Displays the pointer. The pointer is visible by default."/>
<page href="flash/ui/ContextMenuBuiltInItems.html" title="ContextMenuBuiltInItems class" text="ContextMenuBuiltInItems The ContextMenuBuiltInItems class describes the items that are built in to a context menu. You can hide these items by using the ContextMenu.hideBuiltInItems() method."/>
<page href="flash/ui/ContextMenuBuiltInItems.html#ContextMenuBuiltInItems()" title="ContextMenuBuiltInItems.ContextMenuBuiltInItems()" text="ContextMenuBuiltInItems Creates a new ContextMenuBuiltInItems object so that you can set the properties for Flash Player to display or hide each menu item."/>
<page href="flash/ui/ContextMenuBuiltInItems.html#forwardAndBack" title="ContextMenuBuiltInItems.forwardAndBack" text="forwardAndBack Lets the user move forward or backward one frame in a SWF file at run time (does not appear for a single-frame SWF file)."/>
<page href="flash/ui/ContextMenuBuiltInItems.html#loop" title="ContextMenuBuiltInItems.loop" text="loop Lets the user set a SWF file to start over automatically when it reaches the final frame (does not appear for a single-frame SWF file)."/>
<page href="flash/ui/ContextMenuBuiltInItems.html#play" title="ContextMenuBuiltInItems.play" text="play Lets the user start a paused SWF file (does not appear for a single-frame SWF file)."/>
<page href="flash/ui/ContextMenuBuiltInItems.html#print" title="ContextMenuBuiltInItems.print" text="print Lets the user send the displayed frame image to a printer."/>
<page href="flash/ui/ContextMenuBuiltInItems.html#quality" title="ContextMenuBuiltInItems.quality" text="quality Lets the user set the resolution of the SWF file at run time."/>
<page href="flash/ui/ContextMenuBuiltInItems.html#rewind" title="ContextMenuBuiltInItems.rewind" text="rewind Lets the user set a SWF file to play from the first frame when selected, at any time (does not appear for a single-frame SWF file)."/>
<page href="flash/ui/ContextMenuBuiltInItems.html#save" title="ContextMenuBuiltInItems.save" text="save Lets the user with Shockmachine installed save a SWF file."/>
<page href="flash/ui/ContextMenuBuiltInItems.html#zoom" title="ContextMenuBuiltInItems.zoom" text="zoom Lets the user zoom in and out on a SWF file at run time."/>
<page href="fl/video/INCManager.html" title="INCManager interface" text="INCManager The INCManager is the interface for classes that create the flash.net.NetConnection for the VideoPlayer class. The default INCManager implementation is the NCManager class. Use the NCManagerNative class when streaming from a Flash Media Server (FMS). You can also create a custom class that implements the INCManager interface and then have the VideoPlayer class use that class to create the NetConnection. Use the following code to register a custom class as the INCManager implementation used by the VideoPlayer object. Replace fl.video.NCManagerNative with your custom class. fl.video.VideoPlayer.iNCManagerClass = fl.video.NCManagerNative;"/>
<page href="fl/video/INCManager.html#close()" title="INCManager.close()" text="close Closes the NetConnection."/>
<page href="fl/video/INCManager.html#connectAgain()" title="INCManager.connectAgain()" text="connectAgain Called by the VideoPlayer object if the connection is successfully made but the stream is not found. If multiple alternate interpretations of the RTMP URL are possible, it tries to connect to the server with a different URL and hand back a different stream name. This can be necessary in cases where the URL is something like rtmp://servername/path1/path2/path3. When passing in an application name and an instance name, open the NetConnection object with rtmp://servername/path1/path2, or use the default instance so the stream is opened with path2/path3. In general, this is possible whenever there are more than two parts to the path but not possible if there are only two (there should never be only one)."/>
<page href="fl/video/INCManager.html#connectToURL()" title="INCManager.connectToURL()" text="connectToURL Called by the VideoPlayer object to ask for a connection to the URL. Once a connection is successful or failed, then call the VideoPlayer.ncConnected() method. If the connection has failed, then set nc = null before calling. url The URL to which the VideoPlayer object requests connection."/>
<page href="fl/video/INCManager.html#getProperty()" title="INCManager.getProperty()" text="getProperty Gets values of arbitrary properties supported by the class implementing INCManager. See the specific implementing class for list of supported properties. Calling this method on an unsupported property throws a VideoError object with code VideoError.UNSUPPORTED_PROPERTY=1011. propertyName The name of the property that the getProperty method is calling."/>
<page href="fl/video/INCManager.html#helperDone()" title="INCManager.helperDone()" text="helperDone Called by any helper object doing a task for the NCManager object to signal it has completed and whether it was successful. The NCManager object uses this with SMILManager. helper success The helper object. A setting to signal when a task is completed. If success is true, then the task was completed successfully; otherwise false."/>
<page href="fl/video/INCManager.html#reconnect()" title="INCManager.reconnect()" text="reconnect Called by the VideoPlayer object to ask for reconnection after the connection is lost. Once the connection is either successful or failed, call the VideoPlayer.ncReconnected() method. If the connection failed, set nc = null before calling."/>
<page href="fl/video/INCManager.html#setProperty()" title="INCManager.setProperty()" text="setProperty Sets values of arbitrary properties supported by the class implementing INCManager. See the specific implementing class for list of supported properties. Calling this method on an unsupported property throws a VideoError object with code VideoError.UNSUPPORTED_PROPERTY=1011. propertyName value The name of the property that the setProperty method is calling. The property value."/>
<page href="fl/video/INCManager.html#bitrate" title="INCManager.bitrate" text="bitrate The bandwidth, in bits per second, used to switch between multiple streams."/>
<page href="fl/video/INCManager.html#isRTMP" title="INCManager.isRTMP" text="isRTMP Whether the URL is for RTMP streaming from a Flash Media Server (FMS) or a progressive download. If the stream is an RTMP stream from an FMS, then true. If the stream is a progressive download of an HTTP, local or other file, then false."/>
<page href="fl/video/INCManager.html#netConnection" title="INCManager.netConnection" text="netConnection Reference to the NetConnection object."/>
<page href="fl/video/INCManager.html#streamHeight" title="INCManager.streamHeight" text="streamHeight Height of the stream, in pixels. After the VideoPlayer.ncConnected() method is called, if the streamHeight property is less than 0, that indicates to the VideoPlayer object that there is no stream height information. If the VideoPlayer object has the scaleMode property set to VideoScaleMode.MAINTAIN_ASPECT_RATIO or VideoScaleMode.NO_SCALE, then this value will be used and the resizing will happen instantly, rather than waiting."/>
<page href="fl/video/INCManager.html#streamLength" title="INCManager.streamLength" text="streamLength Length of the stream, in seconds. After the VideoPlayer.ncConnected() method is called, if it returns undefined, null or less than 0, then the VideoPlayer object knows that there is no stream length information. If stream length information is returned, it overrides any existing steam length information including information set by the totalTime parameter of the VideoPlayer.play() method or the VideoPlayer.load() method or information received from the FLV file's metadata."/>
<page href="fl/video/INCManager.html#streamName" title="INCManager.streamName" text="streamName The stream name passed into the NetStream.play() method."/>
<page href="fl/video/INCManager.html#streamWidth" title="INCManager.streamWidth" text="streamWidth Width of the stream, in pixels. After the VideoPlayer.ncConnected() method is called, if the streamWidth property is less than 0, that indicates to the VideoPlayer object that there is no stream width information. If the VideoPlayer object has the scaleMode property set to VideoScaleMode.MAINTAIN_ASPECT_RATIO or VideoScaleMode.NO_SCALE, then this value is used and the resizing happens instantly, rather than waiting."/>
<page href="fl/video/INCManager.html#timeout" title="INCManager.timeout" text="timeout The time in milliseconds after which attempts to make a connection stop."/>
<page href="fl/video/INCManager.html#videoPlayer" title="INCManager.videoPlayer" text="videoPlayer The VideoPlayer object that owns this object."/>
<page href="fl/video/CaptionChangeEvent.html" title="CaptionChangeEvent class" text="CaptionChangeEvent The CaptionChangeEvent is dispatched any time a caption is added or removed from the caption target text field. The event is also dispatched when the following conditions are true: the captionTargetName property is not set the captionTarget property is not set the FLVPlaybackCaptioning instance creates a TextField object automatically for captioning."/>
<page href="fl/video/CaptionChangeEvent.html#CaptionChangeEvent()" title="CaptionChangeEvent.CaptionChangeEvent()" text="CaptionChangeEvent Creates an Event object that contains information about captionChange events. Event objects are passed as parameters to event listeners. type bubbles cancelable added captionCuePointObject The type of the event. Event listeners can access this information through the inherited type property. There is only one type of captionChange event: CaptionChangeEvent.CAPTION_CHANGE. Determines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. Determines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. A Boolean value that indicates whether the caption was added or removed from the display. The cue point object for this caption."/>
<page href="fl/video/CaptionChangeEvent.html#added" title="CaptionChangeEvent.added" text="added A Boolean value that determines whether the caption was added or removed."/>
<page href="fl/video/CaptionChangeEvent.html#CAPTION_CHANGE" title="CaptionChangeEvent.CAPTION_CHANGE" text="CAPTION_CHANGE Defines the value of the type property of a captionChange event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. addedA Boolean that indicates whether the caption was added or removed from the display. captionCuePointObjectThe cue point object for this caption."/>
<page href="fl/video/CaptionChangeEvent.html#captionCuePointObject" title="CaptionChangeEvent.captionCuePointObject" text="captionCuePointObject The cue point object for the caption that was added or removed."/>
<page href="fl/video/CaptionChangeEvent.html#event:captionChange" title="CaptionChangeEvent.captionChange" text="captionChange Defines the value of the type property of a captionChange event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. addedA Boolean that indicates whether the caption was added or removed from the display. captionCuePointObjectThe cue point object for this caption."/>
<page href="fl/video/VideoAlign.html" title="VideoAlign class" text="VideoAlign The VideoAlign class provides constant values to use for the FLVPlayback.align and VideoPlayer.align properties."/>
<page href="fl/video/VideoAlign.html#BOTTOM" title="VideoAlign.BOTTOM" text="BOTTOM Specifies that the video is aligned at the bottom."/>
<page href="fl/video/VideoAlign.html#BOTTOM_LEFT" title="VideoAlign.BOTTOM_LEFT" text="BOTTOM_LEFT Specifies that the video is aligned in the bottom-left corner."/>
<page href="fl/video/VideoAlign.html#BOTTOM_RIGHT" title="VideoAlign.BOTTOM_RIGHT" text="BOTTOM_RIGHT Specifies that the video is aligned in the bottom-right corner."/>
<page href="fl/video/VideoAlign.html#CENTER" title="VideoAlign.CENTER" text="CENTER Specifies that the video is aligned in the center."/>
<page href="fl/video/VideoAlign.html#LEFT" title="VideoAlign.LEFT" text="LEFT Specifies that the video is aligned on the left."/>
<page href="fl/video/VideoAlign.html#RIGHT" title="VideoAlign.RIGHT" text="RIGHT Specifies that the video is aligned to the right."/>
<page href="fl/video/VideoAlign.html#TOP" title="VideoAlign.TOP" text="TOP Specifies that the video is aligned at the top."/>
<page href="fl/video/VideoAlign.html#TOP_LEFT" title="VideoAlign.TOP_LEFT" text="TOP_LEFT Specifies that the video is aligned in the top-left corner."/>
<page href="fl/video/VideoAlign.html#TOP_RIGHT" title="VideoAlign.TOP_RIGHT" text="TOP_RIGHT Specifies that the video is aligned in the top-right corner."/>
<page href="fl/video/IVPEvent.html" title="IVPEvent interface" text="IVPEvent The IVPEvent interface is implemented by video events that apply to a specific VideoPlayer object within the FLVPlayback component. When multiple VideoPlayer objects are used within the FLVPlayback component, each one is assigned a different index, and these indices are used with the visibleVideoPlayerIndex property, the activeVideoPlayerIndex property, and the getVideoPlayer() method. When an event is triggered that is specific to a single VideoPlayer object, the event class implements the IVPEvent interface and the vp property is equal to the index of the VideoPlayer object involved in the event."/>
<page href="fl/video/IVPEvent.html#type" title="IVPEvent.type" text="type The type of event. The type is case-sensitive."/>
<page href="fl/video/IVPEvent.html#vp" title="IVPEvent.vp" text="vp The index of the VideoPlayer object involved in this event."/>
<page href="fl/video/CuePointType.html" title="CuePointType class" text="CuePointType The CuePointType class provides constant values for the type property on the info object of a MetadataEvent instance of type CUE_POINT. This type property is always EVENT, NAVIGATION, or ACTIONSCRIPT. All of these constants can also be passed into the FLVPlayback.findCuePoint() and FLVPlayback.findNearestCuePoint() methods as the type parameter. The ALL and FLV constants describe multiple types of cue points for these methods."/>
<page href="fl/video/CuePointType.html#ACTIONSCRIPT" title="CuePointType.ACTIONSCRIPT" text="ACTIONSCRIPT Defines the value of the type parameter of the findCuePoint() and findNearestCuePoint() methods. Additionally, the ACTIONSCRIPT constant can be a value for the type property on the info object of a MetadataEvent instance of type CUE_POINT."/>
<page href="fl/video/CuePointType.html#ALL" title="CuePointType.ALL" text="ALL Defines the value of the type parameter of the findCuePoint() and findNearestCuePoint() methods. This constant describes all of the cue points: EVENT, NAVIGATION, and ACTIONSCRIPT."/>
<page href="fl/video/CuePointType.html#EVENT" title="CuePointType.EVENT" text="EVENT Defines the value of the type parameter of the findCuePoint() and findNearestCuePoint() methods. Additionally, the EVENT constant can be a value for the type property on the info object of a MetadataEvent instance of type CUE_POINT."/>
<page href="fl/video/CuePointType.html#FLV" title="CuePointType.FLV" text="FLV Defines the value of the type parameter of the findCuePoint() and findNearestCuePoint() methods. This constant describes the group of all cue points embedded within a FLV file: NAVIGATION and EVENT."/>
<page href="fl/video/CuePointType.html#NAVIGATION" title="CuePointType.NAVIGATION" text="NAVIGATION Defines the value of the type parameter of the findCuePoint() and findNearestCuePoint() methods. Additionally, the NAVIGATION constant can be a value for the type property on the info object of a MetadataEvent instance of type CUE_POINT."/>
<page href="fl/video/CaptionTargetEvent.html" title="CaptionTargetEvent class" text="CaptionTargetEvent Type for the captionTargetCreated event, dispatched after the captionTargetCreated event is created automatically and before any captions have been added to it. This event is not dispatched if the captionTarget property is set with a custom display object, or if the captionTargetName property is set. This is useful for customizing the properties of the TextField object, such as the defaultTextFormat property."/>
<page href="fl/video/CaptionTargetEvent.html#CaptionTargetEvent()" title="CaptionTargetEvent.CaptionTargetEvent()" text="CaptionTargetEvent Creates an Event object that contains information about caption target events. Event objects are passed as parameters to event listeners. type bubbles cancelable captionTarget The type of the event. Event listeners can access this information through the inherited type property. There is only one type of captionTargetCreated event: CaptionTargetEvent.CAPTION_CHANGE. Determines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. Determines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. A display object which is from the captionTarget property of the FLVPlaybackCaptioning instance."/>
<page href="fl/video/CaptionTargetEvent.html#CAPTION_TARGET_CREATED" title="CaptionTargetEvent.CAPTION_TARGET_CREATED" text="CAPTION_TARGET_CREATED The CaptionTargetEvent.CAPTION_TARGET_CREATED constant defines the value of the type property of a captionTargetCreated event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. captionTargetA display object that is from the captionTarget property of the FLVPlaybackCaptioning instance."/>
<page href="fl/video/CaptionTargetEvent.html#captionTarget" title="CaptionTargetEvent.captionTarget" text="captionTarget The caption target from the FLVPlaybackCaptioning instance property of the same name."/>
<page href="fl/video/CaptionTargetEvent.html#event:captionTargetCreated" title="CaptionTargetEvent.captionTargetCreated" text="captionTargetCreated The CaptionTargetEvent.CAPTION_TARGET_CREATED constant defines the value of the type property of a captionTargetCreated event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. captionTargetA display object that is from the captionTarget property of the FLVPlaybackCaptioning instance."/>
<page href="fl/video/FLVPlaybackCaptioning.html" title="FLVPlaybackCaptioning class" text="FLVPlaybackCaptioning The FLVPlaybackCaptioning component enables captioning for the FLVPlayback component. The FLVPlaybackCaptioning component downloads a Timed Text (TT) XML file and applies those captions to an FLVPlayback component to which this component is partnered. For more information on Timed Text format, see http://www.w3.org/AudioVideo/TT/. The FLVPlaybackCaptioning component supports a subset of the Timed Text 1.0 specification. For detailed information on the supported subset, see Timed Text Tags. The following is a brief example: &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;tt xml:lang=&quot;en&quot; xmlns=&quot;http://www.w3.org/2006/04/ttaf1&quot; xmlns:tts=&quot;http://www.w3.org/2006/04/ttaf1#styling&quot;&gt; &lt;head&gt; &lt;styling&gt; &lt;style id=&quot;1&quot; tts:textAlign=&quot;right&quot;/&gt; &lt;style id=&quot;2&quot; tts:color=&quot;transparent&quot;/&gt; &lt;style id=&quot;3&quot; style=&quot;2&quot; tts:backgroundColor=&quot;white&quot;/&gt; &lt;style id=&quot;4&quot; style=&quot;2 3&quot; tts:fontSize=&quot;20&quot;/&gt; &lt;/styling&gt; &lt;/head&gt; &lt;body&gt; &lt;div xml:lang=&quot;en&quot;&gt; &lt;p begin=&quot;00:00:00.50&quot; dur=&quot;500ms&quot;&gt;Four score and twenty years ago&lt;/p&gt; &lt;p begin=&quot;00:00:02.50&quot;&gt;&lt;span tts:fontFamily=&quot;monospaceSansSerif,proportionalSerif,TheOther&quot;tts:fontSize=&quot;+2&quot;&gt;our forefathers&lt;/span&gt; brought forth&lt;br /&gt; on this continent&lt;/p&gt; &lt;p begin=&quot;00:00:04.40&quot; dur=&quot;10s&quot; style=&quot;1&quot;&gt;a &lt;span tts:fontSize=&quot;12 px&quot;&gt;new&lt;/span&gt; &lt;span tts:fontSize=&quot;300%&quot;&gt;nation&lt;/span&gt;&lt;/p&gt; &lt;p begin=&quot;00:00:06.50&quot; dur=&quot;3&quot;&gt;conceived in &lt;span tts:fontWeight=&quot;bold&quot; tts:color=&quot;#ccc333&quot;&gt;liberty&lt;/span&gt; &lt;span tts:color=&quot;#ccc333&quot;&gt;and dedicated to&lt;/span&gt; the proposition&lt;/p&gt; &lt;p begin=&quot;00:00:11.50&quot; tts:textAlign=&quot;right&quot;&gt;that &lt;span tts:fontStyle=&quot;italic&quot;&gt;all&lt;/span&gt; men are created equal.&lt;/p&gt; &lt;p begin=&quot;15s&quot; style=&quot;4&quot;&gt;The end.&lt;/p&gt; &lt;/div&gt; &lt;/body&gt; &lt;/tt&gt;"/>
<page href="fl/video/FLVPlaybackCaptioning.html#FLVPlaybackCaptioning()" title="FLVPlaybackCaptioning.FLVPlaybackCaptioning()" text="FLVPlaybackCaptioning Creates a new FLVPlaybackCaptioning instance."/>
<page href="fl/video/FLVPlaybackCaptioning.html#autoLayout" title="FLVPlaybackCaptioning.autoLayout" text="autoLayout Determines whether the FLVPlaybackCaptioning component automatically moves and resizes the TextField object for captioning. If the autoLayout property is set to true, the DisplayObject instance or the TextField object containing the captions displays 10 pixels from the bottom of the FLVPlayback instance. The captioning area covers the width of the FLVPlayback instance, maintaining a margin of 10 pixels on each side. When this property is set to true, the DisplayObject instance or TextField object displays directly over the FLVPlayback instance. If you are creating your own TextField object, you should set autoLayout to false. If wordWrap = false, the captioning area centers over the FLVPlayback instance, but it can be wider than the FLVPlayback instance. To control layout, you need to listen for the captionChange event to determine when the TextField object instance is created."/>
<page href="fl/video/FLVPlaybackCaptioning.html#captionButton" title="FLVPlaybackCaptioning.captionButton" text="captionButton Defines the captionButton FLVPlayback custom UI component instance which provides toggle capabilities to turn captioning on and off. The captionButton property functions similarly to the FLVPlayback properties playButton, pauseButton, muteButton, and so on."/>
<page href="fl/video/FLVPlaybackCaptioning.html#captionTarget" title="FLVPlaybackCaptioning.captionTarget" text="captionTarget Sets the DisplayObject instance in which to display captions. If you set the instance as a TextField object, it is targeted directly. If you set the instance as a DisplayObjectContainer containing one or more TextField objects, the captions display in the TextField object with the lowest display index. The DisplayObjectContainer method supports a movie-clip like object with a scale-9 background, which can be scaled when the TextField object size changes. For more complex scaling and drawing, write code to have the DisplayObjectContainer method listen for a captionChange event. Note If the captionTargetName or the captionTarget property is not set, the FLVPlaybackCaptioning instance creates a text field set by the captionTarget property with this formatting: black background (background = true; backgroundColor = 0x000000;) white text (textColor = 0xFFFFFF) autoSize = TextFieldAutoSize.LEFT multiLine = true wordWrap = true font = &quot;_sans&quot; size = 12 To customize these values, listen for the captionTargetCreated event."/>
<page href="fl/video/FLVPlaybackCaptioning.html#captionTargetName" title="FLVPlaybackCaptioning.captionTargetName" text="captionTargetName The instance name of the TextField object or MovieClip enclosing a Textfield object that contains the captions. To specify no target, set this property to an empty string (that is, no target specified) or auto. This property is primarily used in the Component inspector. If you are writing code, use the captionTarget property instead."/>
<page href="fl/video/FLVPlaybackCaptioning.html#flvPlayback" title="FLVPlaybackCaptioning.flvPlayback" text="flvPlayback Sets the FLVPlayback instance to caption. The FLVPlayback instance must have the same parent as the FLVPlaybackCaptioning instance. If the flvPlaybackName or flvPlayback property is not set, the FLVPlaybackCaptioning instance will look for a FLVPlayback instance with the same parent and caption the first one it finds."/>
<page href="fl/video/FLVPlaybackCaptioning.html#flvPlaybackName" title="FLVPlaybackCaptioning.flvPlaybackName" text="flvPlaybackName Sets an FLVPlayback instance name for the FLVPlayback instance that you want to caption. To specify no target, set this to an empty string or auto. The FLVPlayback instance must have the same parent as the FLVPlaybackCaptioning instance. The FLVPlayback instance name is primarily used in the Component inspector. If you are writing code, use the flvPlayback property. If the flvPlaybackName or the flvPlayback property is not set or set to auto, the FLVPlaybackCaptioning instance searches for a FLVPlayback instance with the same parent and captions the first one it finds."/>
<page href="fl/video/FLVPlaybackCaptioning.html#SHORT_VERSION" title="FLVPlaybackCaptioning.SHORT_VERSION" text="SHORT_VERSION State variable indicating the short version number of the component. The version number is useful when you have a FLA file and need to know the component version. To determine the component version, type the following trace into the FLA file: trace (FLVPlaybackCaptioning.SHORT_VERSION); The SHORT_VERSION variable includes only the major and minor version numbers, for example, 2.0. The version variable includes the major and minor version numbers as well as the revision and build numbers, for example, 2.0.0.xx."/>
<page href="fl/video/FLVPlaybackCaptioning.html#showCaptions" title="FLVPlaybackCaptioning.showCaptions" text="showCaptions Used to display captions; true = display captions, false = do not display captions. If you use the captionButton property to allow the user to turn captioning on and off, set the showCaptions property to false."/>
<page href="fl/video/FLVPlaybackCaptioning.html#simpleFormatting" title="FLVPlaybackCaptioning.simpleFormatting" text="simpleFormatting Limits formatting instructions from the Timed Text file when set to true. The following styles are not supported if the simpleFormatting property is set to true: tts:backgroundColor tts:color tts:fontSize tts:fontFamily tts:wrapOption The following styles are supported if the simpleFormatting property is set to true: tts:fontStyle tts:fontWeight tts:textAlign"/>
<page href="fl/video/FLVPlaybackCaptioning.html#source" title="FLVPlaybackCaptioning.source" text="source URL of the Timed Text XML file that contains caption information (required property)."/>
<page href="fl/video/FLVPlaybackCaptioning.html#track" title="FLVPlaybackCaptioning.track" text="track Support for multiple language tracks. The best utilization of the track property is to support multiple language tracks with embedded cue points. You must follow the supported formats for FLVPlaybackCaptioning cue points. If the track property is set to something other than 0, the FLVPlaybackCaptioning component searches for a text&lt;n&gt; property on the cue point, where n is the track value. For example, if track == 1, then the FLVPlayBackCaptioning component searches for the parameter text1 on the cue point. If no matching parameter is found, the text property in the cue point parameter is used."/>
<page href="fl/video/FLVPlaybackCaptioning.html#VERSION" title="FLVPlaybackCaptioning.VERSION" text="VERSION State variable indicating the long version number of the component. The version number is useful when you have a FLA file and need to know the component version. To determine the component version, type the following trace into the FLA file: trace (FLVPlaybackCaptioning.VERSION); The VERSION variable includes the major and minor version numbers as well as the revision and build numbers, for example, 2.0.0.xx. The SHORT_VERSION variable includes only the major and minor version numbers, for example, 2.0."/>
<page href="fl/video/FLVPlaybackCaptioning.html#videoPlayerIndex" title="FLVPlaybackCaptioning.videoPlayerIndex" text="videoPlayerIndex Connects the captioning to a specific VideoPlayer in the FLVPlayback component. If you want to use captioning in multiple video players (using the activeVideoPlayerIndex and visibleVideoPlayerIndex properties in the FLVPlayback component), you should create one instance of the FLVPlaybackCaptioning component for each VideoPlayer that you will be using and set this property to correspond to the index. The VideoPlayer index defaults to 0 when only one video player is used."/>
<page href="fl/video/FLVPlaybackCaptioning.html#event:captionChange" title="FLVPlaybackCaptioning.captionChange" text="captionChange Dispatched when a caption is added or removed from the caption target text field. The event is also dispatched when the following conditions are true: the captionTargetName property is not set the captionTarget property is not set the FLVPlaybackCaptioning instance creates a TextField object automatically for captioning. The captionChange event has the constant CaptionChangeEvent.CAPTION_CHANGE."/>
<page href="fl/video/FLVPlaybackCaptioning.html#event:captionTargetCreated" title="FLVPlaybackCaptioning.captionTargetCreated" text="captionTargetCreated Dispatched after the captionTarget property is created, but before any captions are added (the captionTarget property is empty). If the captionTarget property is set with a custom DisplayObject, or if the captionTargetName property is set, this event does not dispatch. Listen for this event if you are customizing the properties of the TextField object, for example, the defaultTextFormat property. The captionTargetCreated event has the constant CaptionTargetEvent.CAPTION_TARGET_CREATED."/>
<page href="fl/video/FLVPlaybackCaptioning.html#event:complete" title="FLVPlaybackCaptioning.complete" text="complete Dispatched after all of the Timed Text XML data is loaded."/>
<page href="fl/video/FLVPlaybackCaptioning.html#event:httpStatus" title="FLVPlaybackCaptioning.httpStatus" text="httpStatus Dispatched if a call to the URLLoader.load() event attempts to access a Timed Text XML file over HTTP and the current Flash Player environment is able to detect and return the status code for the request."/>
<page href="fl/video/FLVPlaybackCaptioning.html#event:ioError" title="FLVPlaybackCaptioning.ioError" text="ioError Dispatched if a call to the URLLoader.load() event results in a fatal error that terminates the download of the Timed Text XML file. If this event is not handled, it will throw an error."/>
<page href="fl/video/FLVPlaybackCaptioning.html#event:open" title="FLVPlaybackCaptioning.open" text="open Dispatched when the download operation to load the Timed Text XML file begins, following a call to the URLLoader.load() method."/>
<page href="fl/video/FLVPlaybackCaptioning.html#event:progress" title="FLVPlaybackCaptioning.progress" text="progress Dispatched when data is received as the download of the Timed Text XML file progresses."/>
<page href="fl/video/FLVPlaybackCaptioning.html#event:securityError" title="FLVPlaybackCaptioning.securityError" text="securityError Dispatched if a call to the URLLoader.load() event attempts to load a Timed Text XML file from a server outside the security sandbox. If this event is not handled, it will throw an error."/>
<page href="fl/video/VideoState.html" title="VideoState class" text="VideoState The VideoState class provides constant values for the read-only FLVPlayback.state and VideoPlayer.state properties."/>
<page href="fl/video/VideoState.html#BUFFERING" title="VideoState.BUFFERING" text="BUFFERING The video player is in the buffering state. It enters this state immediately after a call is made to the play() or load() method. Use the FLVPlayback.state property to obtain the current state of the video player. This is a responsive state."/>
<page href="fl/video/VideoState.html#CONNECTION_ERROR" title="VideoState.CONNECTION_ERROR" text="CONNECTION_ERROR The video player is in the connection error state. It enters this state when a video stream attempted to load but was unsuccessful. There are two possible reasons for the error: no connection to the server or the stream was not found. Use the FLVPlayback.state property to obtain the current state of the video player. This is an unresponsive state."/>
<page href="fl/video/VideoState.html#DISCONNECTED" title="VideoState.DISCONNECTED" text="DISCONNECTED The video player is in the disconnected state. It enters this state when the stream is closed by a call to the closeVideoPlayer() method or timed out on idle. Use the FLVPlayback.state property to obtain the current state of the video player. The FLVPlayback instance is in a disconnected state until you set the FLVPlayback.source property."/>
<page href="fl/video/VideoState.html#LOADING" title="VideoState.LOADING" text="LOADING The video player is in the loading state. It enters this state immediately after the play() or load() method is called or after the FLVPlayback.source property is set. Use the FLVPlayback.state property to obtain the current state of the video player. This is an unresponsive state."/>
<page href="fl/video/VideoState.html#PAUSED" title="VideoState.PAUSED" text="PAUSED The video player is in the paused state. It enters this state when the FLV file is loaded, but play is paused by calling the pause() or load() method. Use the FLVPlayback.state property to obtain the current state of the video player. This is a responsive state."/>
<page href="fl/video/VideoState.html#PLAYING" title="VideoState.PLAYING" text="PLAYING The video player is in the playing state. It enters this state when the FLV file is loaded and is playing. Use the FLVPlayback.state property to obtain the current state of the video player. This is a responsive state."/>
<page href="fl/video/VideoState.html#RESIZING" title="VideoState.RESIZING" text="RESIZING The video player is in the resizing state. It enters this state during autolayout. The FLVPlayback instance never has this constant's state value, only the VideoPlayer instance. Use the VideoPlayer.state property to obtain the current state of the video player. This is a unresponsive state."/>
<page href="fl/video/VideoState.html#REWINDING" title="VideoState.REWINDING" text="REWINDING The video player is in the rewinding state. It enters this state when the video rewinds automatically. The video rewinds automatically after it has stopped, either by clicking the stop button or by the video playing to the end. After rewinding is complete, the state is stopped. Use the FLVPlayback.state property to obtain the current state of the video player. This is an unresponsive state."/>
<page href="fl/video/VideoState.html#SEEKING" title="VideoState.SEEKING" text="SEEKING The video player is in the seeking state. It enters this state after the seek() method is called and also while the user is scrubbing with the seek bar. Use the FLVPlayback.state property to obtain the current state of the video player. This is an unresponsive state."/>
<page href="fl/video/VideoState.html#STOPPED" title="VideoState.STOPPED" text="STOPPED The video player is in the stopped state. It enters this state when the FLV file is loaded and play is stopped by calling the stop() method or when the playhead reaches the end of the stream. Use the FLVPlayback.state property to obtain the current state of the video player. This is a responsive state."/>
<page href="fl/video/VideoError.html" title="VideoError class" text="VideoError The VideoError exception is the primary mechanism for reporting runtime errors from the FLVPlayback and VideoPlayer classes."/>
<page href="fl/video/VideoError.html#VideoError()" title="VideoError.VideoError()" text="VideoError Creates a new VideoError object. errCode msg The code that corresponds to the error. The error message."/>
<page href="fl/video/VideoError.html#code" title="VideoError.code" text="code The code that corresponds to the error. The error code is passed into the constructor."/>
<page href="fl/video/VideoError.html#DELETE_DEFAULT_PLAYER" title="VideoError.DELETE_DEFAULT_PLAYER" text="DELETE_DEFAULT_PLAYER State variable indicating that the user cannot delete the default VideoPlayer object."/>
<page href="fl/video/VideoError.html#ILLEGAL_CUE_POINT" title="VideoError.ILLEGAL_CUE_POINT" text="ILLEGAL_CUE_POINT State variable indicating the illegal cue point."/>
<page href="fl/video/VideoError.html#INCMANAGER_CLASS_UNSET" title="VideoError.INCMANAGER_CLASS_UNSET" text="INCMANAGER_CLASS_UNSET State variable indicating that the INCManager class is not set."/>
<page href="fl/video/VideoError.html#INVALID_SEEK" title="VideoError.INVALID_SEEK" text="INVALID_SEEK State variable indicating an invalid seek."/>
<page href="fl/video/VideoError.html#INVALID_SOURCE" title="VideoError.INVALID_SOURCE" text="INVALID_SOURCE State variable indicating an invalid source."/>
<page href="fl/video/VideoError.html#INVALID_XML" title="VideoError.INVALID_XML" text="INVALID_XML State variable indicating invalid XML."/>
<page href="fl/video/VideoError.html#MISSING_SKIN_STYLE" title="VideoError.MISSING_SKIN_STYLE" text="MISSING_SKIN_STYLE State variable indicating a missing skin style."/>
<page href="fl/video/VideoError.html#NETSTREAM_CLIENT_CLASS_UNSET" title="VideoError.NETSTREAM_CLIENT_CLASS_UNSET" text="NETSTREAM_CLIENT_CLASS_UNSET An error that occurs when the VideoPlayer.netStatusClientClass static property is set to an invalid value. This includes cases where it is a string and the class cannot be found and where the class does not have a constructor that takes an instance of VideoPlayer as a parameter. A sample error message can be seen with the following code: // Place the FLVPlayback component on the Stage at 0,0 and provide the instance name myflvPlayback. import fl.video. VideoPlayer.netStreamClientClass = null; try { myflvPlayback.play('test.flv'); } catch (e:VideoError) { if (e.code =VideoError.NETSTREAM_CLIENT_CLASS_UNSET) { trace('I forced this error on purpose'); } } Player Version: Flash Player 9 Update 3."/>
<page href="fl/video/VideoError.html#NO_BITRATE_MATCH" title="VideoError.NO_BITRATE_MATCH" text="NO_BITRATE_MATCH State variable indicating that there is no bitrate match."/>
<page href="fl/video/VideoError.html#NO_CONNECTION" title="VideoError.NO_CONNECTION" text="NO_CONNECTION State variable indicating that Flash Player is unable to make a connection to the server or to find the FLV file on the server."/>
<page href="fl/video/VideoError.html#NULL_URL_LOAD" title="VideoError.NULL_URL_LOAD" text="NULL_URL_LOAD State variable indicating that a null URL was sent to the load() method."/>
<page href="fl/video/VideoError.html#SHORT_VERSION" title="VideoError.SHORT_VERSION" text="SHORT_VERSION State variable indicating the short version number of the component. The version number is useful when you have a FLA file and need to know the component version. To determine the component version, type the following code trace into the FLA file: FLVPlayback.SHORT_VERSION The SHORT_VERSION variable includes only the major and minor version numbers, for example, 2.0. The VERSION variable includes the major and minor version numbers as well as the revision and build numbers, for example, 2.0.0.11."/>
<page href="fl/video/VideoError.html#UNSUPPORTED_PROPERTY" title="VideoError.UNSUPPORTED_PROPERTY" text="UNSUPPORTED_PROPERTY State variable indicating that an unsupported property was passed to the INCManager class, or the getProperty or setProperty methods."/>
<page href="fl/video/VideoError.html#VERSION" title="VideoError.VERSION" text="VERSION State variable indicating the long version number of the component. The version number is useful when you have a FLA file and need to know the component version. To determine the component version, type the following code trace into the FLA file: FLVPlayback.VERSION The VERSION variable includes the major and minor version numbers as well as the revision and build numbers, for example, 2.0.0.11. The SHORT_VERSION variable includes only the major and minor version numbers, for example, 2.0."/>
<page href="fl/video/MetadataEvent.html" title="MetadataEvent class" text="MetadataEvent Flash® Player dispatches a MetadataEvent object when the user requests the FLV file's metadata information packet (NetStream.onMetaData) and when cue points (NetStream.onCuePoint) are encountered in the FLV file."/>
<page href="fl/video/MetadataEvent.html#MetadataEvent()" title="MetadataEvent.MetadataEvent()" text="MetadataEvent Creates an Event object that contains information about metadata events. Event objects are passed as parameters to event listeners. type bubbles cancelable info vp The type of the event. Event listeners can access this information through the inherited type property. Possible values are MetadataEvent.CUE_POINT and MetadataEvent.METADATA_RECEIVED. Determines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. Determines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. Determines the dynamic properties to add. Determines the index of the VideoPlayer object."/>
<page href="fl/video/MetadataEvent.html#CUE_POINT" title="MetadataEvent.CUE_POINT" text="CUE_POINT Defines the value of the type property of a cuePoint event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. infoThe object with properties describing the cue point. vpThe index of the VideoPlayer object."/>
<page href="fl/video/MetadataEvent.html#info" title="MetadataEvent.info" text="info An object with dynamic properties added depending on the event type."/>
<page href="fl/video/MetadataEvent.html#METADATA_RECEIVED" title="MetadataEvent.METADATA_RECEIVED" text="METADATA_RECEIVED Defines the value of the type property of a metadataReceived event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. infoThe object with properties describing the FLV file. vpThe index of the VideoPlayer object."/>
<page href="fl/video/MetadataEvent.html#vp" title="MetadataEvent.vp" text="vp The index of the VideoPlayer object involved in this event."/>
<page href="fl/video/MetadataEvent.html#event:cuePoint" title="MetadataEvent.cuePoint" text="cuePoint Defines the value of the type property of a cuePoint event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. infoThe object with properties describing the cue point. vpThe index of the VideoPlayer object."/>
<page href="fl/video/MetadataEvent.html#event:metadataReceived" title="MetadataEvent.metadataReceived" text="metadataReceived Defines the value of the type property of a metadataReceived event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. infoThe object with properties describing the FLV file. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html" title="VideoEvent class" text="VideoEvent Flash® Player dispatches a VideoEvent object when the user plays a video."/>
<page href="fl/video/VideoEvent.html#VideoEvent()" title="VideoEvent.VideoEvent()" text="VideoEvent Creates an Event object that contains information about video events. Event objects are passed as parameters to event listeners. type bubbles cancelable state playheadTime vp The type of the event. Event listeners can access this information through the inherited type property. Possible values are VideoEvent.AUTO_REWOUND, VideoEvent.BUFFERING_STATE_ENTERED, VideoEvent.CLOSE, VideoEvent.COMPLETE, VideoEvent.FAST_FORWARD, VideoEvent.PAUSED_STATE_ENTERED, VideoEvent.PLAYHEAD_UPDATE, VideoEvent.PLAYING_STATE_ENTERED, VideoEvent.READY, VideoEvent.REWIND, VideoEvent.SCRUB_FINISH, VideoEvent.SCRUB_START, VideoEvent.SEEKED, VideoEvent.SKIN_LOADED, VideoEvent.STATE_CHANGE, VideoEvent.STOPPED_STATE_ENTERED, and VideoEvent.VOLUME_UPDATE. Determines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. Determines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. A string identifying the constant from the VideoState class that describes the playback state of the component. A number that is the current playhead time or position. Determines the index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#AUTO_REWOUND" title="VideoEvent.AUTO_REWOUND" text="AUTO_REWOUND Defines the value of the type property of an autoRewound event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#BUFFERING_STATE_ENTERED" title="VideoEvent.BUFFERING_STATE_ENTERED" text="BUFFERING_STATE_ENTERED Defines the value of the type property of a bufferingStateEntered event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#CLOSE" title="VideoEvent.CLOSE" text="CLOSE Defines the value of the type property of a close event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#COMPLETE" title="VideoEvent.COMPLETE" text="COMPLETE Defines the value of the type property of a complete event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#FAST_FORWARD" title="VideoEvent.FAST_FORWARD" text="FAST_FORWARD Defines the value of the type property of a fastForward event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#PAUSED_STATE_ENTERED" title="VideoEvent.PAUSED_STATE_ENTERED" text="PAUSED_STATE_ENTERED Defines the value of the type property of a pausedStateEntered event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#PLAYHEAD_UPDATE" title="VideoEvent.PLAYHEAD_UPDATE" text="PLAYHEAD_UPDATE Defines the value of the type property of a playheadUpdate event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#playheadTime" title="VideoEvent.playheadTime" text="playheadTime A number that is the current playhead time or position, measured in seconds, which can be a fractional value. Setting this property triggers a seek and has all the restrictions of a seek. When the playhead time changes, which occurs once every .25 seconds while the FLV file plays, the component dispatches the playheadUpdate event. For several reasons, the playheadTime property might not have the expected value immediately after you call one of the seek methods or set playheadTime to cause seeking. First, for a progressive download, you can seek only to a keyframe, so a seek takes you to the time of the first keyframe after the specified time. (When streaming, a seek always goes to the precise specified time even if the source FLV file doesn't have a keyframe there.) Second, seeking is asynchronous, so if you call a seek method or set the playheadTime property, playheadTime does not update immediately. To obtain the time after the seek is complete, listen for the seek event, which does not fire until the playheadTime property has updated."/>
<page href="fl/video/VideoEvent.html#PLAYING_STATE_ENTERED" title="VideoEvent.PLAYING_STATE_ENTERED" text="PLAYING_STATE_ENTERED Defines the value of the type property of a playingStateEntered event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#READY" title="VideoEvent.READY" text="READY Defines the value of the type property of a ready event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#REWIND" title="VideoEvent.REWIND" text="REWIND Defines the value of the type property of a rewind event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#SCRUB_FINISH" title="VideoEvent.SCRUB_FINISH" text="SCRUB_FINISH Defines the value of the type property of a scrubFinish event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#SCRUB_START" title="VideoEvent.SCRUB_START" text="SCRUB_START Defines the value of the type property of a scrubStart event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#SEEKED" title="VideoEvent.SEEKED" text="SEEKED Defines the value of the type property of a seeked event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#SKIN_LOADED" title="VideoEvent.SKIN_LOADED" text="SKIN_LOADED Defines the value of the type property of a skinLoaded event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#state" title="VideoEvent.state" text="state A string identifying the constant from the VideoState class that describes the playback state of the component. This property is set by the load(), play(), stop(), pause(), and seek() methods. The possible values for the state property are: buffering, connectionError, disconnected, loading, paused, playing, rewinding, seeking, and stopped. You can use the properties of the FLVPlayback class to test for these states."/>
<page href="fl/video/VideoEvent.html#STATE_CHANGE" title="VideoEvent.STATE_CHANGE" text="STATE_CHANGE Defines the value of the type property of a stateChange event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#STOPPED_STATE_ENTERED" title="VideoEvent.STOPPED_STATE_ENTERED" text="STOPPED_STATE_ENTERED Defines the value of the type property of a stoppedStateEntered event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#vp" title="VideoEvent.vp" text="vp The index of the VideoPlayer object involved in this event."/>
<page href="fl/video/VideoEvent.html#event:autoRewound" title="VideoEvent.autoRewound" text="autoRewound Defines the value of the type property of an autoRewound event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#event:bufferingStateEntered" title="VideoEvent.bufferingStateEntered" text="bufferingStateEntered Defines the value of the type property of a bufferingStateEntered event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#event:close" title="VideoEvent.close" text="close Defines the value of the type property of a close event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#event:complete" title="VideoEvent.complete" text="complete Defines the value of the type property of a complete event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#event:fastForward" title="VideoEvent.fastForward" text="fastForward Defines the value of the type property of a fastForward event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#event:pausedStateEntered" title="VideoEvent.pausedStateEntered" text="pausedStateEntered Defines the value of the type property of a pausedStateEntered event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#event:playheadUpdate" title="VideoEvent.playheadUpdate" text="playheadUpdate Defines the value of the type property of a playheadUpdate event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#event:playingStateEntered" title="VideoEvent.playingStateEntered" text="playingStateEntered Defines the value of the type property of a playingStateEntered event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#event:ready" title="VideoEvent.ready" text="ready Defines the value of the type property of a ready event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#event:rewind" title="VideoEvent.rewind" text="rewind Defines the value of the type property of a rewind event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#event:scrubFinish" title="VideoEvent.scrubFinish" text="scrubFinish Defines the value of the type property of a scrubFinish event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#event:scrubStart" title="VideoEvent.scrubStart" text="scrubStart Defines the value of the type property of a scrubStart event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#event:seeked" title="VideoEvent.seeked" text="seeked Defines the value of the type property of a seeked event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#event:skinLoaded" title="VideoEvent.skinLoaded" text="skinLoaded Defines the value of the type property of a skinLoaded event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#event:stateChange" title="VideoEvent.stateChange" text="stateChange Defines the value of the type property of a stateChange event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoEvent.html#event:stoppedStateEntered" title="VideoEvent.stoppedStateEntered" text="stoppedStateEntered Defines the value of the type property of a stoppedStateEntered event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. stateA string identifying the constant from the VideoState class that describes the playback state of the component. playheadTimeA number that is the current playhead time or position. vpThe index of the VideoPlayer object."/>
<page href="fl/video/FLVPlayback.html" title="FLVPlayback class" text="FLVPlayback FLVPlayback extends the Sprite class and wraps a VideoPlayer object. The FLVPlayback class allows you to include a video player in your Flash application to play progressively downloaded Flash video (FLV) files over HTTP, or play streaming FLV files from Flash Media Server (FMS) or other Flash Video Streaming Service (FVSS). Unlike other ActionScript 3.0 components, the FLVPlayback component does not extend UIComponent; therefore, it does not support the methods and properties of that class. To access the properties, methods, and events of the FLVPlayback class, you must import the class to your application either by dragging the FLVPlayback component to the Stage in your Flash application, or by explicitly importing it in ActionScript using the import statement. The following statement imports the FLVPlayback class: import fl.video.FLVPlayback; The FLVPlayback class has a VERSION constant, which is a class property. Class properties are available only on the class itself. The VERSION constant returns a string that indicates the version of the component. The following code shows the version in the Output panel: import fl.video.FLVPlayback; trace(FLVPlayback.VERSION);"/>
<page href="fl/video/FLVPlayback.html#FLVPlayback()" title="FLVPlayback.FLVPlayback()" text="FLVPlayback Creates a new FLVPlayback instance. After creating the FLVPlayback instance, call the addChild() or addChildAt() method to place the instance on the Stage or another display object container."/>
<page href="fl/video/FLVPlayback.html#addASCuePoint()" title="FLVPlayback.addASCuePoint()" text="addASCuePoint Adds an ActionScript cue point and has the same effect as adding an ActionScript cue point using the Cue Points dialog box, except that it occurs when an application executes rather than during application development. Cue point information is wiped out when the source property is set. To set cue point information for the next FLV file to be loaded, set the source property first. It is valid to add multiple ActionScript cue points with the same name and time. When you remove ActionScript cue points with the removeASCuePoint() method, all cue points with the same name and time are removed. timeOrCuePoint name parameters An object having name and time properties, which describe the cue point. It also might have a parameters property that holds name/value pairs. It may have the type property set to &quot;actionscript&quot;. If the type is missing or set to something else, it is set automatically. If the object does not conform to these conventions, the method throws a VideoError error. The time property sets the time in seconds for a new cue point to be added and the name parameter must follow. A string that specifies the name of the cue point if you submit a time parameter instead of the cue point. Optional parameters for the cue point if the timeOrCuePoint parameter is a number. Parameters are invalid."/>
<page href="fl/video/FLVPlayback.html#bringVideoPlayerToFront()" title="FLVPlayback.bringVideoPlayerToFront()" text="bringVideoPlayerToFront Brings a video player to the front of the stack of video players. Useful for custom transitions between video players. The default stack order is the same as it is for the activeVideoPlayerIndex property: 0 is on the bottom, 1 is above it, 2 is above 1, and so on. However, when you call the bringVideoPlayerToFront() method this order may change. For example, 2 may be the bottom. index A number that is the index of the video player to move to the front."/>
<page href="fl/video/FLVPlayback.html#closeVideoPlayer()" title="FLVPlayback.closeVideoPlayer()" text="closeVideoPlayer Closes NetStream and deletes the video player specified by the index parameter. If the closed video player is the active or visible video player, the FLVPlayback instance sets the active and or visible video player to the default player (with index 0). You cannot close the default player, and trying to do so causes the component to throw an error. index A number that is the index of the video player to close."/>
<page href="fl/video/FLVPlayback.html#enterFullScreenDisplayState()" title="FLVPlayback.enterFullScreenDisplayState()" text="enterFullScreenDisplayState Sets the FLVPlayback video player to full screen. Calling this method has the same effect as clicking the full screen toggle button that's built into some FLVPlayback skins and is also available as the FullScreenButton in the Video section of the Components panel. This method supports hardware acceleration in Flash Player for full screen video. If the user's version of Flash Player does not support hardware acceleration, this method still works and full screen video will work the same as it does without hardware acceleration support. Because a call to this method sets the displayState property of the Stage class to StageDisplayState.FULL_SCREEN, it has the same restrictions as the displayState property. If, instead of calling this method, you implement full screen mode by directly setting the stage.displayState property to StageDisplayState.FULL_SCREEN, hardware acceleration is not used. Full screen support occurs only if the fullScreenTakeOver property is set to true, which it is by default. Player Version: Flash Player 9 Update 3. The following example calls the enterFullScreenDisplayState() method from an event handler that is triggered by the user clicking a standard Flash button (myButton). Note: Test this example in the browser. In the Flash Publish Settings dialog, on the HTML tab, select the template Flash Only - Allow Full Screen. Specify a Flash Player version of Update 3, and make sure the Flash and HTML formats are selected on the Formats tab. Then publish and open the resulting HTML file in the browser. // Requires Button and FLVPlayback components in library. import fl.video.FLVPlayback; import fl.controls.Button; var myButton:Button = new Button(); var myFLVPlybk:FLVPlayback = new FLVPlayback(); myButton.move(100, 240); myButton.label = &quot;Full Screen&quot;; addChild(myButton); addChild(myFLVPlybk); myFLVPlybk.source = &quot;http://helpexamples.com/flash/video/water.flv&quot;; myButton.addEventListener(MouseEvent.CLICK, handleClick); function handleClick(e:MouseEvent):void { myFLVPlybk.enterFullScreenDisplayState(); }"/>
<page href="fl/video/FLVPlayback.html#findCuePoint()" title="FLVPlayback.findCuePoint()" text="findCuePoint Finds the cue point of the type specified by the type parameter and having the time, name, or combination of time and name that you specify through the parameters. If you do not provide a value for either the time or name of the cue point, or if the time is null, undefined, or less than zero and the name is null or undefined, the method throws VideoError error 1002. The method includes disabled cue points in the search. Use the isFLVCuePointEnabled() method to determine whether a cue point is disabled. timeNameOrCuePoint type This can be a number specifying a time, a string specifying a name, or an object with time and/or name properties. If this parameter is a string, the method searches for the first cue point with this name and returns null if there is no match. If this parameter is a number, the method searches for and returns the first cue point with this time. If there are multiple cue points with the same time, which is possible only with ActionScript cue points, the cue point with the first name alphabetically is returned. Returns null if there is no match. The first three decimal places for the time are used. More than three decimal places are rounded. If this parameter is an object, the method searches for the cue point object that contains the specified time and/or name properties. If only time or name is specified, then the behavior is the same as calling with a number or a string. If both the time and name properties are defined and a cue point object exists with both of them, then the cue point object is returned; otherwise, null is returned. If time is null, NaN or less than 0 and name is null or undefined, a VideoError object is thrown. A string that specifies the type of cue point for which to search. The possible values for this parameter are &quot;actionscript&quot;, &quot;all&quot;, &quot;event&quot;, &quot;flv&quot;, or &quot;navigation&quot;. You can specify these values using the following class properties: CuePointType.ACTIONSCRIPT, CuePointType.ALL, CuePointType.EVENT, CuePointType.FLV, and CuePointType.NAVIGATION. If this parameter is not specified, the default is &quot;all&quot;, which means the method searches all cue point types. Optional. If the time property is null, undefined or less than 0 and the name property is null or undefined."/>
<page href="fl/video/FLVPlayback.html#findNearestCuePoint()" title="FLVPlayback.findNearestCuePoint()" text="findNearestCuePoint Finds a cue point of the specified type that matches or is earlier than the time that you specify. If you specify both a time and a name and no earlier cue point matches that name, it finds a cue point that matches the name that you specify. Otherwise, it returns null. Default is to search all cue points. The method includes disabled cue points in the search. Use the isFLVCuePointEnabled() method to determine whether a cue point is disabled. timeNameOrCuePoint type This can be a number specifying a time, a string specifying a name, or an object with time and/or name properties. If this parameter is a string, the method searches for the first cue point with this name and returns null if there is no match. If this parameter is a number then the closest cue point to this time that is an exact match or earlier will be returned. If there is no cue point at or earlier than that time, then the first cue point is returned. If there are multiple cue points with the same time, which is possible only with ActionScript cue points, the cue point with the first name alphabetically is returned. Returns null if there is no match. The first three decimal places for the time are used. More than three decimal places are rounded. If this parameter is an object, the method searches for the cue point object that contains the specified time and/or name properties. If only time or name is specified, then the behavior is the same as calling with a number or a string. If both the time and name properties are defined and a cue point object exists with both of them, then the cue point object is returned. Otherwise the nearest cue point with an earlier time and the same name is returned. If no cue point earlier than that time with that name is found null is returned. If time is null, undefined or less than 0 and name is null or undefined, a VideoError object is thrown. A string that specifies the type of cue point for which to search. The possible values for this parameter are &quot;actionscript&quot;, &quot;all&quot;, &quot;event&quot;, &quot;flv&quot;, or &quot;navigation&quot;. You can specify these values using the following class properties: CuePointType.ACTIONSCRIPT, CuePointType.ALL, CuePointType.EVENT, CuePointType.FLV, and CuePointType.NAVIGATION. If this parameter is not specified, the default is &quot;all&quot;, which means the method searches all cue point types. Optional. If the time is null, undefined, or less than 0 and the name is null or undefined."/>
<page href="fl/video/FLVPlayback.html#findNextCuePointWithName()" title="FLVPlayback.findNextCuePointWithName()" text="findNextCuePointWithName Finds the next cue point in my_cuePoint.array that has the same name as my_cuePoint.name. The my_cuePoint object must be a cue point object that has been returned by the findCuePoint() method, the findNearestCuePoint() method, or a previous call to this method. This method uses the array parameter that these methods add to the CuePoint object. The method includes disabled cue points in the search. Use the isFLVCuePointEnabled() method to determine whether a cue point is disabled. cuePoint A cue point object that has been returned by either the findCuePoint() method, the findNearestCuePoint() method, or a previous call to this method. When argument is invalid."/>
<page href="fl/video/FLVPlayback.html#getVideoPlayer()" title="FLVPlayback.getVideoPlayer()" text="getVideoPlayer Gets the video player specified by the index parameter. When possible, it is best to access the VideoPlayer methods and properties using FLVPlayback methods and properties. Each DisplayObject.name property is its index converted to a string. index A number that is the index of the video player to get."/>
<page href="fl/video/FLVPlayback.html#isFLVCuePointEnabled()" title="FLVPlayback.isFLVCuePointEnabled()" text="isFLVCuePointEnabled Returns false if the FLV file embedded cue point is disabled. You can disable cue points either by setting the cuePoints property through the Flash Video Cue Points dialog box or by calling the setFLVCuePointEnabled() method. The return value from this function is meaningful only when the metadataLoaded property is true, the metadata property is not null, or after a metadataReceived event. When metadataLoaded is false, this function always returns true. timeNameOrCuePoint If this parameter is a string, returns the name of the cue point to check; returns false only if all cue points with this name are disabled. If this parameter is a number, it is the time of the cue point to check. If this parameter is an object, returns the object with the matching name and time properties."/>
<page href="fl/video/FLVPlayback.html#load()" title="FLVPlayback.load()" text="load Begins loading the FLV file and provides a shortcut for setting the autoPlay property to false and setting the source, totalTime, and isLive properties, if given. If the totalTime and isLive properties are undefined, they are not set. If the source property is undefined, null, or an empty string, this method does nothing. source totalTime isLive A string that specifies the URL of the FLV file to stream and how to stream it. The URL can be a local path, an HTTP URL to an FLV file, an RTMP URL to an FLV file stream, or an HTTP URL to an XML file. A number that is the total playing time for the video. Optional. A Boolean value that is true if the video stream is live. This value is effective only when streaming from Flash Media Server (FMS) or other Flash Video Streaming Service (FVSS). The value of this property is ignored for an HTTP download. Optional."/>
<page href="fl/video/FLVPlayback.html#pause()" title="FLVPlayback.pause()" text="pause Pauses playing the video stream. If playback has begun and you want to return to the state of waiting for enough to download and then automatically begin playback, call the pause() method, and then the playWhenEnoughDownloaded() method."/>
<page href="fl/video/FLVPlayback.html#play()" title="FLVPlayback.play()" text="play Plays the video stream. With no parameters, the method simply takes the FLV file from a paused or stopped state to the playing state. If parameters are used, the method acts as a shortcut for setting the autoPlay property to true and setting the isLive, totalTime and, source properties. If the totalTime and isLive properties are undefined, they are not set. When waiting for enough of a progressive download FLV to load before playing starts automatically, call the play() method with no parameters to force playback to start immediately. source totalTime isLive A string that specifies the URL of the FLV file to stream and how to stream it. The URL can be a local path, an HTTP URL to an FLV file, an RTMP URL to an FLV file stream, or an HTTP URL to an XML file. It is optional, but the source property must be set either through the Component inspector or through ActionScript or this method has no effect. A number that is the total playing time for the video. Optional. A Boolean value that is true if the video stream is live. This value is effective only when streaming from Flash Media Server (FMS) or other Flash Video Streaming Service (FVSS). The value of this property is ignored for an HTTP download. Optional."/>
<page href="fl/video/FLVPlayback.html#playWhenEnoughDownloaded()" title="FLVPlayback.playWhenEnoughDownloaded()" text="playWhenEnoughDownloaded Plays the FLV file when enough of it has downloaded. If the FLV file has downloaded or you are streaming from Flash Media Server (FMS), then calling the playWhenEnoughDownloaded() method is identical to the play() method with no parameters. Calling this method does not pause playback, so in many cases, you may want to call the pause() method before you call this method."/>
<page href="fl/video/FLVPlayback.html#removeASCuePoint()" title="FLVPlayback.removeASCuePoint()" text="removeASCuePoint Removes an ActionScript cue point from the currently loaded FLV file. Only the name and time properties are used from the timeNameOrCuePoint parameter to find the cue point to remove. If multiple ActionScript cue points match the search criteria, only one is removed. To remove all, call this function repeatedly in a loop with the same parameters until it returns null. Cue point information is wiped out when the source property is set, so to set cue point information for the next FLV file to be loaded, set the source property first. timeNameOrCuePoint A cue point string that contains the time and name properties for the cue point to remove. The method removes the first cue point with this name. Or, if this parameter is a number, the method removes the first cue point with this time. If this parameter is an object, the method removes the cue point with both the time and name properties."/>
<page href="fl/video/FLVPlayback.html#seek()" title="FLVPlayback.seek()" text="seek Seeks to a given time in the file, specified in seconds, with a precision of three decimal places (milliseconds). For several reasons, the playheadTime property might not have the expected value immediately after you call one of the seek methods or set playheadTime to cause seeking. First, for a progressive download, you can seek only to a keyframe, so a seek takes you to the time of the first keyframe after the specified time. (When streaming, a seek always goes to the precise specified time even if the source FLV file doesn't have a keyframe there.) Second, seeking is asynchronous, so if you call a seek method or set the playheadTime property, playheadTime does not update immediately. To obtain the time after the seek is complete, listen for the seek event, which does not start until the playheadTime property has updated. time A number that specifies the time, in seconds, at which to place the playhead. If time is &lt; 0."/>
<page href="fl/video/FLVPlayback.html#seekPercent()" title="FLVPlayback.seekPercent()" text="seekPercent Seeks to a percentage of the file and places the playhead there. The percentage is a number between 0 and 100. For several reasons, the playheadTime property might not have the expected value immediately after you call one of the seek methods or set playheadTime to cause seeking. First, for a progressive download, you can seek only to a keyframe, so a seek takes you to the time of the first keyframe after the specified time. (When streaming, a seek always goes to the precise specified time even if the source FLV file doesn't have a keyframe there.) Second, seeking is asynchronous, so if you call a seek method or set the playheadTime property, playheadTime does not update immediately. To obtain the time after the seek is complete, listen for the seek event, which does not start until the playheadTime property has updated. percent number that specifies a percentage of the length of the FLV file at which to place the playhead. If percent is invalid or if totalTime is undefined, null or &lt;= 0."/>
<page href="fl/video/FLVPlayback.html#seekSeconds()" title="FLVPlayback.seekSeconds()" text="seekSeconds Seeks to a given time in the file, specified in seconds, with a precision up to three decimal places (milliseconds). This method performs the same operation as the seek() method; it is provided for symmetry with the seekPercent() method. For several reasons, the playheadTime property might not have the expected value immediately after you call one of the seek methods or set playheadTime to cause seeking. First, for a progressive download, you can seek only to a keyframe, so a seek takes you to the time of the first keyframe after the specified time. (When streaming, a seek always goes to the precise specified time even if the source FLV file doesn't have a keyframe there.) Second, seeking is asynchronous, so if you call a seek method or set the playheadTime property, playheadTime does not update immediately. To obtain the time after the seek is complete, listen for the seek event, which does not start until the playheadTime property has updated. time A number that specifies the time, in seconds, of the total play time at which to place the playhead."/>
<page href="fl/video/FLVPlayback.html#seekToNavCuePoint()" title="FLVPlayback.seekToNavCuePoint()" text="seekToNavCuePoint Seeks to a navigation cue point that matches the specified time, name, or time and name. The time is the starting time, in seconds, from which to look for the next navigation cue point. The default is the current playheadTime property. If you specify a time, the method seeks to a cue point that matches that time or is later. If time is undefined, null, or less than 0, the method starts its search at time 0. The name is the cue point to seek. The method seeks to the first enabled navigation cue point with this name. The time and name together are a navigation cue point with the specified name at or after the specified time. For several reasons, the playheadTime property might not have the expected value immediately after you call one of the seek methods or set playheadTime to cause seeking. First, for a progressive download, you can seek only to a keyframe, so a seek takes you to the time of the first keyframe after the specified time. (When streaming, a seek always goes to the precise specified time even if the source FLV file doesn't have a keyframe there.) Second, seeking is asynchronous, so if you call a seek method or set the playheadTime property, playheadTime does not update immediately. To obtain the time after the seek is complete, listen for the seek event, which does not start until the playheadTime property has updated. timeNameOrCuePoint A number that is the time, a string that is the name, or both a number and string that are the specified name and time. No cue point matching the criteria is found."/>
<page href="fl/video/FLVPlayback.html#seekToNextNavCuePoint()" title="FLVPlayback.seekToNextNavCuePoint()" text="seekToNextNavCuePoint Seeks to the next navigation cue point, based on the current value of the playheadTime property. The method skips navigation cue points that have been disabled and goes to the end of the FLV file if there is no other cue point. For several reasons, the playheadTime property might not have the expected value immediately after you call one of the seek methods or set playheadTime to cause seeking. First, for a progressive download, you can seek only to a keyframe, so a seek takes you to the time of the first keyframe after the specified time. (When streaming, a seek always goes to the precise specified time even if the source FLV file doesn't have a keyframe there.) Second, seeking is asynchronous, so if you call a seek method or set the playheadTime property, playheadTime does not update immediately. To obtain the time after the seek is complete, listen for the seek event, which does not start until the playheadTime property has updated. time A number that is the starting time, in seconds, from which to look for the next navigation cue point. The default is the current playheadTime property. Optional."/>
<page href="fl/video/FLVPlayback.html#seekToPrevNavCuePoint()" title="FLVPlayback.seekToPrevNavCuePoint()" text="seekToPrevNavCuePoint Seeks to the previous navigation cue point, based on the current value of the playheadTime property. It goes to the beginning if there is no previous cue point. The method skips navigation cue points that have been disabled. For several reasons, the playheadTime property might not have the expected value immediately after you call one of the seek methods or set playheadTime to cause seeking. First, for a progressive download, you can seek only to a keyframe, so a seek takes you to the time of the first keyframe after the specified time. (When streaming, a seek always goes to the precise specified time even if the source FLV file doesn't have a keyframe there.) Second, seeking is asynchronous, so if you call a seek method or set the playheadTime property, playheadTime does not update immediately. To obtain the time after the seek is complete, listen for the seek event, which does not start until the playheadTime property has updated. time A number that is the starting time in seconds from which to look for the previous navigation cue point. The default is the current value of the playheadTime property. Optional."/>
<page href="fl/video/FLVPlayback.html#setFLVCuePointEnabled()" title="FLVPlayback.setFLVCuePointEnabled()" text="setFLVCuePointEnabled Enables or disables one or more FLV file cue points. Disabled cue points are disabled for purposes of being dispatched as events and for navigating to them with the seekToPrevNavCuePoint(), seekToNextNavCuePoint(), and seekToNavCuePoint() methods. Cue point information is deleted when you set the source property to a different FLV file, so set the source property before setting cue point information for the next FLV file to be loaded. Changes caused by this method are not reflected by calls to the isFLVCuePointEnabled() method until metadata is loaded. enabled timeNameOrCuePoint A Boolean value that specifies whether to enable (true) or disable (false) an FLV file cue point. If this parameter is a string, the method enables or disables the cue point with this name. If this parameter is a number, the method enables or disables the cue point with this time. If this parameter is an object, the method enables or disables the cue point with both the name and time properties."/>
<page href="fl/video/FLVPlayback.html#setScale()" title="FLVPlayback.setScale()" text="setScale Sets the scaleX and scaleY properties simultaneously. Because setting either one, individually, can cause automatic resizing, setting them simultaneously can be more efficient than setting the scaleX and scaleY properties individually. If scaleMode property is set to VideoScaleMode.MAINTAIN_ASPECT_RATIO or VideoScaleMode.NO_SCALE, then calling this causes an immediate autolayout event. scaleX scaleY A number representing the horizontal scale. A number representing the vertical scale."/>
<page href="fl/video/FLVPlayback.html#setSize()" title="FLVPlayback.setSize()" text="setSize Sets width and height simultaneously. Because setting either one, individually, can cause automatic resizing, setting them simultaneously is more efficient than setting the width and height properties individually. If scaleMode property is set to VideoScaleMode.MAINTAIN_ASPECT_RATIO or VideoScaleMode.NO_SCALE, then calling this causes an immediate autolayout event. width height A number that specifies the width of the video player. A number that specifies the height of the video player."/>
<page href="fl/video/FLVPlayback.html#stop()" title="FLVPlayback.stop()" text="stop Stops the video from playing. If the autoRewind property is true, the FLV file rewinds to the beginning."/>
<page href="fl/video/FLVPlayback.html#activeVideoPlayerIndex" title="FLVPlayback.activeVideoPlayerIndex" text="activeVideoPlayerIndex A number that specifies which video player instance is affected by other application programming interfaces (APIs). Use this property to manage multiple FLV file streams. This property does not make the video player visible; use the visibleVideoPlayerIndex property to do that. A new video player is created the first time activeVideoPlayerIndex is set to a number. When the new video player is created, its properties are set to the value of the default video player (activeVideoPlayerIndex == 0) except for source, totalTime, and isLive, which are always set to the default values (empty string, NaN, and false, respectively), and autoPlay, which is always false (the default is true only for the default video player, 0). The cuePoints property has no effect, as it would have no effect on a subsequent load into the default video player. APIs that control volume, positioning, dimensions, visibility, and UI controls are always global, and their behavior is not affected by setting activeVideoPlayerIndex. Specifically, setting the activeVideoPlayerIndex property does not affect the following properties and methods: Properties and Methods Not Affected by activeVideoPlayerIndex backButtonplayPauseButtonskinwidth bufferingBarscaleXstopButtonx bufferingBarHidesAndDisablesOtherstransformysetSize() forwardButtonscaleYvisiblesetScale() heightseekBarvolumefullScreenBackgroundColor muteButtonseekBarIntervalvolumeBarfullScreenButton pauseButtonseekBarScrubTolerancevolumeBarIntervalfullScreenSkinDelay playButtonseekToPrevOffsetvolumeBarScrubTolerancefullScreenTakeOver registrationXregistrationYregistrationWidthregistrationHeight skinBackgroundAlphaskinBackgroundColorskinFadeTime Note: The visibleVideoPlayerIndex property, not the activeVideoPlayerIndex property, determines which video player the skin controls. Additionaly, APIs that control dimensions do interact with the visibleVideoPlayerIndex property. The remaining APIs target a specific video player based on the setting of activeVideoPlayerIndex. To load a second FLV file in the background, set activeVideoPlayerIndex to 1 and call the load() method. When you are ready to show this FLV file and hide the first one, set visibleVideoPlayerIndex to 1."/>
<page href="fl/video/FLVPlayback.html#align" title="FLVPlayback.align" text="align Specifies the video layout when the scaleMode property is set to VideoScaleMode.MAINTAIN_ASPECT_RATIO or VideoScaleMode.NO_SCALE. The video dimensions are based on the registrationX, registrationY, registrationWidth, and registrationHeight properties. When you set the align property, values come from the VideoAlign class. The default is VideoAlign.CENTER."/>
<page href="fl/video/FLVPlayback.html#autoPlay" title="FLVPlayback.autoPlay" text="autoPlay A Boolean value that, if set to true, causes the FLV file to start playing automatically after the source property is set. If it is set to false, the FLV file loads but does not start playing until the play() or playWhenEnoughDownloaded() method is called. Playback starts immediately when you are streaming an FLV file from Flash Media Server (FMS) and the autoPlay property is set to true. However, when loading an FLV file by progressive download, playback starts only when enough of the FLV file has download so that the FLV file can play from start to finish. To force playback before enough of the FLV file has downloaded, call the play() method with no parameters. If playback has begun and you want to return to the state of waiting for enough to download and then automatically begin playback, call the pause() method, and then the playWhenEnoughDownloaded() method. If you set the property to true between the loading of new FLV files, it has no effect until the source property is set. Setting the autoPlay property to true and then setting the source property to a URL has the same effect as calling the play() method with that URL. Calling the load() method with a URL has the same effect as setting the source property to that URL with the autoPlay property set to false."/>
<page href="fl/video/FLVPlayback.html#autoRewind" title="FLVPlayback.autoRewind" text="autoRewind A Boolean value that, if true, causes the FLV file to rewind to Frame 1 when play stops, either because the player reached the end of the stream or the stop() method was called. This property is meaningless for live streams."/>
<page href="fl/video/FLVPlayback.html#backButton" title="FLVPlayback.backButton" text="backButton BackButton playback control. Clicking calls the seekToPrevNavCuePoint() method."/>
<page href="fl/video/FLVPlayback.html#bitrate" title="FLVPlayback.bitrate" text="bitrate A number that specifies the bits per second at which to transfer the FLV file. When streaming from a Flash Video Streaming service that supports native bandwidth detection, you can provide a SMIL file that describes how to switch between multiple streams based on the bandwidth. Depending on your FVSS, bandwidth may automatically be detected, and if this value is set, it is ignored. When doing HTTP progressive download, you can use the same SMIL format, but you must set the bitrate as there is no automatic detection."/>
<page href="fl/video/FLVPlayback.html#buffering" title="FLVPlayback.buffering" text="buffering A Boolean value that is true if the video is in a buffering state."/>
<page href="fl/video/FLVPlayback.html#bufferingBar" title="FLVPlayback.bufferingBar" text="bufferingBar Buffering bar control. This control is displayed when the FLV file is in a loading or buffering state."/>
<page href="fl/video/FLVPlayback.html#bufferingBarHidesAndDisablesOthers" title="FLVPlayback.bufferingBarHidesAndDisablesOthers" text="bufferingBarHidesAndDisablesOthers If set to true, hides the SeekBar control and disables the Play, Pause, PlayPause, BackButton and ForwardButton controls while the FLV file is in the buffering state. This can be useful to prevent a user from using these controls to try to speed up playing the FLV file when it is downloading or streaming over a slow connection."/>
<page href="fl/video/FLVPlayback.html#bufferTime" title="FLVPlayback.bufferTime" text="bufferTime A number that specifies the number of seconds to buffer in memory before beginning to play a video stream. For FLV files streaming over RTMP, which are not downloaded and buffer only in memory, it can be important to increase this setting from the default value of 0.1. For a progressively downloaded FLV file over HTTP, there is little benefit to increasing this value although it could improve viewing a high-quality video on an older, slower computer. For prerecorded (not live) video, do not set the bufferTime property to 0: use the default buffer time or increase the buffer time. This property does not specify the amount of the FLV file to download before starting playback."/>
<page href="fl/video/FLVPlayback.html#bytesLoaded" title="FLVPlayback.bytesLoaded" text="bytesLoaded A number that indicates the extent of downloading, in number of bytes, for an HTTP download. Returns 0 when there is no stream, when the stream is from Flash Media Server (FMS), or if the information is not yet available. The returned value is useful only for an HTTP download."/>
<page href="fl/video/FLVPlayback.html#bytesTotal" title="FLVPlayback.bytesTotal" text="bytesTotal A number that specifies the total number of bytes downloaded for an HTTP download. Returns 0 when there is no stream, when the stream is from Flash Media Server (FMS), or if the information is not yet available. The returned value is useful only for an HTTP download."/>
<page href="fl/video/FLVPlayback.html#cuePoints" title="FLVPlayback.cuePoints" text="cuePoints An array that describes ActionScript cue points and disabled embedded FLV file cue points. This property is created specifically for use by the Component inspector and Property inspector. It does not work if it is set any other way. Its value has an effect only on the first FLV file loaded and only if it is loaded by setting the source property in the Component inspector or the Property inspector. Note: This property is not accessible in ActionScript. To access cue point information in ActionScript, use the metadata property. To add, remove, enable or disable cue points with ActionScript, use the addASCuePoint(), removeASCuePoint(), or setFLVCuePointEnabled() methods."/>
<page href="fl/video/FLVPlayback.html#forwardButton" title="FLVPlayback.forwardButton" text="forwardButton Forward button control. Clicking calls the seekToNextNavCuePoint() method."/>
<page href="fl/video/FLVPlayback.html#fullScreenBackgroundColor" title="FLVPlayback.fullScreenBackgroundColor" text="fullScreenBackgroundColor Background color used when in full-screen takeover mode. This color is visible if the video does not cover the entire screen based on the scaleMode property value."/>
<page href="fl/video/FLVPlayback.html#fullScreenButton" title="FLVPlayback.fullScreenButton" text="fullScreenButton FullScreen button control."/>
<page href="fl/video/FLVPlayback.html#fullScreenSkinDelay" title="FLVPlayback.fullScreenSkinDelay" text="fullScreenSkinDelay Specifies the delay time in milliseconds to hide the skin. When in full-screen takeover mode, if the skinAutoHide property is true, autohiding is triggered when the user doesn't move the mouse for more than the seconds indicated by the fullScreenSkinDelay property. If the mouse is over the skin itself, autohiding is not triggered."/>
<page href="fl/video/FLVPlayback.html#fullScreenTakeOver" title="FLVPlayback.fullScreenTakeOver" text="fullScreenTakeOver When the stage enters full-screen mode, the FLVPlayback component is on top of all content and takes over the entire screen. When the stage exits full-screen mode, the screen returns to how it was before. The recommended settings for full-screen takeover mode are scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO and align = VideoAlign.CENTER. If the SWF file with the FLVPlayback component is loaded and does not have access to the stage because of security restrictions, full-screen takeover mode does not function. No errors are thrown."/>
<page href="fl/video/FLVPlayback.html#height" title="FLVPlayback.height" text="height A number that specifies the height of the FLVPlayback instance. This property affects only the height of the FLVPlayback instance and does not include the height of a skin SWF file that might be loaded. Setting the height property also sets the registrationHeight property to the same value."/>
<page href="fl/video/FLVPlayback.html#idleTimeout" title="FLVPlayback.idleTimeout" text="idleTimeout The amount of time, in milliseconds, before Flash terminates an idle connection to Flash Media Server (FMS) because playing paused or stopped. This property has no effect on an FLV file downloading over HTTP. If this property is set when a video stream is already idle, it restarts the timeout period with the new value."/>
<page href="fl/video/FLVPlayback.html#isLive" title="FLVPlayback.isLive" text="isLive A Boolean value that is true if the video stream is live. This property is effective only when streaming from Flash Media Server (FMS) or other Flash Video Streaming Service (FVSS). The value of this property is ignored for an HTTP download. If you set this property between loading new FLV files, it has no effect until the source property is set for the new FLV file. Set the isLive property to false when sending a prerecorded video stream to the video player and to true when sending real-time data such as a live broadcast. For better performance when you set the isLive property to false, do not set the bufferTime property to 0."/>
<page href="fl/video/FLVPlayback.html#isRTMP" title="FLVPlayback.isRTMP" text="isRTMP A Boolean value that is true if the FLV file is streaming from Flash Media Server (FMS) using RTMP. Its value is false for any other FLV file source."/>
<page href="fl/video/FLVPlayback.html#metadata" title="FLVPlayback.metadata" text="metadata An object that is a metadata information packet that is received from a call to the NetSteam.onMetaData() callback method, if available. Ready when the metadataReceived event is dispatched. If the FLV file is encoded with the Flash 8 encoder, the metadata property contains the following information. Older FLV files contain only the height, width, and duration values. ParameterDescription canSeekToEndA Boolean value that is true if the FLV file is encoded with a keyframe on the last frame that allows seeking to the end of a progressive download movie clip. It is false if the FLV file is not encoded with a keyframe on the last frame. cuePointsAn array of objects, one for each cue point embedded in the FLV file. Value is undefined if the FLV file does not contain any cue points. Each object has the following properties: type—A string that specifies the type of cue point as either &quot;navigation&quot; or &quot;event&quot;. name—A string that is the name of the cue point. time—A number that is the time of the cue point in seconds with a precision of three decimal places (milliseconds). parameters—An optional object that has name-value pairs that are designated by the user when creating the cue points. audiocodecidA number that indicates the audio codec (code/decode technique) that was used. audiodelayA number that represents time 0 in the source file from which the FLV file was encoded. Video content is delayed for the short period of time that is required to synchronize the audio. For example, if the audiodelay value is .038, the video that started at time 0 in the source file starts at time .038 in the FLV file. Note that the FLVPlayback and VideoPlayer classes compensate for this delay in their time settings. This means that you can continue to use the time settings that you used in your the source file. audiodatarateA number that is the kilobytes per second of audio. videocodecidA number that is the codec version that was used to encode the video. framerateA number that is the frame rate of the FLV file. videodatarateA number that is the video data rate of the FLV file. heightA number that is the height of the FLV file. widthA number that is the width of the FLV file. durationA number that specifies the duration of the FLV file in seconds."/>
<page href="fl/video/FLVPlayback.html#metadataLoaded" title="FLVPlayback.metadataLoaded" text="metadataLoaded A Boolean value that is true if a metadata packet has been encountered and processed or if the FLV file was encoded without the metadata packet. In other words, the value is true if the metadata is received, or if you are never going to get any metadata. So, you know whether you have the metadata; and if you don't have the metadata, you know not to wait around for it. If you just want to know whether or not you have metadata, you can check the value with: FLVPlayback.metadata != null Use this property to check whether you can retrieve useful information with the methods for finding and enabling or disabling cue points (findCuePoint, findNearestCuePoint, findNextCuePointWithName, isFLVCuePointEnabled)."/>
<page href="fl/video/FLVPlayback.html#muteButton" title="FLVPlayback.muteButton" text="muteButton Mute button control."/>
<page href="fl/video/FLVPlayback.html#ncMgr" title="FLVPlayback.ncMgr" text="ncMgr An INCManager object that provides access to an instance of the class implementing INCManager, which is an interface to the NCManager class. You can use this property to implement a custom INCManager that requires custom initialization."/>
<page href="fl/video/FLVPlayback.html#pauseButton" title="FLVPlayback.pauseButton" text="pauseButton Pause button control."/>
<page href="fl/video/FLVPlayback.html#paused" title="FLVPlayback.paused" text="paused A Boolean value that is true if the FLV file is in a paused state."/>
<page href="fl/video/FLVPlayback.html#playButton" title="FLVPlayback.playButton" text="playButton Play button control."/>
<page href="fl/video/FLVPlayback.html#playheadPercentage" title="FLVPlayback.playheadPercentage" text="playheadPercentage A number that specifies the current playheadTime as a percentage of the totalTime property. If you access this property, it contains the percentage of playing time that has elapsed. If you set this property, it causes a seek operation to the point representing that percentage of the FLV file's playing time. The value of this property is relative to the value of the totalTime property. If you specify a percentage that is invalid or if the totalTime property is undefined, null, or less than or equal to zero."/>
<page href="fl/video/FLVPlayback.html#playheadTime" title="FLVPlayback.playheadTime" text="playheadTime A number that is the current playhead time or position, measured in seconds, which can be a fractional value. Setting this property triggers a seek and has all the restrictions of a seek. When the playhead time changes, which occurs once every .25 seconds while the FLV file plays, the component dispatches the playheadUpdate event. For several reasons, the playheadTime property might not have the expected value immediately after you call one of the seek methods or set playheadTime to cause seeking. First, for a progressive download, you can seek only to a keyframe, so a seek takes you to the time of the first keyframe after the specified time. (When streaming, a seek always goes to the precise specified time even if the source FLV file doesn't have a keyframe there.) Second, seeking is asynchronous, so if you call a seek method or set the playheadTime property, playheadTime does not update immediately. To obtain the time after the seek is complete, listen for the seek event, which does not fire until the playheadTime property has updated."/>
<page href="fl/video/FLVPlayback.html#playheadUpdateInterval" title="FLVPlayback.playheadUpdateInterval" text="playheadUpdateInterval A number that is the amount of time, in milliseconds, between each playheadUpdate event. Setting this property while the FLV file is playing restarts the timer. Because ActionScript cue points start on playhead updates, lowering the value of the playheadUpdateInterval property can increase the accuracy of ActionScript cue points. Because the playhead update interval is set by a call to the global setInterval() method, the update cannot fire more frequently than the SWF file frame rate, as with any interval that is set this way. So, as an example, for the default frame rate of 12 frames per second, the lowest effective interval that you can create is approximately 83 milliseconds, or one second (1000 milliseconds) divided by 12."/>
<page href="fl/video/FLVPlayback.html#playing" title="FLVPlayback.playing" text="playing A Boolean value that is true if the FLV file is in the playing state."/>
<page href="fl/video/FLVPlayback.html#playPauseButton" title="FLVPlayback.playPauseButton" text="playPauseButton Play/pause button control."/>
<page href="fl/video/FLVPlayback.html#preferredHeight" title="FLVPlayback.preferredHeight" text="preferredHeight A number that specifies the height of the source FLV file. This information is not valid immediately upon calling the play() or load() methods. It is valid when the ready event starts. If the value of the scaleMode property is VideoScaleMode.MAINTAIN_ASPECT_RATIO or VideoScaleMode.NO_SCALE, it is best to read the value after the layout event is dispatched. This property returns -1 if no information is available yet."/>
<page href="fl/video/FLVPlayback.html#preferredWidth" title="FLVPlayback.preferredWidth" text="preferredWidth Gives the width of the source FLV file. This information is not valid immediately when the play() or load() methods are called; it is valid after the ready event is dispatched. If the value of the scaleMode property is VideoScaleMode.MAINTAIN_ASPECT_RATIO or VideoScaleMode.NO_SCALE, it is best to read the value after the layout event is dispatched. This property returns -1 if no information is available yet."/>
<page href="fl/video/FLVPlayback.html#preview" title="FLVPlayback.preview" text="preview Only for live preview. Reads in a PNG file for the preview."/>
<page href="fl/video/FLVPlayback.html#progressInterval" title="FLVPlayback.progressInterval" text="progressInterval A number that is the amount of time, in milliseconds, between each progress event. If you set this property while the video stream is playing, the timer restarts."/>
<page href="fl/video/FLVPlayback.html#registrationHeight" title="FLVPlayback.registrationHeight" text="registrationHeight The height used to align the video content when autoresizing. Do not confuse the registrationHeight property with the height property. The height property reflects the actual width of the video content. Example 1, load an 80x80 FLV file with the following settings: registrationX = 100 registrationY = 100 registrationWidth = 60 registrationHeight = 40 align = VideoAlign.CENTER scaleMode = VideoScaleMode.NO_SCALE Then, after automatic resizing, you get the following: x = 90 y = 80 width = 80 height = 80 Example 2, load the same scenario as example 1 but with the following settings: scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO You get the following: x = 110 y = 100 width = 40 height = 80 Example 3, load the same scenario as example 2 but with the following settings: scaleMode = VideoScaleMode.EXACT_FIT You get all the same values as the registration values: x = 100 y = 100 width = 60 height = 40 Setting the registrationHeight property is equivalent to setting the height property and vice versa. Setting any other property or calling any method that alters the height, such as scaleX, setSize, and setScale, setting keeps height and registrationHeight in sync."/>
<page href="fl/video/FLVPlayback.html#registrationWidth" title="FLVPlayback.registrationWidth" text="registrationWidth The width used to align the video content when autoresizing. Do not confuse the registrationWidth property with the width property. The width property reflects the actual width of the video content. Example 1, load an 80x80 FLV file with the following settings: registrationX = 100 registrationY = 100 registrationWidth = 60 registrationHeight = 40 align = VideoAlign.CENTER scaleMode = VideoScaleMode.NO_SCALE Then, after automatic resizing, you get the following: x = 90 y = 80 width = 80 height = 80 Example 2, load the same scenario as example 1 but with the following settings: scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO You get the following: x = 110 y = 100 width = 40 height = 80 Example 3, load the same scenario as example 2 but with the following settings: scaleMode = VideoScaleMode.EXACT_FIT You get all the same values as the registration values: x = 100 y = 100 width = 60 height = 40 Setting the registrationWidth property is equivalent to setting the width property and vice versa. Setting any other property or calling any method that alters the width, such as scaleX, setSize, and setScale, also keeps width and registrationWidth in sync."/>
<page href="fl/video/FLVPlayback.html#registrationX" title="FLVPlayback.registrationX" text="registrationX The x coordinate used to align the video content when autoresizing. Do not confuse with the x property, which reflects the actual location of the video content. Example 1, load an 80x80 FLV file with the following settings: registrationX = 100 registrationY = 100 registrationWidth = 60 registrationHeight = 40 align = VideoAlign.CENTER scaleMode = VideoScaleMode.NO_SCALE Then, after automatic resizing, you get the following: x = 90 y = 80 width = 80 height = 80 Example 2, load the same scenario as example 1 but with the following settings: scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO You get the following: x = 110 y = 100 width = 40 height = 80 Example 3, load the same scenario as example 2 but with the following settings: scaleMode = VideoScaleMode.EXACT_FIT You get all the same values as the registration values: x = 100 y = 100 width = 60 height = 40 When either the x or registrationX property is set, the second property is changed to maintain its offset from the first. For example, if x = 10 and registrationX = 20, setting x = 110 also sets registrationX = 120."/>
<page href="fl/video/FLVPlayback.html#registrationY" title="FLVPlayback.registrationY" text="registrationY The y coordinate used to align the video content when autoresizing. Do not confuse with the y property, which reflects the actual location of the video content. Example 1, load an 80x80 FLV file with the following settings: registrationX = 100 registrationY = 100 registrationWidth = 60 registrationHeight = 40 align = VideoAlign.CENTER scaleMode = VideoScaleMode.NO_SCALE Then, after automatic resizing, you get the following: x = 90 y = 80 width = 80 height = 80 Example 2, load the same scenario as example 1 but with the following settings: scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO You get the following: x = 110 y = 100 width = 40 height = 80 Example 3, load the same scenario as example 2 but with the following settings: scaleMode = VideoScaleMode.EXACT_FIT You get all the same values as the registration values: x = 100 y = 100 width = 60 height = 40 When either the y or registrationY property is set, the second property is changed to maintain its offset from the first. For example, if y = 10 and registrationY = 20, setting y = 110 also sets registrationY = 120."/>
<page href="fl/video/FLVPlayback.html#scaleMode" title="FLVPlayback.scaleMode" text="scaleMode Specifies how the video will resize after loading. If set to VideoScaleMode.MAINTAIN_ASPECT_RATIO, maintains the video aspect ratio within the rectangle defined by registrationX, registrationY, registrationWidth and registrationHeight. If set to VideoScaleMode.NO_SCALE, causes the video to size automatically to the dimensions of the source FLV file. If set to VideoScaleMode.EXACT_FIT, causes the dimensions of the source FLV file to be ignored and the video is stretched to fit the rectangle defined by registrationX, registrationY, registrationWidth and registrationHeight. If this is set after an FLV file has been loaded an automatic layout will start immediately. Values come from VideoScaleMode."/>
<page href="fl/video/FLVPlayback.html#scaleX" title="FLVPlayback.scaleX" text="scaleX A number that is the horizontal scale. The standard scale is 1."/>
<page href="fl/video/FLVPlayback.html#scaleY" title="FLVPlayback.scaleY" text="scaleY A number that is the vertical scale. The standard scale is 1."/>
<page href="fl/video/FLVPlayback.html#scrubbing" title="FLVPlayback.scrubbing" text="scrubbing A Boolean value that is true if the user is scrubbing with the SeekBar and false otherwise. Scrubbing refers to grabbing the handle of the SeekBar and dragging it in either direction to locate a particular scene in the FLV file."/>
<page href="fl/video/FLVPlayback.html#seekBar" title="FLVPlayback.seekBar" text="seekBar The SeekBar control."/>
<page href="fl/video/FLVPlayback.html#seekBarInterval" title="FLVPlayback.seekBarInterval" text="seekBarInterval A number that specifies, in milliseconds, how often to check the SeekBar handle when scrubbing. Because this interval is set by a call to the global setInterval() method, the update cannot start more frequently than the SWF file frame rate. So, for the default frame rate of 12 frames per second, for example, the lowest effective interval that you can create is approximately 83 milliseconds, or 1 second (1000 milliseconds) divided by 12."/>
<page href="fl/video/FLVPlayback.html#seekBarScrubTolerance" title="FLVPlayback.seekBarScrubTolerance" text="seekBarScrubTolerance A number that specifies how far a user can move the SeekBar handle before an update occurs. The value is specified as a percentage, ranging from 1 to 100."/>
<page href="fl/video/FLVPlayback.html#seekToPrevOffset" title="FLVPlayback.seekToPrevOffset" text="seekToPrevOffset The number of seconds that the seekToPrevNavCuePoint() method uses when it compares its time against the previous cue point. The method uses this value to ensure that, if you are just ahead of a cue point, you can hop over it to the previous one and avoid going to the same cue point that just occurred."/>
<page href="fl/video/FLVPlayback.html#SHORT_VERSION" title="FLVPlayback.SHORT_VERSION" text="SHORT_VERSION State variable indicating the short version number of the component. The version number is useful when you have a FLA file and need to know the component version. To determine the component version, type the following code trace into the FLA file: FLVPlayback.SHORT_VERSION The SHORT_VERSION variable includes only the major and minor version numbers, for example, 2.0. The VERSION variable includes the major and minor version numbers as well as the revision and build numbers, for example, 2.0.0.11."/>
<page href="fl/video/FLVPlayback.html#skin" title="FLVPlayback.skin" text="skin A string that specifies the URL to a skin SWF file. This string could contain a file name, a relative path such as Skins/MySkin.swf, or an absolute URL such as http://www.%somedomain%.com/MySkin.swf."/>
<page href="fl/video/FLVPlayback.html#skinAutoHide" title="FLVPlayback.skinAutoHide" text="skinAutoHide A Boolean value that, if true, hides the component skin when the mouse is not over the video. This property affects only skins that are loaded by setting the skin property and not a skin that you create from the FLVPlayback Custom UI components. When the component is in full-screen takeover mode and the skin is one that does not lay over the video, then skinAutoHide mode is turned on automatically. Setting skinAutoHide = false after you enter full-screen mode overrides this behavior. Also when the component is in full-screen takeover mode, autohiding is triggered if the user doesn't move the mouse for more than fullScreenSkinDelay seconds, unless the mouse is over the skin itself."/>
<page href="fl/video/FLVPlayback.html#skinBackgroundAlpha" title="FLVPlayback.skinBackgroundAlpha" text="skinBackgroundAlpha The alpha for the background of the skin. The skinBackgroundAlpha property works only with SWF files that have skins loaded by using the skin property and with skins that support setting the color and alpha. You can set the skinBackgroundAlpha property to a number between 0.0 and 1.0. The default is the last value chosen by the user as the default. To get the skin colors that come with the ActionScript 2.0 FLVPlayback component, use the following values for the skinBackgroundAlpha and skinBackgroundColor properties: Arctic - 0.85, 0x47ABCB; Clear - 0.20, 0xFFFFFF; Mojave - 0.85, 0xBFBD9F; Steel - 0.85, 0x666666. The default is .85."/>
<page href="fl/video/FLVPlayback.html#skinBackgroundColor" title="FLVPlayback.skinBackgroundColor" text="skinBackgroundColor The color for the background of the skin (0xRRGGBB). The skinBackgroundColor property works only with SWF files that have skins loaded by using the skin property and with skins that support setting the color and alpha. The default is the last value chosen by the user as the default. To get the skin colors that come with the ActionScript 2.0 FLVPlayback component, use the following values for the skinBackgroundAlpha and skinBackgroundColor properties: Arctic - 0.85, 0x47ABCB; Clear - 0.20, 0xFFFFFF; Mojave - 0.85, 0xBFBD9F; Steel - 0.85, 0x666666. The default is 0x47ABCB."/>
<page href="fl/video/FLVPlayback.html#skinFadeTime" title="FLVPlayback.skinFadeTime" text="skinFadeTime The amount of time in milliseconds that it takes for the skin to fade in or fade out when hiding or showing. Hiding and showing occurs because the skinAutoHide property is set to true. Set the skinFadeTime property to 0 to eliminate the fade effect."/>
<page href="fl/video/FLVPlayback.html#skinScaleMaximum" title="FLVPlayback.skinScaleMaximum" text="skinScaleMaximum This property specifies the largest multiple that FLVPlayback will use to scale up its skin when it enters full screen mode with a Flash Player that supports hardware acceleration. With hardware acceleration, the video and the skin are scaled by the same factor. By default, FLVPlayback renders the video at its native dimensions and allows hardware acceleration to do the rest of the scaling. If, for example, your video has dimensions of 640 x 512 and it goes to full screen size on a monitor with a resolution of 1280 x 1024, the video and the skin will be scaled up to twice their size. This property enables you to restrict scaling of the skin when hardware acceleration is used, based on the specific content that is being scaled and your aesthetic tastes regarding the appearance of large skins. To limit scaling of the skin to the specified multiplier, FLVPlayback uses a mix of software and hardware scaling for the skin, which can have a negative impact on the performance of video playback and the appearance of the FLV. For example, if this property was set to 5.0 or greater, going to full screen on a monitor that has a resolution of 1600 x 1200 with a video that has dimensions of 320 x 240 would scale the skin five times. If this property was set to 2.5, the player would render the video (but not the skin) at 640 x 480, twice it's original size, and hardware acceleration would do the remainder of the scaling (640 x 2.5 = 1600 and 480 x 2.5 = 1200). Setting this property after full screen mode has already been entered has no effect until the next time FLVPlayback enters full screen mode. If the FLV is large (for example, 640 pixels wide or more, 480 pixels tall or more) you should not set this property to a small value because it could cause noticeable performance problems on large monitors. Player Version: Flash Player 9 Update 3. The following example sets the skinScaleMaximum property to 2.5 to limit the scaling of the FLVPlayback skin to 2.5 times when the component goes into full screen mode with hardware acceleration. To see the affect of the skinScaleMaximum property, click the full screen button on the FLVPlayback skin while the FLV is playing in the browser. Note: Test this example in the browser. In the Flash Publish Settings dialog, on the HTML tab, select the template Flash Only - Allow Full Screen. Specify a Flash Player version of Update 3, and make sure the Flash and HTML formats are selected on the Formats tab. Then publish and open the resulting HTML file in the browser. // Requires FLVPlayback component in library // Requires SkinOverPlayFullscreen.swf to be in the same folder as the .fla file. import fl.video.FLVPlayback; var myFLVPlybk:FLVPlayback = new FLVPlayback(); addChild(myFLVPlybk); myFLVPlybk.skin = &quot;SkinOverPlayFullscreen.swf&quot;; myFLVPlybk.skinScaleMaximum = 2.5; myFLVPlybk.source = &quot;http://helpexamples.com/flash/video/water.flv&quot;;"/>
<page href="fl/video/FLVPlayback.html#soundTransform" title="FLVPlayback.soundTransform" text="soundTransform Provides direct access to the VideoPlayer.soundTransform property to expose more sound control. You need to set this property for changes to take effect, or you can get the value of this property to get a copy of the current settings."/>
<page href="fl/video/FLVPlayback.html#source" title="FLVPlayback.source" text="source A string that specifies the URL of the FLV file to stream and how to stream it. The URL can be an HTTP URL to an FLV file, an RTMP URL to a stream, or an HTTP URL to an XML file. If you set this property through the Component inspector or the Property inspector, the FLV file begins loading and playing at the next &quot;enterFrame&quot; event. The delay provides time to set the isLive, autoPlay, and cuePoints properties, among others, which affect loading. It also allows ActionScript that is placed on the first frame to affect the FLVPlayback component before it starts playing. If you set this property through ActionScript, it immediately calls the VideoPlayer.load() method when the autoPlay property is set to false or it calls the VideoPlayer.play() method when the autoPlay property is set to true. The autoPlay, totalTime, and isLive properties affect how the new FLV file is loaded, so if you set these properties, you must set them before setting the source property. Set the autoPlay property to false to prevent the new FLV file from playing automatically."/>
<page href="fl/video/FLVPlayback.html#state" title="FLVPlayback.state" text="state A string that specifies the state of the component. This property is set by the load(), play(), stop(), pause(), and seek() methods. The possible values for the state property are: &quot;buffering&quot;, &quot;connectionError&quot;, &quot;disconnected&quot;, &quot;loading&quot;, &quot;paused&quot;, &quot;playing&quot;, &quot;rewinding&quot;, &quot;seeking&quot;, and &quot;stopped&quot;. You can use the FLVPlayback class properties to test for these states."/>
<page href="fl/video/FLVPlayback.html#stateResponsive" title="FLVPlayback.stateResponsive" text="stateResponsive A Boolean value that is true if the state is responsive. If the state is unresponsive, calls to the play(), load(), stop(), pause() and seek() methods are queued and executed later, when the state changes to a responsive one. Because these calls are queued and executed later, it is usually not necessary to track the value of the stateResponsive property. The responsive states are: stopped, playing, paused, and buffering."/>
<page href="fl/video/FLVPlayback.html#stopButton" title="FLVPlayback.stopButton" text="stopButton The Stop button control."/>
<page href="fl/video/FLVPlayback.html#stopped" title="FLVPlayback.stopped" text="stopped A Boolean value that is true if the state of the FLVPlayback instance is stopped."/>
<page href="fl/video/FLVPlayback.html#totalTime" title="FLVPlayback.totalTime" text="totalTime A number that is the total playing time for the video in seconds. When streaming from Flash Media Server (FMS) and using the default NCManager, this value is determined automatically by server-side APIs, and that value overrides anything set through this property or gathered from metadata. The property is ready for reading when the stopped or playing state is reached after setting the source property. This property is meaningless for live streams from a FMS. With an HTTP download, the value is determined automatically if the FLV file has metadata embedded; otherwise, set it explicitly or it will be NaN. If you set it explicitly, the metadata value in the stream is ignored. When you set this property, the value takes effect for the next FLV file that is loaded by setting the source property. It has no effect on an FLV file that has already loaded. Also, this property does not return the new value passed in until an FLV file is loaded. Playback still works if this property is never set (either explicitly or automatically), but it can cause problems with seek controls. Unless set explicitly, the value will be NaN until it is set to a valid value from metadata."/>
<page href="fl/video/FLVPlayback.html#VERSION" title="FLVPlayback.VERSION" text="VERSION State variable indicating the long version number of the component. The version number is useful when you have a FLA file and need to know the component version. To determine the component version, type the following code trace into the FLA file: FLVPlayback.VERSION The VERSION variable includes the major and minor version numbers as well as the revision and build numbers, for example, 2.0.0.11. The SHORT_VERSION variable includes only the major and minor version numbers, for example, 2.0."/>
<page href="fl/video/FLVPlayback.html#visibleVideoPlayerIndex" title="FLVPlayback.visibleVideoPlayerIndex" text="visibleVideoPlayerIndex A number that you can use to manage multiple FLV file streams. Sets which video player instance is visible, audible, and controlled by the skin or playback controls, while the rest of the video players are hidden and muted. It does not make the video player the target for most APIs; use the activeVideoPlayerIndex property to do that. Methods and properties that control dimensions interact with this property. The methods and properties that set the dimensions of the video player (setScale(), setSize(), width, height, scaleX, scaleY) can be used for all video players. However, depending on the value of the scaleMode property on those video players, they might have different dimensions. Reading the dimensions using the width, height, scaleX, and scaleY properties gives you the dimensions only of the visible video player. Other video players might have the same dimensions or might not. To get the dimensions of various video players when they are not visible, listen for the layout event, and store the size value. This property does not have any implications for visibility of the component as a whole, only which video player is visible when the component is visible. To set visibility for the entire component, use the visible property."/>
<page href="fl/video/FLVPlayback.html#volume" title="FLVPlayback.volume" text="volume A number in the range of 0 to 1 that indicates the volume control setting."/>
<page href="fl/video/FLVPlayback.html#volumeBar" title="FLVPlayback.volumeBar" text="volumeBar The volume bar control."/>
<page href="fl/video/FLVPlayback.html#volumeBarInterval" title="FLVPlayback.volumeBarInterval" text="volumeBarInterval A number that specifies, in milliseconds, how often to check the volume bar handle location when scrubbing."/>
<page href="fl/video/FLVPlayback.html#volumeBarScrubTolerance" title="FLVPlayback.volumeBarScrubTolerance" text="volumeBarScrubTolerance A number that specifies how far a user can move the volume bar handle before an update occurs. The value is expressed as a percentage from 1 to 100. Set to 0 to indicate no scrub tolerance. Always update the volume on the volumeBarInterval property regardless of how far the user moved the handle."/>
<page href="fl/video/FLVPlayback.html#width" title="FLVPlayback.width" text="width A number that specifies the width of the FLVPlayback instance on the Stage. This property affects only the width of the FLVPlayback instance and does not include the width of a skin SWF file that might be loaded. Use the FLVPlayback width property and not the DisplayObject.width property because the width property might give a different value if a skin SWF file is loaded. Setting the width property also sets the registrationWidth property to the same value."/>
<page href="fl/video/FLVPlayback.html#x" title="FLVPlayback.x" text="x A number that specifies the horizontal position (in pixels) of the video player. Setting the x property also affects the registrationX property. When either the x or registrationX property is set, the second property is changed to maintain its offset from the first. For example, if x = 10 and registrationX = 20, setting x = 110 also sets registrationX = 120."/>
<page href="fl/video/FLVPlayback.html#y" title="FLVPlayback.y" text="y A number that specifies the vertical position (in pixels) of the video player. Setting the y property also affects the registrationY property. When either the y or registrationY property is set, the second property is changed to maintain its offset from the first. For example, if y = 10 and registrationY = 20, setting y = 110 also sets registrationY = 120."/>
<page href="fl/video/FLVPlayback.html#event:autoLayout" title="FLVPlayback.autoLayout" text="autoLayout Dispatched when the video player is resized or laid out automatically. A video player is laid out automatically based on the values of the align and scaleMode properties when a new FLV file is loaded or when one of those two properties is changed. The autoLayout event is of type AutoLayoutEvent and has the constant AutoLayoutEvent.AUTO_LAYOUT. After an attempt to automatically lay out a video player, the event object is dispatched even if the dimensions were not changed. A LayoutEvent is also dispatched in these three scenarios: If the video player that laid itself out is visible. If there are two video players of different sizes or positions and the visibleVideoPlayerIndex property is switched from one video player to another. If methods or properties that change the size of the video player such as setSize(), setScale(), width, height, scaleX, scaleY, registrationWidth and registrationHeight, are called. If multiple video player instances are in use, this event may not apply to the visible video player."/>
<page href="fl/video/FLVPlayback.html#event:autoRewound" title="FLVPlayback.autoRewound" text="autoRewound Dispatched when the playhead is moved to the start of the video player because the autoRewind property is set to true. When the autoRewound event is dispatched, the rewind event is also dispatched. The autoRewound event is of type VideoEvent and has the constant VideoEvent.AUTO_REWOUND."/>
<page href="fl/video/FLVPlayback.html#event:bufferingStateEntered" title="FLVPlayback.bufferingStateEntered" text="bufferingStateEntered Dispatched when the FLVPlayback instance enters the buffering state. The FLVPlayback instance typically enters this state immediately after a call to the play() method or when the Play control is clicked, before entering the playing state. The stateChange event is also dispatched. The bufferingStateEntered event is of type VideoEvent and has the constant VideoEvent.BUFFERING_STATE_ENTERED."/>
<page href="fl/video/FLVPlayback.html#event:close" title="FLVPlayback.close" text="close Dispatched when the event object closes the NetConnection, by timing out or through a call to the closeVideoPlayer() method or when you call the load() or play() methods or set the source property and cause the RTMP connection to close as a result. The FLVPlayback instance dispatches this event only when streaming from Flash Media Server (FMS) or other Flash Video Streaming Service (FVSS). The close event is of type VideoEvent and has the constant VideoEvent.CLOSE."/>
<page href="fl/video/FLVPlayback.html#event:complete" title="FLVPlayback.complete" text="complete Dispatched when playing completes because the player reached the end of the FLV file. The component does not dispatch the event if you call the stop() or pause() methods or click the corresponding controls. When the application uses progressive download, it does not set the totalTime property explicitly, and it downloads an FLV file that does not specify the duration in the metadata. The video player sets the totalTime property to an approximate total value before it dispatches this event. The video player also dispatches the stateChange and stoppedStateEntered events. The complete event is of type VideoEvent and has the constant VideoEvent.COMPLETE."/>
<page href="fl/video/FLVPlayback.html#event:cuePoint" title="FLVPlayback.cuePoint" text="cuePoint Dispatched when a cue point is reached. The event object has an info property that contains the info object received by the NetStream.onCuePoint event callback for FLV file cue points. For ActionScript cue points, it contains the object that was passed into the ActionScript cue point methods or properties. The cuePoint event is of type MetadataEvent and has the constant MetadataEvent.CUE_POINT."/>
<page href="fl/video/FLVPlayback.html#event:fastForward" title="FLVPlayback.fastForward" text="fastForward Dispatched when the location of the playhead moves forward by a call to the seek() method or by clicking the ForwardButton control. The FLVPlayback instance also dispatches playheadUpdate event. The fastForward event is of type VideoEvent and has the constant VideoEvent.FAST_FORWARD."/>
<page href="fl/video/FLVPlayback.html#event:layout" title="FLVPlayback.layout" text="layout Dispatched when the video player is resized or laid out. Here are two layout scenarios: If the video player is laid out by either using the autoLayout event or calling the setScale() or setSize() methods or changing the width, height, scaleX, and scaleY properties. If there are two video players of different sizes and the visibleVideoPlayerIndex property is switched from one video player to another. The layout event is of type LayoutEvent and has the constant LayoutEvent.LAYOUT."/>
<page href="fl/video/FLVPlayback.html#event:metadataReceived" title="FLVPlayback.metadataReceived" text="metadataReceived Dispatched the first time the FLV file's metadata is reached. The event object has an info property that contains the info object received by the NetStream.onMetaData event callback. The metadataReceived event is of type MetadataEvent and has the constant MetadataEvent.METADATA_RECEIVED."/>
<page href="fl/video/FLVPlayback.html#event:pausedStateEntered" title="FLVPlayback.pausedStateEntered" text="pausedStateEntered Dispatched when the player enters the paused state. This happens when you call the pause() method or click the corresponding control and it also happens in some cases when the FLV file is loaded and the autoPlay property is false (the state may be stopped instead). The stateChange event is also dispatched. The pausedStateEntered event is of type VideoEvent and has the constant VideoEvent.PAUSED_STATE_ENTERED."/>
<page href="fl/video/FLVPlayback.html#event:playheadUpdate" title="FLVPlayback.playheadUpdate" text="playheadUpdate Dispatched while the FLV file is playing at the frequency specified by the playheadUpdateInterval property or when rewinding starts. The component does not dispatch this event when the video player is paused or stopped unless a seek occurs. The playheadUpdate event is of type VideoEvent and has the constant VideoEvent.PLAYHEAD_UPDATE."/>
<page href="fl/video/FLVPlayback.html#event:playingStateEntered" title="FLVPlayback.playingStateEntered" text="playingStateEntered Dispatched when the playing state is entered. This may not occur immediately after the play() method is called or the corresponding control is clicked; often the buffering state is entered first, and then the playing state. The FLVPlayback instance also dispatches the stateChange event. The playingStateEntered event is of type VideoEvent and has the constant VideoEvent.PLAYING_STATE_ENTERED."/>
<page href="fl/video/FLVPlayback.html#event:progress" title="FLVPlayback.progress" text="progress Indicates progress made in number of bytes downloaded. Dispatched at the frequency specified by the progressInterval property, starting when the load begins and ending when all bytes are loaded or there is a network error. The default is every .25 seconds starting when load is called and ending when all bytes are loaded or if there is a network error. Use this event to check bytes loaded or number of bytes in the buffer. Dispatched only for a progressive HTTP download. Indicates progress in number of downloaded bytes. The event object has the bytesLoaded and bytesTotal properties, which are the same as the FLVPlayback properties of the same names. The progress event is of type VideoProgressEvent and has the constant VideoProgressEvent.PROGRESS."/>
<page href="fl/video/FLVPlayback.html#event:ready" title="FLVPlayback.ready" text="ready Dispatched when an FLV file is loaded and ready to display. It starts the first time you enter a responsive state after you load a new FLV file with the play() or load() method. It starts only once for each FLV file that is loaded. The ready event is of type VideoEvent and has the constant VideoEvent.READY."/>
<page href="fl/video/FLVPlayback.html#event:rewind" title="FLVPlayback.rewind" text="rewind Dispatched when the location of the playhead moves backward by a call to seek() or when an autoRewind call is completed. When an autoRewind call is completed, an autoRewound event is triggered first. The rewind event is of type VideoEvent and has the constant VideoEvent.REWIND."/>
<page href="fl/video/FLVPlayback.html#event:scrubFinish" title="FLVPlayback.scrubFinish" text="scrubFinish Dispatched when the user stops scrubbing the FLV file with the seek bar. Scrubbing refers to grabbing the handle of the SeekBar and dragging it in either direction to locate a particular scene in the FLV file. Scrubbing stops when the user releases the handle of the seek bar. The component also dispatches the stateChange event with the state property, which is either playing, paused, stopped, or buffering. The state property is seeking until the user finishes scrubbing. The scrubFinish event is of type VideoEvent and has the constant VideoEvent.SCRUB_FINISH."/>
<page href="fl/video/FLVPlayback.html#event:scrubStart" title="FLVPlayback.scrubStart" text="scrubStart Dispatched when the user begins scrubbing the FLV file with the seek bar. Scrubbing refers to grabbing the handle of the SeekBar and dragging it in either direction to locate a particular scene in the FLV file. Scrubbing begins when the user clicks the SeekBar handle and ends when the user releases it. The component also dispatches the stateChange event with the state property equal to seeking. The state remains seeking until the user stops scrubbing. The scrubStart event is of type VideoEvent and has the constant VideoEvent.SCRUB_START."/>
<page href="fl/video/FLVPlayback.html#event:seeked" title="FLVPlayback.seeked" text="seeked Dispatched when the location of the playhead is changed by a call to seek() or by setting the playheadTime property or by using the SeekBar control. The playheadTime property is the destination time. The seeked event is of type VideoEvent and has the constant VideoEvent.SEEKED. The FLVPlayback instance dispatches the rewind event when the seek is backward and the fastForward event when the seek is forward. It also dispatches the playheadUpdate event. For several reasons, the playheadTime property might not have the expected value immediately after you call one of the seek methods or set playheadTime to cause seeking. First, for a progressive download, you can seek only to a keyframe, so a seek takes you to the time of the first keyframe after the specified time. (When streaming, a seek always goes to the precise specified time even if the source FLV file doesn't have a keyframe there.) Second, seeking is asynchronous, so if you call a seek method or set the playheadTime property, playheadTime does not update immediately. To obtain the time after the seek is complete, listen for the seek event, which does not start until the playheadTime property has updated."/>
<page href="fl/video/FLVPlayback.html#event:skinError" title="FLVPlayback.skinError" text="skinError Dispatched when an error occurs loading a skin SWF file. The event has a message property that contains the error message. If a skin SWF file is set, playback begins when the ready event and skinLoaded (or skinError) events have both started. The skinError event is of type SkinErrorEvent and has the constant SkinErrorEvent.SKIN_ERROR."/>
<page href="fl/video/FLVPlayback.html#event:skinLoaded" title="FLVPlayback.skinLoaded" text="skinLoaded Dispatched when a skin SWF file is loaded. The component does not begin playing an FLV file until the ready event and skinLoaded (or skinError) events have both started. The skinLoaded event is of type VideoEvent and has the constant VideoEvent.SKIN_LOADED."/>
<page href="fl/video/FLVPlayback.html#event:soundUpdate" title="FLVPlayback.soundUpdate" text="soundUpdate Dispatched when sound changes by the user either moving the handle of the volumeBar control or setting the volume or soundTransform property. The soundUpdate event is of type SoundEvent and has the constant SoundEvent.SOUND_UPDATE."/>
<page href="fl/video/FLVPlayback.html#event:stateChange" title="FLVPlayback.stateChange" text="stateChange Dispatched when the playback state changes. When an autoRewind call is completed the stateChange event is dispatched with the rewinding state. The stateChange event does not start until rewinding has completed. This event can be used to track when playback enters or leaves unresponsive states such as in the middle of connecting, resizing, or rewinding. The play(), pause(), stop() and seek() methods queue the requests to be executed when the player enters a responsive state. The stateChange event is of type VideoEvent and has the constant VideoEvent.STATE_CHANGE."/>
<page href="fl/video/FLVPlayback.html#event:stoppedStateEntered" title="FLVPlayback.stoppedStateEntered" text="stoppedStateEntered Dispatched when entering the stopped state. This happens when you call the stop() method or click the stopButton control. It also happens, in some cases, if the autoPlay property is false (the state might become paused instead) when the FLV file is loaded. The FLVPlayback instance also dispatches this event when the playhead stops at the end of the FLV file because it has reached the end of the timeline. The FLVPlayback instance also dispatches the stateChange event. The stoppedStateEntered event is of type VideoEvent and has the constant VideoEvent.STOPPED_STATE_ENTERED."/>
<page href="fl/video/LayoutEvent.html" title="LayoutEvent class" text="LayoutEvent Event dispatched when the video player is resized and/or laid out. Here are two layout scenarios: If the video player is laid out by using the autoLayout event, calling the setScale(), setSize() methods, or changing the width, height, scaleX, scaleY, registrationWidth, and registrationHeight properties. If there are two video players of different sizes or locations and the visibleVideoPlayerIndex property is switched from one video player to another. There is only one type of LayoutEvent object: LayoutEvent.LAYOUT."/>
<page href="fl/video/LayoutEvent.html#LayoutEvent()" title="LayoutEvent.LayoutEvent()" text="LayoutEvent Creates an Event object that contains information about layout events. Event objects are passed as parameters to event listeners. type bubbles cancelable oldBounds oldRegistrationBounds The type of the event. Event listeners can access this information through the inherited type property. There is only one type of auto layout event: LayoutEvent.LAYOUT. Determines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. Determines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. Indicates the values of the x, y, width, and height properties of the target before the layout event occurs. Event listeners can access this information through the oldBounds property. Indicates the values of the registrationX, registrationY, registrationWidth, and registrationHeight properties of the target before the layout event occurs. Event listeners can access this information through the oldRegistrationBounds property."/>
<page href="fl/video/LayoutEvent.html#LAYOUT" title="LayoutEvent.LAYOUT" text="LAYOUT Defines the value of the type property of a layout event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. oldBoundsThe values of the x, y, width, and height properties of the target before the layout event occurs. oldRegistrationBoundsThe values of the registrationX, registrationY, registrationWidth, and registrationHeight properties of the target before the layout event occurs."/>
<page href="fl/video/LayoutEvent.html#oldBounds" title="LayoutEvent.oldBounds" text="oldBounds Indicates the values of the x, y, width, and height properties of the target before the event occurs."/>
<page href="fl/video/LayoutEvent.html#oldRegistrationBounds" title="LayoutEvent.oldRegistrationBounds" text="oldRegistrationBounds Indicates the values of the registrationX, registrationY, registrationWidth, and registrationHeight properties of the target before the event occurs."/>
<page href="fl/video/LayoutEvent.html#event:layout" title="LayoutEvent.layout" text="layout Defines the value of the type property of a layout event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. oldBoundsThe values of the x, y, width, and height properties of the target before the layout event occurs. oldRegistrationBoundsThe values of the registrationX, registrationY, registrationWidth, and registrationHeight properties of the target before the layout event occurs."/>
<page href="fl/video/VideoScaleMode.html" title="VideoScaleMode class" text="VideoScaleMode The VideoScaleMode class provides constant values to use for the FLVPlayback.scaleMode and VideoPlayer.scaleMode properties."/>
<page href="fl/video/VideoScaleMode.html#EXACT_FIT" title="VideoScaleMode.EXACT_FIT" text="EXACT_FIT Specifies that the video be displayed at the height and width specified by the registrationHeight or height and registrationWidth or width properties. For example, if registrationWidth = width = 100 and registrationHeight = height = 100, if registrationX = 200 and registrationY = 200, and if an FLV file is loaded with a width of 648 and a height of 480 (for an approximate aspect ratio of 4:3), and if align = VideoAlign.CENTER and scaleMode = EXACT_FIT, you end up with width = 100, height = 100, x = 200, and y = 200."/>
<page href="fl/video/VideoScaleMode.html#MAINTAIN_ASPECT_RATIO" title="VideoScaleMode.MAINTAIN_ASPECT_RATIO" text="MAINTAIN_ASPECT_RATIO Specifies that the video be constrained within the rectangle determined by the registrationX, registrationY, registrationWidth, and registrationHeight properties but that its original aspect ratio be preserved. For example, if registrationWidth = 100 and registrationHeight = 100, if registrationX = 200 and registrationY = 200, and if an FLV file is loaded with a width of 648 and a height of 480 (for an approximate aspect ratio of 4:3), and if align = VideoAlign.CENTER and scaleMode = MAINTAIN_ASPECT_RATIO, you end up with width = 100, and height = (100 ~~ 480 / 648) = 74, x = 10, and y = (10 + ((100 - 74) / 2)) = 23."/>
<page href="fl/video/VideoScaleMode.html#NO_SCALE" title="VideoScaleMode.NO_SCALE" text="NO_SCALE Specifies that the video be displayed at exactly the height and width of the source video. For example, if registrationWidth = 100 and registrationHeight = 100, if registrationX = 200 and registrationY = 200, and if an FLV file is loaded with a width of 648 and a height of 480 (for an approximate aspect ratio of 4:3), and if align = VideoAlign.CENTER and scaleMode = NO_SCALE, you end up with width = 648, height = 480, x = (200 + ((100 - 648) / 2)) = -74, and y = (200 + ((100 - 480) / 2)) = 10."/>
<page href="fl/video/NCManager.html" title="NCManager class" text="NCManager Creates the NetConnection object for the VideoPlayer class, a helper class for that user facing class. The NCManager class searches a URL and assumes the following: If the URL string host starts with a valid FMS streaming protocol (such as rtmp://, rtmps://, or rtmpt://) it infers that the URL is streaming from an FMS. If it does not stream from an FMS and if the URL contains a question mark (?), it infers that the URL points to an SMIL file. If it does not stream from an FMS and if it does not contain a question mark (?), the NCManager class checks to see whether it ends in .flv. If it ends in .flv, it infers it is for a progressive download FLV. Otherwise, it is an SMIL file to download and parse."/>
<page href="fl/video/NCManager.html#NCManager()" title="NCManager.NCManager()" text="NCManager Creates a new NCManager instance."/>
<page href="fl/video/NCManager.html#close()" title="NCManager.close()" text="close Closes the NetConnection."/>
<page href="fl/video/NCManager.html#connectAgain()" title="NCManager.connectAgain()" text="connectAgain Called by the VideoPlayer object if the connection is successfully made but the stream is not found. If multiple alternate interpretations of the RTMP URL are possible, it tries to connect to the server with a different URL and hand back a different stream name. This can be necessary in cases where the URL is something like rtmp://servername/path1/path2/path3. When passing in an application name and an instance name, open the NetConnection object with rtmp://servername/path1/path2, or use the default instance so the stream is opened with path2/path3. In general, this is possible whenever there are more than two parts to the path but not possible if there are only two (there should never be only one)."/>
<page href="fl/video/NCManager.html#connectToURL()" title="NCManager.connectToURL()" text="connectToURL Called by the VideoPlayer object to ask for a connection to the URL. Once a connection is successful or failed, then call the VideoPlayer.ncConnected() method. If the connection has failed, then set nc = null before calling. url The URL to which the VideoPlayer object requests connection."/>
<page href="fl/video/NCManager.html#getProperty()" title="NCManager.getProperty()" text="getProperty Allows getting of the fallbackServerName, fpadZone, objectEncoding, and proxyType properties. See setProperty() for an explanation of these properties. propertyName The name of the property that the getProperty method is calling."/>
<page href="fl/video/NCManager.html#helperDone()" title="NCManager.helperDone()" text="helperDone Called by any helper object doing a task for the NCManager object to signal it has completed and whether it was successful. The NCManager object uses this with SMILManager. helper success The helper object. A setting to signal when a task is completed. If success is true, then the task was completed successfully; otherwise false."/>
<page href="fl/video/NCManager.html#reconnect()" title="NCManager.reconnect()" text="reconnect Called by the VideoPlayer object to ask for reconnection after the connection is lost. Once the connection is either successful or failed, call the VideoPlayer.ncReconnected() method. If the connection failed, set nc = null before calling."/>
<page href="fl/video/NCManager.html#setProperty()" title="NCManager.setProperty()" text="setProperty Allows setting of the fallbackServerName, fpadZone, objectEncoding, and proxyType properties. The fallbackServerName property specifies a Flash Media Server (FMS) URL to be used if the primary server address derived from the URL passed into connectToURL() cannot be reached. This property can also be set directly through the fallbackServerName property. The fpadZone property specifies the fpadZone property for Flash Media Server (FMS). If the returned value is not a number (NaN), then no zone is set. The fpadZone property must be set before the connection process begins to have effect. If you do not want to set a zone, set the fpadZone property to NaN. Default is NaN. The objectEncoding property specifies the value to be used for the objectEncoding property on NetConnection instances. Default is flash.net.ObjectEncoding.AMF0. The proxyType property specifies the value to be used for the proxyType property on NetConnection instances. Default is &quot;best&quot;. propertyName value The name of the property that the setProperty method is calling. The property value."/>
<page href="fl/video/NCManager.html#bitrate" title="NCManager.bitrate" text="bitrate When streaming from Flash Media Server (FMS), the bitrate property returns the value calculated from autodetection, not the value set through the bitrate() property."/>
<page href="fl/video/NCManager.html#DEFAULT_TIMEOUT" title="NCManager.DEFAULT_TIMEOUT" text="DEFAULT_TIMEOUT The default timeout in milliseconds."/>
<page href="fl/video/NCManager.html#fallbackServerName" title="NCManager.fallbackServerName" text="fallbackServerName Exposes the fallbackServerName property indirectly or directly. Indirectly—Supply a second &lt;meta base&gt; in SMIL. The fallbackServerName property uses that base attribute. (The fallbackServerName property uses the server name only, nothing else.) Directly—Access the ncMgr property in FLVPlayback or VideoPlayer and set the fallbackServerName property or use the setProperty() method."/>
<page href="fl/video/NCManager.html#isRTMP" title="NCManager.isRTMP" text="isRTMP Whether the URL is for RTMP streaming from a Flash Media Server (FMS) or a progressive download. If the stream is an RTMP stream from an FMS, then true. If the stream is a progressive download of an HTTP, local or other file, then false."/>
<page href="fl/video/NCManager.html#netConnection" title="NCManager.netConnection" text="netConnection Reference to the NetConnection object."/>
<page href="fl/video/NCManager.html#SHORT_VERSION" title="NCManager.SHORT_VERSION" text="SHORT_VERSION State variable indicating the short version number of the component. The version number is useful when you have a FLA file and need to know the component version. To determine the component version, type the following code trace into the FLA file: FLVPlayback.SHORT_VERSION The SHORT_VERSION variable includes only the major and minor version numbers, for example, 2.0. The VERSION variable includes the major and minor version numbers as well as the revision and build numbers, for example, 2.0.0.11."/>
<page href="fl/video/NCManager.html#streamHeight" title="NCManager.streamHeight" text="streamHeight Height of the stream, in pixels. After the VideoPlayer.ncConnected() method is called, if the streamHeight property is less than 0, that indicates to the VideoPlayer object that there is no stream height information. If the VideoPlayer object has the scaleMode property set to VideoScaleMode.MAINTAIN_ASPECT_RATIO or VideoScaleMode.NO_SCALE, then this value will be used and the resizing will happen instantly, rather than waiting."/>
<page href="fl/video/NCManager.html#streamLength" title="NCManager.streamLength" text="streamLength Length of the stream, in seconds. After the VideoPlayer.ncConnected() method is called, if it returns undefined, null or less than 0, then the VideoPlayer object knows that there is no stream length information. If stream length information is returned, it overrides any existing steam length information including information set by the totalTime parameter of the VideoPlayer.play() method or the VideoPlayer.load() method or information received from the FLV file's metadata."/>
<page href="fl/video/NCManager.html#streamName" title="NCManager.streamName" text="streamName The stream name passed into the NetStream.play() method."/>
<page href="fl/video/NCManager.html#streamWidth" title="NCManager.streamWidth" text="streamWidth Width of the stream, in pixels. After the VideoPlayer.ncConnected() method is called, if the streamWidth property is less than 0, that indicates to the VideoPlayer object that there is no stream width information. If the VideoPlayer object has the scaleMode property set to VideoScaleMode.MAINTAIN_ASPECT_RATIO or VideoScaleMode.NO_SCALE, then this value is used and the resizing happens instantly, rather than waiting."/>
<page href="fl/video/NCManager.html#timeout" title="NCManager.timeout" text="timeout The time in milliseconds after which attempts to make a connection stop."/>
<page href="fl/video/NCManager.html#VERSION" title="NCManager.VERSION" text="VERSION State variable indicating the long version number of the component. The version number is useful when you have a FLA file and need to know the component version. To determine the component version, type the following code trace into the FLA file: FLVPlayback.VERSION The VERSION variable includes the major and minor version numbers as well as the revision and build numbers, for example, 2.0.0.11. The SHORT_VERSION variable includes only the major and minor version numbers, for example, 2.0."/>
<page href="fl/video/NCManager.html#videoPlayer" title="NCManager.videoPlayer" text="videoPlayer The VideoPlayer object that owns this object."/>
<page href="fl/video/AutoLayoutEvent.html" title="AutoLayoutEvent class" text="AutoLayoutEvent Flash® Player dispatches an AutoLayoutEvent object when the video player is resized and laid out automatically. A video player is laid out automatically when the maintainAspectRatio property or autoSize property is set to true or when a new FLV file is loaded. There is only one type of AutoLayoutEvent object: AutoLayoutEvent.AUTO_LAYOUT. After an attempt to automatically lay out a video player occurs, the event object is dispatched even if the dimensions were not changed. A LayoutEvent object is also dispatched in these three scenarios: If the video player that laid itself out is visible. If there are two video players of different sizes or positions and the visibleVideoPlayerIndex property is switched from one video player to another. If methods or properties that change the size or location of the video player, such as setSize(), setScale(), width, height, scaleX, scaleY, registrationWidth, and registrationHeight, are called. If multiple video player instances are in use, this event may not apply to the visible video player."/>
<page href="fl/video/AutoLayoutEvent.html#AutoLayoutEvent()" title="AutoLayoutEvent.AutoLayoutEvent()" text="AutoLayoutEvent Creates an Event object that contains information about autoLayout events. Event objects are passed as parameters to event listeners. type bubbles cancelable oldBounds oldRegistrationBounds vp The type of the event. Event listeners can access this information through the inherited type property. There is only one type of auto layout event: AutoLayoutEvent.AUTO_LAYOUT. Determines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. Determines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. Indicates the values of the x, y, width, and height properties of the target before the autoLayout event occurs. Event listeners can access this information through the LayoutEvent.oldBounds property. Indicates the values of the registrationX, registrationY, registrationWidth, and registrationHeight properties of the target before the autoLayout event occurs. Event listeners can access this information through the LayoutEvent.oldRegistrationBounds property. The index of the VideoPlayer object involved in this event."/>
<page href="fl/video/AutoLayoutEvent.html#AUTO_LAYOUT" title="AutoLayoutEvent.AUTO_LAYOUT" text="AUTO_LAYOUT Defines the value of the type property of an autoLayout event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. oldBoundsThe values of the x, y, width, and height properties of the target before the autoLayout event occurs. oldRegistrationBoundsThe values of the registrationX, registrationY, registrationWidth, and registrationHeight properties of the target before the autoLayout event occurs. vpThe index of the VideoPlayer object."/>
<page href="fl/video/AutoLayoutEvent.html#vp" title="AutoLayoutEvent.vp" text="vp The index of the VideoPlayer object involved in this event."/>
<page href="fl/video/AutoLayoutEvent.html#event:autoLayout" title="AutoLayoutEvent.autoLayout" text="autoLayout Defines the value of the type property of an autoLayout event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. oldBoundsThe values of the x, y, width, and height properties of the target before the autoLayout event occurs. oldRegistrationBoundsThe values of the registrationX, registrationY, registrationWidth, and registrationHeight properties of the target before the autoLayout event occurs. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoPlayer.html" title="VideoPlayer class" text="VideoPlayer The VideoPlayer class lets you create a video player with a slightly smaller SWF file than if you used the FLVPlayback component. Unlike the FLVPlayback component, the VideoPlayer class does not let you include a skin or playback controls, and although you cannot find or seek to cue points, the cuePoint events will occur. The FLVPlayback class wraps the VideoPlayer class. Use the FLVPlayback class in almost all cases because there is no functionality in the VideoPlayer class that cannot be accessed using the FLVPlayback class. In addition, the FLVPlayback class automatically interfaces with the NCManager class to access streaming FLV files on a video server, such as Flash Media Server. You interact with the NCManager class when you set the contentPath property and when you pass a URL to the play() and load() methods. If you use the VideoPlayer class by itself, however, you must include the following statement in your ActionScript code to make sure the NCManager class is included: var _forceNCManager:fl.video.NCManager; The NCManager class implements an interface, INCManager, and it can be replaced with a custom class for managing network communications that implements this interface. If you do that, you also need to include the following statement, replacing NCManager with the name of the class you have provided: fl.video.VideoPlayer.iNCManagerClass = fl.video.NCManager; You do not need to add this statement if you are using the default NCManager class. Note: You also can set iNCManagerClass to replace the default fl.video.NCManager when using the FLVPlayback component. To handle multiple streams for multiple bandwidths, NCManager supports a subset of SMIL."/>
<page href="fl/video/VideoPlayer.html#VideoPlayer()" title="VideoPlayer.VideoPlayer()" text="VideoPlayer Creates a VideoPlayer object with a specified width and height. width height The width of the video player in pixels. The height of the video player in pixels."/>
<page href="fl/video/VideoPlayer.html#close()" title="VideoPlayer.close()" text="close Forces the video stream and Flash Media Server connection to close. This method triggers the close event. You usually do not need to call this method directly, because the idle timeout functionality takes care of closing the stream."/>
<page href="fl/video/VideoPlayer.html#load()" title="VideoPlayer.load()" text="load Similar to the play() method, but causes the FLV file to load without playing. Autoresizing occurs if appropriate, and the first frame of the FLV file is shown. After initial loading and autolayout, the state is VideoState.PAUSED. This method takes the same parameters as the play() method, but you cannot call the load() method without a URL. If you do, an error is thrown. If the video player is in an unresponsive state, the load() method queues the request. url totalTime isLive A URL string for the FLV file that you want to load. If no value is passed for URL, an error is thrown with the message null URL sent to VideoPlayer.load. The length of an FLV file. Pass in 0, null, or undefined to automatically detect length from metadata, server, or XML. The value is true if you stream a live feed from Flash Media Server (FMS)."/>
<page href="fl/video/VideoPlayer.html#ncConnected()" title="VideoPlayer.ncConnected()" text="ncConnected Called by INCManager after the connection is complete or failed after a call to the INCManager.connectToURL() method. If the connection failed, set the INCManager.netConnection property to null or undefined before calling."/>
<page href="fl/video/VideoPlayer.html#ncReconnected()" title="VideoPlayer.ncReconnected()" text="ncReconnected Called by INCManager after the reconnection is complete or has failed after a call to the INCManager.reconnect() method. If the connection fails, set the INCManager.netconnection property to null before you call it."/>
<page href="fl/video/VideoPlayer.html#pause()" title="VideoPlayer.pause()" text="pause Pauses video playback. If video is paused or stopped, has no effect. To start playback again, call play(). Takes no parameters. If player is in an unresponsive state, the pause() method queues the request. Throws an exception if called when no stream is connected. Use the stateChange event and connected property to determine when it is safe to call this method. If the player is in a stopped state, a call to the pause() method has no effect and the player remains in a stopped state."/>
<page href="fl/video/VideoPlayer.html#play()" title="VideoPlayer.play()" text="play Causes the video to play. Can be called while the video is paused or stopped, or while the video is already playing. Call this method with no arguments to play an already loaded video or pass in a URL to load a new stream. If the player is in an unresponsive state, queues the request. Throws an exception if called with no arguments at a time when no stream is connected. Use the stateChange event and the connected property to determine when it is safe to call this method. url totalTime isLive Pass in a URL string if you want to load and play a new FLV file. If you have already loaded an FLV file and want to continue playing it, pass in null. Pass in the length of the FLV file. Pass in 0 or NaN to automatically detect the length from metadata, server, or XML. If the INCManager.streamLength property is not 0, null, or undefined when the ncConnected property is called, that value takes precedence over this one. Pass in true if streaming a live feed from Flash Media Server (FMS)."/>
<page href="fl/video/VideoPlayer.html#playWhenEnoughDownloaded()" title="VideoPlayer.playWhenEnoughDownloaded()" text="playWhenEnoughDownloaded Plays the FLV file when enough of it has downloaded. If the FLV file has downloaded or you are streaming from Flash Media Server (FMS), then calling the playWhenEnoughDownloaded() method is identical to the play() method with no parameters. Calling this method does not pause playback, so in many cases, you may want to call the pause() method before you call this method."/>
<page href="fl/video/VideoPlayer.html#seek()" title="VideoPlayer.seek()" text="seek Seeks to a given time in the file, specified in seconds, with a precision of three decimal places (milliseconds). If a video is playing, the video continues to play from that point. If a video is paused, the video seeks to that point and remains paused. If a video is stopped, the video seeks to that point and enters the paused state. Has no effect with live streams. The playheadTime property might not have the expected value immediately after you call one of the seek methods or set playheadTime to cause seeking. For a progressive download, you can seek only to a keyframe; therefore, a seek takes you to the time of the first keyframe after the specified time. Note: When streaming, a seek always goes to the precise specified time even if the source FLV file doesn't have a keyframe there. Seeking is asynchronous, so if you call a seek method or set the playheadTime property, playheadTime does not update immediately. To obtain the time after the seek is complete, listen for the seek event, which does not start until the playheadTime property is updated. Throws an exception if called when no stream is connected. Use the stateChange event and the connected property to determine when it is safe to call this method. time A number that specifies the time, in seconds, at which to place the playhead. If time is &lt; 0 or NaN."/>
<page href="fl/video/VideoPlayer.html#setScale()" title="VideoPlayer.setScale()" text="setScale Sets the scaleX and scaleY properties simultaneously. Setting the scaleX or scaleY individually triggers two autolayout events whereas calling the setScale() method causes only one autolayout event. If the scaleMode property is VideoScaleMode.MAINTAIN_ASPECT_RATIO or VideoScaleMode.NO_SCALE, calling this method causes an immediate autolayout event. scaleX scaleY A number that represents the horizontal scale. A number that represents the vertical scale."/>
<page href="fl/video/VideoPlayer.html#setSize()" title="VideoPlayer.setSize()" text="setSize Sets the width and height properties simultaneously. Setting the width or height individually triggers two autolayout events whereas calling the setSize() method causes only one autolayout event. If the scaleMode property is VideoScaleMode.MAINTAIN_ASPECT_RATIO or VideoScaleMode.NO_SCALE then calling this method triggers an immediate autolayout event. width height The width of the video player. The height of the video player."/>
<page href="fl/video/VideoPlayer.html#stop()" title="VideoPlayer.stop()" text="stop Stops video playback. If autoRewind is set to true, rewinds to first frame. If video is already stopped, has no effect. To start playback again, call play(). Takes no parameters. If player is in an unresponsive state, queues the request. Throws an exception if called when no stream is connected. Use the stateChange event and connected property to determine when it is safe to call this method."/>
<page href="fl/video/VideoPlayer.html#align" title="VideoPlayer.align" text="align Specifies how the video is displayed relative to the registrationX, registrationY, registrationWidth and registrationHeight properties. The align property does this autolayout when the scaleMode property is set to VideoScaleMode.MAINTAIN_ASPECT_RATIO or VideoScaleMode.NO_SCALE. Changing this property after an FLV file is loaded causes an automatic layout to start immediately. Values come from the VideoAlign class."/>
<page href="fl/video/VideoPlayer.html#autoRewind" title="VideoPlayer.autoRewind" text="autoRewind A Boolean value that, if true, causes the FLV file to rewind to Frame 1 when play stops, either because the player reached the end of the stream or the stop() method was called. This property is meaningless for live streams."/>
<page href="fl/video/VideoPlayer.html#bufferTime" title="VideoPlayer.bufferTime" text="bufferTime A number that specifies the number of seconds to buffer in memory before beginning to play a video stream. For FLV files streaming over RTMP, which are not downloaded and buffer only in memory, it can be important to increase this setting from the default value of 0.1. For a progressively downloaded FLV file over HTTP, there is little benefit to increasing this value although it could improve viewing a high-quality video on an older, slower computer. For prerecorded (not live) video, do not set the bufferTime property to 0; use the default buffer time or increase the buffer time. This property does not specify the amount of the FLV file to download before starting playback."/>
<page href="fl/video/VideoPlayer.html#bytesLoaded" title="VideoPlayer.bytesLoaded" text="bytesLoaded A number that indicates the extent of downloading, in number of bytes, for an HTTP download. Returns 0 when there is no stream, when the stream is from Flash Media Server (FMS), or if the information is not yet available. The returned value is useful only for an HTTP download."/>
<page href="fl/video/VideoPlayer.html#bytesTotal" title="VideoPlayer.bytesTotal" text="bytesTotal A number that specifies the total number of bytes downloaded for an HTTP download. Returns -1 when there is no stream, when the stream is from Flash Media Server (FMS), or if the information is not yet available. The returned value is useful only for an HTTP download."/>
<page href="fl/video/VideoPlayer.html#height" title="VideoPlayer.height" text="height A number that specifies the height of the VideoPlayer instance (in pixels). Note: Do not confuse this property with the flash.media.Video.height property which is similar to the fl.video.VideoPlayer.videoHeight property."/>
<page href="fl/video/VideoPlayer.html#idleTimeout" title="VideoPlayer.idleTimeout" text="idleTimeout The amount of time, in milliseconds, before Flash terminates an idle connection to a video server, such as Flash Media Server, because playing paused or stopped. This property has no effect on an FLV file downloading over HTTP. If this property is set when a video stream is already idle, it restarts the timeout period with the new value."/>
<page href="fl/video/VideoPlayer.html#iNCManagerClass" title="VideoPlayer.iNCManagerClass" text="iNCManagerClass To make all VideoPlayer objects use your custom class as the default INCManager implementation, set the iNCManagerClass property to the class object or string name of your custom class. The FLVPlayback class includes the definition of the custom class; the video player does not."/>
<page href="fl/video/VideoPlayer.html#isLive" title="VideoPlayer.isLive" text="isLive A Boolean value that is true if the video stream is live. This property is effective only when streaming from a video server, such as Flash Media Server or other Flash Video Streaming Service. The value of this property is ignored for an HTTP download. Set the isLive property to false when sending a prerecorded video stream to the video player and to true when sending real-time data such as a live broadcast. For better performance when you set the isLive property to false, do not set the bufferTime property to 0."/>
<page href="fl/video/VideoPlayer.html#isRTMP" title="VideoPlayer.isRTMP" text="isRTMP A Boolean value that is true if the FLV file is streaming from Flash Media Server (FMS) using RTMP. Its value is false for any other FLV file source."/>
<page href="fl/video/VideoPlayer.html#metadata" title="VideoPlayer.metadata" text="metadata An object that is a metadata information packet that is received from a call to the NetSteam.onMetaData() callback method, if available. Ready when the metadataReceived event is dispatched. If the FLV file is encoded with the Flash 8 encoder, the metadata property contains the following information. Older FLV files contain only the height, width, and duration values. ParameterDescription canSeekToEndA Boolean value that is true if the FLV file is encoded with a keyframe on the last frame that allows seeking to the end of a progressive download movie clip. It is false if the FLV file is not encoded with a keyframe on the last frame. cuePointsAn array of objects, one for each cue point embedded in the FLV file. Value is undefined if the FLV file does not contain any cue points. Each object has the following properties: type—A string that specifies the type of cue point as either &quot;navigation&quot; or &quot;event&quot;. name—A string that is the name of the cue point. time—A number that is the time of the cue point in seconds with a precision of three decimal places (milliseconds). parameters—An optional object that has name-value pairs that are designated by the user when creating the cue points. audiocodecidA number that indicates the audio codec (code/decode technique) that was used. audiodelay A number that represents time 0 in the source file from which the FLV file was encoded. Video content is delayed for the short period of time that is required to synchronize the audio. For example, if the audiodelay value is .038, the video that started at time 0 in the source file starts at time .038 in the FLV file. Note that the FLVPlayback and VideoPlayer classes compensate for this delay in their time settings. This means that you can continue to use the time settings that you used in your the source file. audiodatarateA number that is the kilobytes per second of audio. videocodecidA number that is the codec version that was used to encode the video. framerateA number that is the frame rate of the FLV file. videodatarateA number that is the video data rate of the FLV file. heightA number that is the height of the FLV file. widthA number that is the width of the FLV file. durationA number that specifies the duration of the FLV file in seconds."/>
<page href="fl/video/VideoPlayer.html#ncMgr" title="VideoPlayer.ncMgr" text="ncMgr An INCManager object that provides access to an instance of the class implementing INCManager, which is an interface to the NCManager class. You can use this property to implement a custom INCManager that requires custom initialization."/>
<page href="fl/video/VideoPlayer.html#netConnection" title="VideoPlayer.netConnection" text="netConnection Allows direct access to the NetConnection instance created by the video player."/>
<page href="fl/video/VideoPlayer.html#netStream" title="VideoPlayer.netStream" text="netStream Allows direct access to the NetStream instance created by the video player."/>
<page href="fl/video/VideoPlayer.html#netStreamClientClass" title="VideoPlayer.netStreamClientClass" text="netStreamClientClass Registers a custom class for the NetStream's client property. By default, fl.video.VideoPlayerClient is used; this class handles the onMetaData() and onCuePoint() messages. To add custom handling for other messages, such as onImageData() and onTextData(), you can create your own class and set this property to the class. The constructor for the class must take a VideoPlayer instance as its only parameter, and it must have a Boolean ready property. This property should be false while the Client is still waiting for any data messages expected at the beginning of the file. If the VideoPlayer does its resize autorewind before these messages are received, they may never be received. By default, fl.video.VideoPlayerClient will return true from the ready property as soon as onMetaData() is called. You can set the property to the class object itself (as in the example below) or the string name of the class: import fl.video. VideoPlayer.netStreamClientClass = MyCustomClient; Note that setting it to the string name of the class is not enough by itself to force the class to be compiled into the SWF. The default value is the class object fl.video.VideoPlayerClient, not the string name. It is strongly recommended that any custom implementation should subclass fl.video.VideoPlayer. To do otherwise risks breaking the metadata and cue point handling built into the VideoPlayer and the FLVPlayback component. Player Version: Flash Player 9 Update 3. If this property is set to an invalid value, VideoError.NETSTREAM_CLIENT_CLASS_UNSET will be thrown."/>
<page href="fl/video/VideoPlayer.html#playheadTime" title="VideoPlayer.playheadTime" text="playheadTime A number that is the current playhead time or position, measured in seconds, which can be a fractional value. Setting this property triggers a seek and has all the restrictions of a seek. When the playhead time changes, which includes once every .25 seconds while the FLV file plays, the component dispatches the playheadUpdate event. For several reasons, the playheadTime property might not have the expected value immediately after calling one of the seek methods or setting playheadTime to cause seeking. First, for a progressive download, you can seek only to a keyframe, so a seek takes you to the time of the first keyframe after the specified time. (When streaming, a seek always goes to the precise specified time even if the source FLV file doesn't have a keyframe there.) Second, seeking is asynchronous, so if you call a seek method or set the playheadTime property, playheadTime does not update immediately. To obtain the time after the seek is complete, listen for the seek event, which does not fire until the playheadTime property has updated."/>
<page href="fl/video/VideoPlayer.html#playheadUpdateInterval" title="VideoPlayer.playheadUpdateInterval" text="playheadUpdateInterval A number that is the amount of time, in milliseconds, between each playheadUpdate event. Setting this property while the FLV file is playing restarts the timer. Because ActionScript cue points start on playhead updates, lowering the value of the playheadUpdateInterval property can increase the accuracy of ActionScript cue points. Because the playhead update interval is set by a call to the global setInterval() method, the update cannot fire more frequently than the SWF file frame rate, as with any interval that is set this way. So, as an example, for the default frame rate of 12 frames per second, the lowest effective interval that you can create is approximately 83 milliseconds, or one second (1000 milliseconds) divided by 12."/>
<page href="fl/video/VideoPlayer.html#progressInterval" title="VideoPlayer.progressInterval" text="progressInterval A number that is the amount of time, in milliseconds, between each progress event. If you set this property while the video stream is playing, the timer restarts."/>
<page href="fl/video/VideoPlayer.html#registrationHeight" title="VideoPlayer.registrationHeight" text="registrationHeight The height used to align the video content when autoresizing. Do not confuse the registrationHeight property with the height property. The height property reflects the actual width of the video content. Example 1, load an 80x80 FLV file with the following settings: registrationX = 100 registrationY = 100 registrationWidth = 60 registrationHeight = 40 align = VideoAlign.CENTER scaleMode = VideoScaleMode.NO_SCALE Then, after automatic resizing, you get the following: x = 90 y = 80 width = 80 height = 80 Example 2, load the same scenario as example 1 but with the following settings: scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO You get the following: x = 110 y = 100 width = 40 height = 80 Example 3, load the same scenario as example 2 but with the following settings: scaleMode = VideoScaleMode.EXACT_FIT You get all the same values as the registration values: x = 100 y = 100 width = 60 height = 40 Setting the registrationHeight property is equivalent to setting the height property and vice versa. Setting any other property or calling any method that alters the height, such as scaleX, setSize, and setScale, setting keeps height and registrationHeight in sync."/>
<page href="fl/video/VideoPlayer.html#registrationWidth" title="VideoPlayer.registrationWidth" text="registrationWidth The width used to align the video content when autoresizing. Do not confuse the registrationWidth property with the width property. The width property reflects the actual width of the video content. Example 1, load an 80x80 FLV file with the following settings: registrationX = 100 registrationY = 100 registrationWidth = 60 registrationHeight = 40 align = VideoAlign.CENTER scaleMode = VideoScaleMode.NO_SCALE Then, after automatic resizing, you get the following: x = 90 y = 80 width = 80 height = 80 Example 2, load the same scenario as example 1 but with the following settings: scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO You get the following: x = 110 y = 100 width = 40 height = 80 Example 3, load the same scenario as example 2 but with the following settings: scaleMode = VideoScaleMode.EXACT_FIT You get all the same values as the registration values: x = 100 y = 100 width = 60 height = 40 Setting the registrationWidth property is equivalent to setting the width property and vice versa. Setting any other property or calling any method that alters the width, such as scaleX, setSize, and setScale, also keeps width and registrationWidth in sync."/>
<page href="fl/video/VideoPlayer.html#registrationX" title="VideoPlayer.registrationX" text="registrationX The x coordinate used to align the video content when autoresizing. Do not confuse with the x property, which reflects the actual location of the video content. Example 1, load an 80x80 FLV file with the following settings: registrationX = 100 registrationY = 100 registrationWidth = 60 registrationHeight = 40 align = VideoAlign.CENTER scaleMode = VideoScaleMode.NO_SCALE Then, after automatic resizing, you get the following: x = 90 y = 80 width = 80 height = 80 Example 2, load the same scenario as example 1 but with the following settings: scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO You get the following: x = 110 y = 100 width = 40 height = 80 Example 3, load the same scenario as example 2 but with the following settings: scaleMode = VideoScaleMode.EXACT_FIT You get all the same values as the registration values: x = 100 y = 100 width = 60 height = 40 When either the x or registrationX property is set, the second property is changed to maintain its offset from the first. For example, if x = 10 and registrationX = 20, setting x = 110 also sets registrationX = 120."/>
<page href="fl/video/VideoPlayer.html#registrationY" title="VideoPlayer.registrationY" text="registrationY The y coordinate used to align the video content when autoresizing. Do not confuse with the y property, which reflects the actual location of the video content. Example 1, load an 80x80 FLV file with the following settings: registrationX = 100 registrationY = 100 registrationWidth = 60 registrationHeight = 40 align = VideoAlign.CENTER scaleMode = VideoScaleMode.NO_SCALE Then, after automatic resizing, you get the following: x = 90 y = 80 width = 80 height = 80 Example 2, load the same scenario as example 1 but with the following settings: scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO You get the following: x = 110 y = 100 width = 40 height = 80 Example 3, load the same scenario as example 2 but with the following settings: scaleMode = VideoScaleMode.EXACT_FIT You get all the same values as the registration values: x = 100 y = 100 width = 60 height = 40 When either the y or registrationY property is set, the second property is changed to maintain its offset from the first. For example, if y = 10 and registrationY = 20, setting y = 110 also sets registrationY = 120."/>
<page href="fl/video/VideoPlayer.html#scaleMode" title="VideoPlayer.scaleMode" text="scaleMode Specifies how the video resizes after loading. If set to VideoScaleMode.MAINTAIN_ASPECT_RATIO, maintains the video aspect ratio within the rectangle defined by registrationX, registrationY, registrationWidth and registrationHeight. If set to VideoScaleMode.NO_SCALE, causes the video to size automatically to the dimensions of the source FLV file. If set to VideoScaleMode.EXACT_FIT, causes the dimensions of the source FLV file to be ignored and the video is stretched to fit the rectangle defined by registrationX, registrationY, registrationWidth and registrationHeight. If this is set after an FLV file has been loaded an automatic layout will start immediately. Values come from VideoScaleMode."/>
<page href="fl/video/VideoPlayer.html#scaleX" title="VideoPlayer.scaleX" text="scaleX A number that is the horizontal scale."/>
<page href="fl/video/VideoPlayer.html#scaleY" title="VideoPlayer.scaleY" text="scaleY A number that is the vertical scale."/>
<page href="fl/video/VideoPlayer.html#SHORT_VERSION" title="VideoPlayer.SHORT_VERSION" text="SHORT_VERSION State variable indicating the short version number of the component. The version number is useful when you have a FLA file and need to know the component version. To determine the component version, type the following code trace into the FLA file: FLVPlayback.SHORT_VERSION The SHORT_VERSION variable includes only the major and minor version numbers, for example, 2.0. The VERSION variable includes the major and minor version numbers as well as the revision and build numbers, for example, 2.0.0.11."/>
<page href="fl/video/VideoPlayer.html#soundTransform" title="VideoPlayer.soundTransform" text="soundTransform Provides direct access to the NetStream.soundTransform property to expose more sound control. Set the property to change the settings; use the getter accessor method of the property to retrieve the current settings."/>
<page href="fl/video/VideoPlayer.html#source" title="VideoPlayer.source" text="source A string that specifies the URL of the FLV file to stream and how to stream it. The URL can be an HTTP URL to an FLV file, an RTMP URL to a stream, or an HTTP URL to an XML file. If you set this property through the Component inspector or the Property inspector, the FLV file begins loading and playing at the next enterFrame event. The delay provides time to set the isLive, autoPlay, and cuePoints properties, among others, which affect loading. It also allows ActionScript that is placed on the first frame to affect the FLVPlayback component before it starts playing. If you set this property through ActionScript, it immediately calls the VideoPlayer.load() method when the autoPlay property is set to false. Alternatively, it calls the VideoPlayer.play() method when the autoPlay property is set to true. The autoPlay, totalTime, and isLive properties affect how the new FLV file is loaded, so if you set these properties, you must set them before setting the source property. Set the autoPlay property to false to prevent the new FLV file from playing automatically."/>
<page href="fl/video/VideoPlayer.html#state" title="VideoPlayer.state" text="state A string that specifies the state of the component. This property is set by the load(), play(), stop(), pause(), and seek() methods. The possible values for the state property are: buffering, connectionError, disconnected, loading, paused, playing, rewinding, seeking, and stopped. You can use the FLVPlayback class properties to test for these states."/>
<page href="fl/video/VideoPlayer.html#stateResponsive" title="VideoPlayer.stateResponsive" text="stateResponsive A Boolean value that is true if the state is responsive. If the state is unresponsive, calls to the play(), load(), stop(), pause(), and seek() methods are queued and executed later, when the state changes to a responsive one. Because these calls are queued and executed later, it is usually not necessary to track the value of the stateResponsive property. The responsive states are: stopped, playing, paused, and buffering."/>
<page href="fl/video/VideoPlayer.html#totalTime" title="VideoPlayer.totalTime" text="totalTime A number that is the total playing time for the video in seconds. When streaming from Flash Media Server (FMS) and using the default NCManager, this value is determined automatically by server-side application programming interfaces (APIs), and that value overrides anything set through this property or gathered from metadata. The property is ready for reading when the stopped or playing state is reached after setting the source property. This property is meaningless for live streams from an FMS. With an HTTP download, the value is determined automatically if the FLV file has metadata embedded; otherwise, set it explicitly, or it will be NaN. If you set it explicitly, the metadata value in the stream is ignored. When you set this property, the value takes effect for the next FLV file that is loaded by setting source. It has no effect on an FLV file that has already loaded. Also, this property does not return the new value passed in until an FLV file is loaded. Playback still works if this property is never set (either explicitly or automatically), but it can cause problems with seek controls. Unless set explicitly, the value will be NaN until it is set to a valid value from metadata."/>
<page href="fl/video/VideoPlayer.html#VERSION" title="VideoPlayer.VERSION" text="VERSION State variable indicating the long version number of the component. The version number is useful when you have a FLA file and need to know the component version. To determine the component version, type the following code trace into the FLA file: FLVPlayback.VERSION The VERSION variable includes the major and minor version numbers as well as the revision and build numbers, for example, 2.0.0.11. The SHORT_VERSION variable includes only the major and minor version numbers, for example, 2.0."/>
<page href="fl/video/VideoPlayer.html#videoHeight" title="VideoPlayer.videoHeight" text="videoHeight The source width of the loaded FLV file. This property returns -1 if no information is available yet."/>
<page href="fl/video/VideoPlayer.html#videoWidth" title="VideoPlayer.videoWidth" text="videoWidth The source width of the loaded FLV file. This property returns -1 if no information is available yet."/>
<page href="fl/video/VideoPlayer.html#visible" title="VideoPlayer.visible" text="visible A Boolean value that, if true, makes the VideoPlayer instance visible. If false, it makes the instance invisible."/>
<page href="fl/video/VideoPlayer.html#volume" title="VideoPlayer.volume" text="volume A number in the range of 0 to 1 that indicates the volume control setting."/>
<page href="fl/video/VideoPlayer.html#width" title="VideoPlayer.width" text="width A number that specifies the width of the VideoPlayer instance on the Stage. Note: The flash.media.Video.width property is similar to the fl.video.VideoPlayer.videoWidth property."/>
<page href="fl/video/VideoPlayer.html#x" title="VideoPlayer.x" text="x A number that specifies the horizontal position (in pixels) of the video player. Setting the x property also affects the registrationX property. When either the x or registrationX property is set, the second property is changed to maintain its offset from the first. For example, if x = 10 and registrationX = 20, setting x = 110 also sets registrationX = 120."/>
<page href="fl/video/VideoPlayer.html#y" title="VideoPlayer.y" text="y A number that specifies the vertical position (in pixels) of the video player. Setting the y property also affects the registrationY property. When either the y or registrationY property is set, the second property is changed to maintain its offset from the first. For example, if y = 10 and registrationY = 20, setting y = 110 also sets registrationY = 120."/>
<page href="fl/video/VideoPlayer.html#event:autoRewound" title="VideoPlayer.autoRewound" text="autoRewound Dispatched when the playhead is moved to the start of the video player because the autoRewind property is set to true. The autoRewound event is of type VideoEvent and has the constant VideoEvent.AUTO_REWOUND."/>
<page href="fl/video/VideoPlayer.html#event:close" title="VideoPlayer.close" text="close Dispatched by the VideoPlayer instance when it closes the NetConnection by timing out or through a call to the close() method, or when you call the load() or play() methods or set the source property and cause the RTMP connection to close as a result. The FLVPlayback instance dispatches this event only when streaming from Flash Media Server (FMS) or other Flash Video Streaming Service (FVSS). The close event is of type VideoEvent and has the constant VideoEvent.CLOSE."/>
<page href="fl/video/VideoPlayer.html#event:complete" title="VideoPlayer.complete" text="complete Dispatched when playing completes because the player reached the end of the FLV file. The component does not dispatch the event if you call the stop() or pause() methods or click the corresponding controls. When the application uses progressive download, it does not set the totalTime property explicitly, and it downloads an FLV file that does not specify the duration in the metadata. The video player sets the totalTime property to an approximate total value before it dispatches this event. The video player also dispatches the stateChange and stopped events. The complete event is of type VideoEvent and has the constant VideoEvent.COMPLETE."/>
<page href="fl/video/VideoPlayer.html#event:cuePoint" title="VideoPlayer.cuePoint" text="cuePoint Dispatched when a cue point is reached. The event object has an info property that contains the info object received by the NetStream.onCuePoint event callback for FLV file cue points. For ActionScript cue points, it contains the object that was passed into the ActionScript cue point methods or properties. The cuePoint event is of type MetadataEvent and has the constant MetadataEvent.CUE_POINT."/>
<page href="fl/video/VideoPlayer.html#event:layout" title="VideoPlayer.layout" text="layout Dispatched when the video player is resized or laid out. Here are two layout scenarios: If the video player is laid out by either using the autoLayout event or calling the setScale() or setSize() methods or changing the width, height, scaleX, and scaleY properties. If there are two video players of different sizes and the visibleVideoPlayerIndex property is switched from one video player to another. The layout event is of type LayoutEvent and has the constant LayoutEvent.LAYOUT."/>
<page href="fl/video/VideoPlayer.html#event:metadataReceived" title="VideoPlayer.metadataReceived" text="metadataReceived Dispatched the first time the FLV file's metadata is reached. The event object has an info property that contains the info object received by the NetStream.onMetaData event callback. The metadataReceived event is of type MetadataEvent and has the constant MetadataEvent.METADATA_RECEIVED."/>
<page href="fl/video/VideoPlayer.html#event:playheadUpdate" title="VideoPlayer.playheadUpdate" text="playheadUpdate Dispatched while the FLV file is playing at the frequency specified by the playheadUpdateInterval property or when rewinding starts. The component does not dispatch this event when the video player is paused or stopped unless a seek occurs. The playheadUpdate event is of type VideoEvent and has the constant VideoEvent.PLAYHEAD_UPDATE."/>
<page href="fl/video/VideoPlayer.html#event:progress" title="VideoPlayer.progress" text="progress Indicates progress made in number of bytes downloaded. Dispatched at the frequency specified by the progressInterval property, starting when the load begins and ending when all bytes are loaded or there is a network error. The default is every 0.25 seconds starting when load is called and ending when all bytes are loaded or if there is a network error. Use this event to check bytes loaded or number of bytes in the buffer. Dispatched only for a progressive HTTP download. Indicates progress in number of downloaded bytes. The event object has the bytesLoaded and bytesTotal properties, which are the same as the FLVPlayback properties of the same names. The progress event is of type VideoProgressEvent and has the constant VideoProgressEvent.PROGRESS."/>
<page href="fl/video/VideoPlayer.html#event:ready" title="VideoPlayer.ready" text="ready Event dispatched when an FLV file is loaded and ready to display. It starts the first time you enter a responsive state after you load a new FLV file with the play() or load() method. It starts only once for each FLV file that is loaded. The ready event is of type VideoEvent and has the constant VideoEvent.READY."/>
<page href="fl/video/VideoPlayer.html#event:stateChange" title="VideoPlayer.stateChange" text="stateChange Dispatched when the playback state changes. When an autoRewind call is completed the stateChange event is dispatched with the rewinding state. The stateChange event does not start until rewinding has completed. This event can be used to track when playback enters or leaves unresponsive states such as in the middle of connecting, resizing, or rewinding. The play(), pause(), stop() and seek() methods queue the requests to be executed when the player enters a responsive state. The stateChange event is of type VideoEvent and has the constant VideoEvent.STATE_CHANGE."/>
<page href="fl/video/SoundEvent.html" title="SoundEvent class" text="SoundEvent Flash® Player dispatches a SoundEvent object when the user changes the sound by either moving the handle of the volumeBar control or setting the volume or soundTransform property."/>
<page href="fl/video/SoundEvent.html#SoundEvent()" title="SoundEvent.SoundEvent()" text="SoundEvent Creates an Event object that contains information about sound events. Event objects are passed as parameters to event listeners. type bubbles cancelable soundTransform The type of the event. Event listeners can access this information through the inherited type property. There is only one type of sound event: SoundEvent.SOUND_UPDATE. Determines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. Determines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. Indicates new values for volume and panning."/>
<page href="fl/video/SoundEvent.html#SOUND_UPDATE" title="SoundEvent.SOUND_UPDATE" text="SOUND_UPDATE Defines the value of the type property of a soundUpdate event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. soundTransformIndicates new values for volume and panning."/>
<page href="fl/video/SoundEvent.html#soundTransform" title="SoundEvent.soundTransform" text="soundTransform Indicates new values for volume and panning."/>
<page href="fl/video/SoundEvent.html#event:soundUpdate" title="SoundEvent.soundUpdate" text="soundUpdate Defines the value of the type property of a soundUpdate event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. soundTransformIndicates new values for volume and panning."/>
<page href="fl/video/VideoProgressEvent.html" title="VideoProgressEvent class" text="VideoProgressEvent Flash® Player dispatches a VideoProgressEvent object when the user makes a request for the number of bytes loaded during a progressive HTTP download of their video."/>
<page href="fl/video/VideoProgressEvent.html#VideoProgressEvent()" title="VideoProgressEvent.VideoProgressEvent()" text="VideoProgressEvent Creates an Event object that contains information about progress events. Event objects are passed as parameters to event listeners. type bubbles cancelable bytesLoaded bytesTotal vp The type of the event. Event listeners can access this information through the inherited type property. There is only one type of progress event: VideoProgressEvent.PROGRESS. Determines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. Determines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. The number of items or bytes loaded at the time the listener processes the event. The total number of items or bytes that will be loaded if the loading process succeeds. Determines the index of the VideoPlayer object."/>
<page href="fl/video/VideoProgressEvent.html#PROGRESS" title="VideoProgressEvent.PROGRESS" text="PROGRESS Defines the value of the type property of a progress event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. bytesLoadedThe number of items or bytes loaded at the time the listener processes the event. bytesTotalThe total number of items or bytes that will be loaded if the loading process succeeds. vpThe index of the VideoPlayer object."/>
<page href="fl/video/VideoProgressEvent.html#vp" title="VideoProgressEvent.vp" text="vp The index of the VideoPlayer object involved in this event."/>
<page href="fl/video/VideoProgressEvent.html#event:progress" title="VideoProgressEvent.progress" text="progress Defines the value of the type property of a progress event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. bytesLoadedThe number of items or bytes loaded at the time the listener processes the event. bytesTotalThe total number of items or bytes that will be loaded if the loading process succeeds. vpThe index of the VideoPlayer object."/>
<page href="fl/video/NCManagerNative.html" title="NCManagerNative class" text="NCManagerNative The NCManagerNative class is a subclass of the NCManager class and supports native bandwidth detection, which some Flash Video Streaming Service providers may support. Check with your FVSS provider to see whether they support native bandwidth detection. Native bandwidth detection means that the bandwidth detection is built in to the streaming server and performs better. When an NCManagerNative object is used, the main.asc file is not required on the server. If bandwidth detection is not required, the NCManagerNative object allows connection to any version of the Flash Media Server (FMS) without the main.asc file. To use this instead of the default fl.video.NCManager, put the following code in Frame 1 of your FLA file: import fl.video.~~; VideoPlayer.iNCManagerClass = fl.video.NCManagerNative;"/>
<page href="fl/video/NCManagerNative.html#NCManagerNative()" title="NCManagerNative.NCManagerNative()" text="NCManagerNative Creates a new NCManagerNative instance."/>
<page href="fl/video/NCManagerNative.html#SHORT_VERSION" title="NCManagerNative.SHORT_VERSION" text="SHORT_VERSION State variable indicating the short version number of the component. The version number is useful when you have a FLA file and need to know the component version. To determine the component version, type the following code trace into the FLA file: FLVPlayback.SHORT_VERSION The SHORT_VERSION variable includes only the major and minor version numbers, for example, 2.0. The VERSION variable includes the major and minor version numbers as well as the revision and build numbers, for example, 2.0.0.11."/>
<page href="fl/video/NCManagerNative.html#streamLength" title="NCManagerNative.streamLength" text="streamLength Length of the stream, in milliseconds. After the VideoPlayer.ncConnected() method is called, if it returns undefined, null or less than 0, then the VideoPlayer object knows that there is no stream length information. If stream length information is returned, it overrides any existing steam length information including information set by the totalTime parameter of the VideoPlayer.play() method, the VideoPlayer.load() method or information received from the FLV file's metadata."/>
<page href="fl/video/NCManagerNative.html#VERSION" title="NCManagerNative.VERSION" text="VERSION State variable indicating the long version number of the component. The version number is useful when you have a FLA file and need to know the component version. To determine the component version, type the following code trace into the FLA file: FLVPlayback.VERSION The VERSION variable includes the major and minor version numbers as well as the revision and build numbers, for example, 2.0.0.11. The SHORT_VERSION variable includes only the major and minor version numbers, for example, 2.0."/>
<page href="fl/video/SkinErrorEvent.html" title="SkinErrorEvent class" text="SkinErrorEvent Flash® Player dispatches a SkinErrorEvent object when there is an error loading a skin. The ErrorEvent class is a subclass to this event, and so if not handled an error is thrown."/>
<page href="fl/video/SkinErrorEvent.html#SkinErrorEvent()" title="SkinErrorEvent.SkinErrorEvent()" text="SkinErrorEvent Creates an Event object that contains information about skinError events. Event objects are passed as parameters to event listeners. type bubbles cancelable text The type of the event. Event listeners can access this information through the inherited type property. There is only one type of skinError event: SkinErrorEvent.SKIN_ERROR. Determines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. Determines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. The error message text."/>
<page href="fl/video/SkinErrorEvent.html#SKIN_ERROR" title="SkinErrorEvent.SKIN_ERROR" text="SKIN_ERROR Defines the value of the type property of a skinError event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. textThe error message."/>
<page href="fl/video/SkinErrorEvent.html#event:skinError" title="SkinErrorEvent.skinError" text="skinError Defines the value of the type property of a skinError event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. textThe error message."/>
<page href="fl/events/ScrollEvent.html" title="ScrollEvent class" text="ScrollEvent The ScrollEvent class defines the scroll event that is associated with the ScrollBar component."/>
<page href="fl/events/ScrollEvent.html#ScrollEvent()" title="ScrollEvent.ScrollEvent()" text="ScrollEvent Creates a new ScrollEvent object with the specified parameters. direction delta position The direction of movement associated with the event. A value of ScrollBarDirection.HORIZONTAL indicates horizontal movement; a value of ScrollBarDirection.VERTICAL indicates vertical movement. The change in scroll position, in pixels. A positive value indicates that the direction of the scroll was down or to the right. A negative value indicates that the direction of the scroll was up or to the left. The current scroll position."/>
<page href="fl/events/ScrollEvent.html#clone()" title="ScrollEvent.clone()" text="clone Creates a copy of the ScrollEvent object and sets the value of each parameter to match the original."/>
<page href="fl/events/ScrollEvent.html#toString()" title="ScrollEvent.toString()" text="toString Returns a string that contains all the properties of the ScrollEvent object. The string has the following format: [ScrollEvent type=value bubbles=value cancelable=value direction=value delta=value position=value]"/>
<page href="fl/events/ScrollEvent.html#delta" title="ScrollEvent.delta" text="delta Gets the size of the change in scroll position, in pixels. A positive value indicates that the direction of the scroll was down or to the right. A negative value indicates that the direction of the scroll was up or to the left."/>
<page href="fl/events/ScrollEvent.html#direction" title="ScrollEvent.direction" text="direction Gets a constant value that indicates the direction of movement associated with the event. A value of ScrollBarDirection.HORIZONTAL indicates horizontal movement; a value of ScrollBarDirection.VERTICAL indicates vertical movement."/>
<page href="fl/events/ScrollEvent.html#position" title="ScrollEvent.position" text="position Gets the current scroll position, in pixels."/>
<page href="fl/events/ScrollEvent.html#SCROLL" title="ScrollEvent.SCROLL" text="SCROLL Defines the value of the type property of a scroll event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the event object with an event listener. delta1; a value that indicates how much scrolling was done. directionvertical; the direction of the ScrollBar. position0; the position of the Scrollbar thumb after it was moved. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event. The following example listens for the scroll event and uses the direction property of the ScrollEvent class to determine if the content was scrolled horizontally or vertically: import fl.containers.ScrollPane; import fl.events.ScrollEvent; import fl.controls.ScrollBarDirection; var myScrollPane:ScrollPane = new ScrollPane(); myScrollPane.scrollDrag = true; myScrollPane.source = &quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;; myScrollPane.addEventListener(ScrollEvent.SCROLL, scrollHandler); addChild(myScrollPane); function scrollHandler(event:ScrollEvent):void { switch (event.direction) { case ScrollBarDirection.HORIZONTAL: trace(&quot;horizontal scroll&quot;, event.position, &quot;of&quot;, event.currentTarget.maxHorizontalScrollPosition); break; case ScrollBarDirection.VERTICAL: trace(&quot;vertical scroll&quot;, event.position, &quot;of&quot;, event.currentTarget.maxVerticalScrollPosition); break; } }"/>
<page href="fl/events/ScrollEvent.html#event:scroll" title="ScrollEvent.scroll" text="scroll Defines the value of the type property of a scroll event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the event object with an event listener. delta1; a value that indicates how much scrolling was done. directionvertical; the direction of the ScrollBar. position0; the position of the Scrollbar thumb after it was moved. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event. The following example listens for the scroll event and uses the direction property of the ScrollEvent class to determine if the content was scrolled horizontally or vertically: import fl.containers.ScrollPane; import fl.events.ScrollEvent; import fl.controls.ScrollBarDirection; var myScrollPane:ScrollPane = new ScrollPane(); myScrollPane.scrollDrag = true; myScrollPane.source = &quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;; myScrollPane.addEventListener(ScrollEvent.SCROLL, scrollHandler); addChild(myScrollPane); function scrollHandler(event:ScrollEvent):void { switch (event.direction) { case ScrollBarDirection.HORIZONTAL: trace(&quot;horizontal scroll&quot;, event.position, &quot;of&quot;, event.currentTarget.maxHorizontalScrollPosition); break; case ScrollBarDirection.VERTICAL: trace(&quot;vertical scroll&quot;, event.position, &quot;of&quot;, event.currentTarget.maxVerticalScrollPosition); break; } }"/>
<page href="fl/events/ColorPickerEvent.html" title="ColorPickerEvent class" text="ColorPickerEvent The ColorPickerEvent class defines events that are associated with the ColorPicker component. These include the following events: ColorPickerEvent.CHANGE: dispatched when a user clicks a different color in the ColorPicker component. ColorPickerEvent.ENTER: dispatched when a user presses the Enter key after entering a value in the text field of the ColorPicker component. ColorPickerEvent.ITEM_ROLL_OUT: dispatched when the device pointer moves out of a color cell in the ColorPicker component. ColorPickerEvent.ITEM_ROLL_OVER: dispatched when the device pointer moves over a color cell in the ColorPicker component."/>
<page href="fl/events/ColorPickerEvent.html#ColorPickerEvent()" title="ColorPickerEvent.ColorPickerEvent()" text="ColorPickerEvent Creates a new ColorPickerEvent object. type color Indicates the current event type. Indicates the color that is associated with the current event."/>
<page href="fl/events/ColorPickerEvent.html#clone()" title="ColorPickerEvent.clone()" text="clone Creates a copy of the ColorPickerEvent object and sets the value of each parameter to match the original."/>
<page href="fl/events/ColorPickerEvent.html#toString()" title="ColorPickerEvent.toString()" text="toString Returns a string that contains all the properties of the ColorPickerEvent object."/>
<page href="fl/events/ColorPickerEvent.html#CHANGE" title="ColorPickerEvent.CHANGE" text="CHANGE Defines the value of the type property of the change event object. This event has the following properties: PropertyValue bubblestrue cancelabletrue colorThe current color value of the ColorPicker component. currentTargetThe object that is actively processing the event object with an event listener. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event. The following example displays the selected color's hexadecimal value when the color is changed: import fl.controls.ColorPicker; import fl.events.ColorPickerEvent; var myColorPicker:ColorPicker = new ColorPicker(); myColorPicker.addEventListener(ColorPickerEvent.CHANGE, changeHandler); myColorPicker.move(10, 10); addChild(myColorPicker); function changeHandler(event:ColorPickerEvent):void { trace(&quot;color changed:&quot;, event.color, &quot;(#&quot; + event.target.hexValue + &quot;)&quot;); }"/>
<page href="fl/events/ColorPickerEvent.html#color" title="ColorPickerEvent.color" text="color Gets the color value that is associated with the event."/>
<page href="fl/events/ColorPickerEvent.html#ENTER" title="ColorPickerEvent.ENTER" text="ENTER Defines the value of the type property of an enter event object. This event has the following properties: PropertyValue bubblestrue cancelabletrue colorThe current color value of the ColorPicker component. currentTargetThe object that is actively processing the event object with an event listener. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/ColorPickerEvent.html#ITEM_ROLL_OUT" title="ColorPickerEvent.ITEM_ROLL_OUT" text="ITEM_ROLL_OUT Defines the value of the type property for an itemRollOut event object. This event has the following properties: PropertyValue bubblestrue cancelabletrue colorThe current color value of the ColorPicker component. currentTargetThe object that is actively processing the event object with an event listener. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/ColorPickerEvent.html#ITEM_ROLL_OVER" title="ColorPickerEvent.ITEM_ROLL_OVER" text="ITEM_ROLL_OVER Defines the value of the type property for an itemRollOver event object. This event has the following properties: PropertyValue bubblestrue cancelabletrue colorThe current color value of the ColorPicker component. currentTargetThe object that is actively processing the event object with an event listener. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/ColorPickerEvent.html#event:change" title="ColorPickerEvent.change" text="change Defines the value of the type property of the change event object. This event has the following properties: PropertyValue bubblestrue cancelabletrue colorThe current color value of the ColorPicker component. currentTargetThe object that is actively processing the event object with an event listener. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event. The following example displays the selected color's hexadecimal value when the color is changed: import fl.controls.ColorPicker; import fl.events.ColorPickerEvent; var myColorPicker:ColorPicker = new ColorPicker(); myColorPicker.addEventListener(ColorPickerEvent.CHANGE, changeHandler); myColorPicker.move(10, 10); addChild(myColorPicker); function changeHandler(event:ColorPickerEvent):void { trace(&quot;color changed:&quot;, event.color, &quot;(#&quot; + event.target.hexValue + &quot;)&quot;); }"/>
<page href="fl/events/ColorPickerEvent.html#event:enter" title="ColorPickerEvent.enter" text="enter Defines the value of the type property of an enter event object. This event has the following properties: PropertyValue bubblestrue cancelabletrue colorThe current color value of the ColorPicker component. currentTargetThe object that is actively processing the event object with an event listener. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/ColorPickerEvent.html#event:itemRollOut" title="ColorPickerEvent.itemRollOut" text="itemRollOut Defines the value of the type property for an itemRollOut event object. This event has the following properties: PropertyValue bubblestrue cancelabletrue colorThe current color value of the ColorPicker component. currentTargetThe object that is actively processing the event object with an event listener. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/ColorPickerEvent.html#event:itemRollOver" title="ColorPickerEvent.itemRollOver" text="itemRollOver Defines the value of the type property for an itemRollOver event object. This event has the following properties: PropertyValue bubblestrue cancelabletrue colorThe current color value of the ColorPicker component. currentTargetThe object that is actively processing the event object with an event listener. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/ListEvent.html" title="ListEvent class" text="ListEvent The ListEvent class defines events for list-based components including the List, DataGrid, TileList, and ComboBox components. These events include the following: ListEvent.ITEM_CLICK: dispatched after the user clicks the mouse over an item in the component. ListEvent.ITEM_DOUBLE_CLICK: dispatched after the user clicks the mouse twice in rapid succession over an item in the component. ListEvent.ITEM_ROLL_OUT: dispatched after the user rolls the mouse pointer out of an item in the component. ListEvent.ITEM_ROLL_OVER: dispatched after the user rolls the mouse pointer over an item in the component."/>
<page href="fl/events/ListEvent.html#ListEvent()" title="ListEvent.ListEvent()" text="ListEvent Creates a new ListEvent object with the specified parameters. type bubbles cancelable columnIndex rowIndex index item The event type; this value identifies the action that caused the event. Indicates whether the event can bubble up the display list hierarchy. Indicates whether the behavior associated with the event can be prevented. The zero-based index of the column that contains the renderer or visual representation of the data in the column. The zero-based index of the row that contains the renderer or visual representation of the data in the row. The zero-based index of the item in the DataProvider. A reference to the data that belongs to the renderer."/>
<page href="fl/events/ListEvent.html#clone()" title="ListEvent.clone()" text="clone Creates a copy of the ListEvent object and sets the value of each parameter to match the original."/>
<page href="fl/events/ListEvent.html#toString()" title="ListEvent.toString()" text="toString Returns a string that contains all the properties of the ListEvent object. The string is in the following format: [ListEvent type=value bubbles=value cancelable=value columnIndex=value rowIndex=value]"/>
<page href="fl/events/ListEvent.html#columnIndex" title="ListEvent.columnIndex" text="columnIndex Gets the column index of the item that is associated with this event."/>
<page href="fl/events/ListEvent.html#index" title="ListEvent.index" text="index Gets the zero-based index of the cell that contains the renderer."/>
<page href="fl/events/ListEvent.html#item" title="ListEvent.item" text="item Gets the data that belongs to the current cell renderer."/>
<page href="fl/events/ListEvent.html#ITEM_CLICK" title="ListEvent.ITEM_CLICK" text="ITEM_CLICK Defines the value of the type property of an itemClick event object. This event has the following properties: PropertyValue bubblesfalse cancelabletrue columnIndexThe zero-based index of the column that contains the renderer. currentTargetThe object that is actively processing the event object with an event listener. indexThe zero-based index in the DataProvider that contains the renderer. itemA reference to the data that belongs to the renderer. rowIndexThe zero-based index of the row that contains the renderer. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/ListEvent.html#ITEM_DOUBLE_CLICK" title="ListEvent.ITEM_DOUBLE_CLICK" text="ITEM_DOUBLE_CLICK Defines the value of the type property of an itemDoubleClick event object. This event has the following properties: PropertyValue bubblesfalse cancelabletrue columnIndexThe zero-based index of the column that contains the renderer. currentTargetThe object that is actively processing the event object with an event listener. indexThe zero-based index in the DataProvider that contains the renderer. itemA reference to the data that belongs to the renderer. rowIndexThe zero-based index of the row that contains the renderer. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/ListEvent.html#ITEM_ROLL_OUT" title="ListEvent.ITEM_ROLL_OUT" text="ITEM_ROLL_OUT Defines the value of the type property of an itemRollOut event object. This event has the following properties: Property Value bubbles false cancelablefalse; there is no default behavior to cancel. columnIndexThe zero-based index of the column that contains the renderer. currentTargetThe object that is actively processing the event object with an event listener. indexThe zero-based index in the DataProvider that contains the renderer. itemA reference to the data that belongs to the renderer. rowIndexThe zero-based index of the row that contains the renderer. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/ListEvent.html#ITEM_ROLL_OVER" title="ListEvent.ITEM_ROLL_OVER" text="ITEM_ROLL_OVER Defines the value of the type property of an itemRollOver event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. columnIndexThe zero-based index of the column that contains the renderer. currentTargetThe object that is actively processing the event object with an event listener. indexThe zero-based index in the DataProvider that contains the renderer. itemA reference to the data that belongs to the renderer. rowIndexThe zero-based index of the row that contains the renderer. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/ListEvent.html#rowIndex" title="ListEvent.rowIndex" text="rowIndex Gets the row index of the item that is associated with this event."/>
<page href="fl/events/ListEvent.html#event:itemClick" title="ListEvent.itemClick" text="itemClick Defines the value of the type property of an itemClick event object. This event has the following properties: PropertyValue bubblesfalse cancelabletrue columnIndexThe zero-based index of the column that contains the renderer. currentTargetThe object that is actively processing the event object with an event listener. indexThe zero-based index in the DataProvider that contains the renderer. itemA reference to the data that belongs to the renderer. rowIndexThe zero-based index of the row that contains the renderer. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/ListEvent.html#event:itemDoubleClick" title="ListEvent.itemDoubleClick" text="itemDoubleClick Defines the value of the type property of an itemDoubleClick event object. This event has the following properties: PropertyValue bubblesfalse cancelabletrue columnIndexThe zero-based index of the column that contains the renderer. currentTargetThe object that is actively processing the event object with an event listener. indexThe zero-based index in the DataProvider that contains the renderer. itemA reference to the data that belongs to the renderer. rowIndexThe zero-based index of the row that contains the renderer. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/ListEvent.html#event:itemRollOut" title="ListEvent.itemRollOut" text="itemRollOut Defines the value of the type property of an itemRollOut event object. This event has the following properties: Property Value bubbles false cancelablefalse; there is no default behavior to cancel. columnIndexThe zero-based index of the column that contains the renderer. currentTargetThe object that is actively processing the event object with an event listener. indexThe zero-based index in the DataProvider that contains the renderer. itemA reference to the data that belongs to the renderer. rowIndexThe zero-based index of the row that contains the renderer. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/ListEvent.html#event:itemRollOver" title="ListEvent.itemRollOver" text="itemRollOver Defines the value of the type property of an itemRollOver event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. columnIndexThe zero-based index of the column that contains the renderer. currentTargetThe object that is actively processing the event object with an event listener. indexThe zero-based index in the DataProvider that contains the renderer. itemA reference to the data that belongs to the renderer. rowIndexThe zero-based index of the row that contains the renderer. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/ComponentEvent.html" title="ComponentEvent class" text="ComponentEvent The ComponentEvent class defines events that are associated with the UIComponent class. These include the following events: ComponentEvent.BUTTON_DOWN: dispatched after a button is pressed. ComponentEvent.ENTER: dispatched after the Enter key is pressed. ComponentEvent.HIDE: dispatched after the visible property of a component is set to false. ComponentEvent.LABEL_CHANGE: dispatched after the Enter key is pressed. ComponentEvent.MOVE: dispatched after there is a change in the x or y properties that identify the component location. ComponentEvent.RESIZE: dispatched after a component is resized. ComponentEvent.SHOW: dispatched after the visible property of a component is set to true."/>
<page href="fl/events/ComponentEvent.html#ComponentEvent()" title="ComponentEvent.ComponentEvent()" text="ComponentEvent Creates a new ComponentEvent object that contains information about a component event. A ComponentEvent object is passed as a parameter to an event listener. type bubbles cancelable The type of the event. Event listeners can access this information through the type property of the event object. A component can have the following types of events: ComponentEvent.BUTTON_DOWN, ComponentEvent.ENTER, ComponentEvent.HIDE, ComponentEvent.LABEL_CHANGE, ComponentEvent.MOVE, ComponentEvent.RESIZE, ComponentEvent.SHOW. Determines whether the ComponentEvent object participates in the bubbling phase of the event flow. Event listeners can access this information through the bubbles property of the event object. Determines whether the ComponentEvent object can be canceled. Event listeners can access this information through the cancelable property of the event object."/>
<page href="fl/events/ComponentEvent.html#clone()" title="ComponentEvent.clone()" text="clone Creates a copy of the ComponentEvent object and sets the value of each parameter to match the original."/>
<page href="fl/events/ComponentEvent.html#toString()" title="ComponentEvent.toString()" text="toString Returns a string that contains all the properties of the ComponentEvent object. The string is in the following format: [ComponentEvent type=value bubbles=value cancelable=value]"/>
<page href="fl/events/ComponentEvent.html#BUTTON_DOWN" title="ComponentEvent.BUTTON_DOWN" text="BUTTON_DOWN Defines the value of the type property of a buttonDown event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the event object with an event listener. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/ComponentEvent.html#ENTER" title="ComponentEvent.ENTER" text="ENTER Defines the value of the type property of an enter event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the event object with an event listener. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/ComponentEvent.html#HIDE" title="ComponentEvent.HIDE" text="HIDE Defines the value of the type property of a hide event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the event object with an event listener. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event. The following example creates a Button component that toggles a List component's visibility: import fl.controls.Button; import fl.controls.List; import fl.events.ComponentEvent; import fl.events.ListEvent; var toggleButton:Button = new Button(); toggleButton.label = &quot;toggle visibility&quot;; toggleButton.toggle = true; toggleButton.selected = true; toggleButton.emphasized = toggleButton.selected; toggleButton.addEventListener(Event.CHANGE, changeHandler); toggleButton.width = 150; toggleButton.move(10, 10); addChild(toggleButton); var myList:List = new List(); myList.addItem({label:&quot;Item 1&quot;}); myList.addItem({label:&quot;Item 2&quot;}); myList.addItem({label:&quot;Item 3&quot;}); myList.addItem({label:&quot;Item 4&quot;}); myList.addItem({label:&quot;Item 5&quot;}); myList.move(10, 40); myList.addEventListener(ComponentEvent.HIDE, hideHandler); myList.addEventListener(ComponentEvent.SHOW, showHandler); myList.addEventListener(ListEvent.ITEM_ROLL_OVER, itemRollOverHandler); myList.addEventListener(ListEvent.ITEM_ROLL_OUT, itemRollOverHandler); addChild(myList); function changeHandler(event:Event):void { toggleButton.emphasized = toggleButton.selected; myList.visible = toggleButton.selected; } function hideHandler(event:ComponentEvent):void { trace(&quot;hiding list&quot;); myList.removeEventListener(ListEvent.ITEM_ROLL_OVER, itemRollOverHandler); myList.removeEventListener(ListEvent.ITEM_ROLL_OUT, itemRollOverHandler); } function showHandler(event:ComponentEvent):void { trace(&quot;showing list&quot;); myList.addEventListener(ListEvent.ITEM_ROLL_OVER, itemRollOverHandler); myList.addEventListener(ListEvent.ITEM_ROLL_OUT, itemRollOverHandler); } function itemRollOverHandler(event:ListEvent):void { trace(event.type + &quot;:&quot;, event.item.label); } function itemRollOutHandler(event:ListEvent):void { trace(event.type + &quot;:&quot;, event.item.label); }"/>
<page href="fl/events/ComponentEvent.html#LABEL_CHANGE" title="ComponentEvent.LABEL_CHANGE" text="LABEL_CHANGE Defines the value of the type property of a labelChange event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the event object with an event listener. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/ComponentEvent.html#MOVE" title="ComponentEvent.MOVE" text="MOVE Defines the value of the type property of a move event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the event object with an event listener. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event. The following example repositions a UILoader component instance on the Stage based on the value of a Slider component: import fl.controls.Slider; import fl.containers.UILoader; import fl.events.ComponentEvent; import fl.events.SliderEvent; var myUILoader:UILoader = new UILoader(); myUILoader.source = &quot;http://www.helpexamples.com/flash/images/image3.jpg&quot;; myUILoader.move(10, 20); myUILoader.addEventListener(ComponentEvent.MOVE, moveHandler); addChild(myUILoader); var mySlider:Slider = new Slider(); mySlider.liveDragging = true; mySlider.minimum = myUILoader.x; mySlider.maximum = myUILoader.x + 200; mySlider.snapInterval = 1; mySlider.tickInterval = 10; mySlider.move(10, 10); mySlider.addEventListener(SliderEvent.CHANGE, changeHandler); addChild(mySlider); function changeHandler(event:SliderEvent):void { myUILoader.x = event.value; } function moveHandler(event:ComponentEvent):void { trace(&quot;[move] x:&quot; + event.currentTarget.x + &quot;, y:&quot; + event.currentTarget.y); }"/>
<page href="fl/events/ComponentEvent.html#RESIZE" title="ComponentEvent.RESIZE" text="RESIZE Defines the value of the type property of a resize event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the event object with an event listener. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event. The following example loads an external image into a UILoader component instance and centers it on the Stage using the resize event and move() method: import fl.containers.UILoader; import fl.events.ComponentEvent; var myUILoader:UILoader = new UILoader(); myUILoader.scaleContent = false; myUILoader.addEventListener(ComponentEvent.RESIZE, resizeHandler); myUILoader.source = &quot;http://www.helpexamples.com/flash/images/image3.jpg&quot;; addChild(myUILoader); function resizeHandler(event:ComponentEvent):void { var myImg:UILoader = event.currentTarget as UILoader; var newX:uint = (stage.stageWidth - myImg.width) / 2; var newY:uint = (stage.stageHeight - myImg.height) / 2; myImg.move(newX, newY); }"/>
<page href="fl/events/ComponentEvent.html#SHOW" title="ComponentEvent.SHOW" text="SHOW Defines the value of the type property of a show event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the event object with an event listener. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event. The following example creates a Button component that toggles a List component's visibility: import fl.controls.Button; import fl.controls.List; import fl.events.ComponentEvent; import fl.events.ListEvent; var toggleButton:Button = new Button(); toggleButton.label = &quot;toggle visibility&quot;; toggleButton.toggle = true; toggleButton.selected = true; toggleButton.emphasized = toggleButton.selected; toggleButton.addEventListener(Event.CHANGE, changeHandler); toggleButton.width = 150; toggleButton.move(10, 10); addChild(toggleButton); var myList:List = new List(); myList.addItem({label:&quot;Item 1&quot;}); myList.addItem({label:&quot;Item 2&quot;}); myList.addItem({label:&quot;Item 3&quot;}); myList.addItem({label:&quot;Item 4&quot;}); myList.addItem({label:&quot;Item 5&quot;}); myList.move(10, 40); myList.addEventListener(ComponentEvent.HIDE, hideHandler); myList.addEventListener(ComponentEvent.SHOW, showHandler); myList.addEventListener(ListEvent.ITEM_ROLL_OVER, itemRollOverHandler); myList.addEventListener(ListEvent.ITEM_ROLL_OUT, itemRollOverHandler); addChild(myList); function changeHandler(event:Event):void { toggleButton.emphasized = toggleButton.selected; myList.visible = toggleButton.selected; } function hideHandler(event:ComponentEvent):void { trace(&quot;hiding list&quot;); myList.removeEventListener(ListEvent.ITEM_ROLL_OVER, itemRollOverHandler); myList.removeEventListener(ListEvent.ITEM_ROLL_OUT, itemRollOverHandler); } function showHandler(event:ComponentEvent):void { trace(&quot;showing list&quot;); myList.addEventListener(ListEvent.ITEM_ROLL_OVER, itemRollOverHandler); myList.addEventListener(ListEvent.ITEM_ROLL_OUT, itemRollOverHandler); } function itemRollOverHandler(event:ListEvent):void { trace(event.type + &quot;:&quot;, event.item.label); } function itemRollOutHandler(event:ListEvent):void { trace(event.type + &quot;:&quot;, event.item.label); }"/>
<page href="fl/events/ComponentEvent.html#event:buttonDown" title="ComponentEvent.buttonDown" text="buttonDown Defines the value of the type property of a buttonDown event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the event object with an event listener. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/ComponentEvent.html#event:enter" title="ComponentEvent.enter" text="enter Defines the value of the type property of an enter event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the event object with an event listener. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/ComponentEvent.html#event:hide" title="ComponentEvent.hide" text="hide Defines the value of the type property of a hide event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the event object with an event listener. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event. The following example creates a Button component that toggles a List component's visibility: import fl.controls.Button; import fl.controls.List; import fl.events.ComponentEvent; import fl.events.ListEvent; var toggleButton:Button = new Button(); toggleButton.label = &quot;toggle visibility&quot;; toggleButton.toggle = true; toggleButton.selected = true; toggleButton.emphasized = toggleButton.selected; toggleButton.addEventListener(Event.CHANGE, changeHandler); toggleButton.width = 150; toggleButton.move(10, 10); addChild(toggleButton); var myList:List = new List(); myList.addItem({label:&quot;Item 1&quot;}); myList.addItem({label:&quot;Item 2&quot;}); myList.addItem({label:&quot;Item 3&quot;}); myList.addItem({label:&quot;Item 4&quot;}); myList.addItem({label:&quot;Item 5&quot;}); myList.move(10, 40); myList.addEventListener(ComponentEvent.HIDE, hideHandler); myList.addEventListener(ComponentEvent.SHOW, showHandler); myList.addEventListener(ListEvent.ITEM_ROLL_OVER, itemRollOverHandler); myList.addEventListener(ListEvent.ITEM_ROLL_OUT, itemRollOverHandler); addChild(myList); function changeHandler(event:Event):void { toggleButton.emphasized = toggleButton.selected; myList.visible = toggleButton.selected; } function hideHandler(event:ComponentEvent):void { trace(&quot;hiding list&quot;); myList.removeEventListener(ListEvent.ITEM_ROLL_OVER, itemRollOverHandler); myList.removeEventListener(ListEvent.ITEM_ROLL_OUT, itemRollOverHandler); } function showHandler(event:ComponentEvent):void { trace(&quot;showing list&quot;); myList.addEventListener(ListEvent.ITEM_ROLL_OVER, itemRollOverHandler); myList.addEventListener(ListEvent.ITEM_ROLL_OUT, itemRollOverHandler); } function itemRollOverHandler(event:ListEvent):void { trace(event.type + &quot;:&quot;, event.item.label); } function itemRollOutHandler(event:ListEvent):void { trace(event.type + &quot;:&quot;, event.item.label); }"/>
<page href="fl/events/ComponentEvent.html#event:labelChange" title="ComponentEvent.labelChange" text="labelChange Defines the value of the type property of a labelChange event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the event object with an event listener. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/ComponentEvent.html#event:move" title="ComponentEvent.move" text="move Defines the value of the type property of a move event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the event object with an event listener. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event. The following example repositions a UILoader component instance on the Stage based on the value of a Slider component: import fl.controls.Slider; import fl.containers.UILoader; import fl.events.ComponentEvent; import fl.events.SliderEvent; var myUILoader:UILoader = new UILoader(); myUILoader.source = &quot;http://www.helpexamples.com/flash/images/image3.jpg&quot;; myUILoader.move(10, 20); myUILoader.addEventListener(ComponentEvent.MOVE, moveHandler); addChild(myUILoader); var mySlider:Slider = new Slider(); mySlider.liveDragging = true; mySlider.minimum = myUILoader.x; mySlider.maximum = myUILoader.x + 200; mySlider.snapInterval = 1; mySlider.tickInterval = 10; mySlider.move(10, 10); mySlider.addEventListener(SliderEvent.CHANGE, changeHandler); addChild(mySlider); function changeHandler(event:SliderEvent):void { myUILoader.x = event.value; } function moveHandler(event:ComponentEvent):void { trace(&quot;[move] x:&quot; + event.currentTarget.x + &quot;, y:&quot; + event.currentTarget.y); }"/>
<page href="fl/events/ComponentEvent.html#event:resize" title="ComponentEvent.resize" text="resize Defines the value of the type property of a resize event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the event object with an event listener. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event. The following example loads an external image into a UILoader component instance and centers it on the Stage using the resize event and move() method: import fl.containers.UILoader; import fl.events.ComponentEvent; var myUILoader:UILoader = new UILoader(); myUILoader.scaleContent = false; myUILoader.addEventListener(ComponentEvent.RESIZE, resizeHandler); myUILoader.source = &quot;http://www.helpexamples.com/flash/images/image3.jpg&quot;; addChild(myUILoader); function resizeHandler(event:ComponentEvent):void { var myImg:UILoader = event.currentTarget as UILoader; var newX:uint = (stage.stageWidth - myImg.width) / 2; var newY:uint = (stage.stageHeight - myImg.height) / 2; myImg.move(newX, newY); }"/>
<page href="fl/events/ComponentEvent.html#event:show" title="ComponentEvent.show" text="show Defines the value of the type property of a show event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the event object with an event listener. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event. The following example creates a Button component that toggles a List component's visibility: import fl.controls.Button; import fl.controls.List; import fl.events.ComponentEvent; import fl.events.ListEvent; var toggleButton:Button = new Button(); toggleButton.label = &quot;toggle visibility&quot;; toggleButton.toggle = true; toggleButton.selected = true; toggleButton.emphasized = toggleButton.selected; toggleButton.addEventListener(Event.CHANGE, changeHandler); toggleButton.width = 150; toggleButton.move(10, 10); addChild(toggleButton); var myList:List = new List(); myList.addItem({label:&quot;Item 1&quot;}); myList.addItem({label:&quot;Item 2&quot;}); myList.addItem({label:&quot;Item 3&quot;}); myList.addItem({label:&quot;Item 4&quot;}); myList.addItem({label:&quot;Item 5&quot;}); myList.move(10, 40); myList.addEventListener(ComponentEvent.HIDE, hideHandler); myList.addEventListener(ComponentEvent.SHOW, showHandler); myList.addEventListener(ListEvent.ITEM_ROLL_OVER, itemRollOverHandler); myList.addEventListener(ListEvent.ITEM_ROLL_OUT, itemRollOverHandler); addChild(myList); function changeHandler(event:Event):void { toggleButton.emphasized = toggleButton.selected; myList.visible = toggleButton.selected; } function hideHandler(event:ComponentEvent):void { trace(&quot;hiding list&quot;); myList.removeEventListener(ListEvent.ITEM_ROLL_OVER, itemRollOverHandler); myList.removeEventListener(ListEvent.ITEM_ROLL_OUT, itemRollOverHandler); } function showHandler(event:ComponentEvent):void { trace(&quot;showing list&quot;); myList.addEventListener(ListEvent.ITEM_ROLL_OVER, itemRollOverHandler); myList.addEventListener(ListEvent.ITEM_ROLL_OUT, itemRollOverHandler); } function itemRollOverHandler(event:ListEvent):void { trace(event.type + &quot;:&quot;, event.item.label); } function itemRollOutHandler(event:ListEvent):void { trace(event.type + &quot;:&quot;, event.item.label); }"/>
<page href="fl/events/DataChangeEvent.html" title="DataChangeEvent class" text="DataChangeEvent The DataChangeEvent class defines the event that is dispatched when the data that is associated with a component changes. This event is used by the List, DataGrid, TileList, and ComboBox components. This class provides the following event: DataChangeEvent.DATA_CHANGE: dispatched when the component data changes."/>
<page href="fl/events/DataChangeEvent.html#DataChangeEvent()" title="DataChangeEvent.DataChangeEvent()" text="DataChangeEvent Creates a new DataChangeEvent object with the specified parameters. eventType changeType items startIndex endIndex The type of change event. The type of change that was made. The DataChangeType class defines the possible values for this parameter. A list of items that were changed. The index of the first item that was changed. The index of the last item that was changed."/>
<page href="fl/events/DataChangeEvent.html#clone()" title="DataChangeEvent.clone()" text="clone Creates a copy of the DataEvent object and sets the value of each parameter to match that of the original."/>
<page href="fl/events/DataChangeEvent.html#toString()" title="DataChangeEvent.toString()" text="toString Returns a string that contains all the properties of the DataChangeEvent object. The string is in the following format: [DataChangeEvent type=value changeType=value startIndex=value endIndex=value bubbles=value cancelable=value]"/>
<page href="fl/events/DataChangeEvent.html#changeType" title="DataChangeEvent.changeType" text="changeType Gets the type of the change that triggered the event. The DataChangeType class defines the possible values for this property."/>
<page href="fl/events/DataChangeEvent.html#DATA_CHANGE" title="DataChangeEvent.DATA_CHANGE" text="DATA_CHANGE Defines the value of the type property of a dataChange event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. changeTypeIdentifies the type of change that was made. currentTargetThe object that is actively processing the event object with an event listener. endIndexIdentifies the index of the last changed item. itemsAn array that lists the items that were changed. startIndexIdentifies the index of the first changed item. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/DataChangeEvent.html#endIndex" title="DataChangeEvent.endIndex" text="endIndex Gets the index of the last changed item in the array of items that were changed."/>
<page href="fl/events/DataChangeEvent.html#items" title="DataChangeEvent.items" text="items Gets an array that contains the changed items."/>
<page href="fl/events/DataChangeEvent.html#PRE_DATA_CHANGE" title="DataChangeEvent.PRE_DATA_CHANGE" text="PRE_DATA_CHANGE Defines the value of the type property of a preDataChange event object. This event object is dispatched before a change is made to component data. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. changeTypeIdentifies the type of change to be made. currentTargetThe object that is actively processing the event object with an event listener. endIndexIdentifies the index of the last item to be changed. itemsAn array that lists the items to be changed. startIndexIdentifies the index of the first item to be changed. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/DataChangeEvent.html#startIndex" title="DataChangeEvent.startIndex" text="startIndex Gets the index of the first changed item in the array of items that were changed."/>
<page href="fl/events/DataChangeEvent.html#event:dataChange" title="DataChangeEvent.dataChange" text="dataChange Defines the value of the type property of a dataChange event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. changeTypeIdentifies the type of change that was made. currentTargetThe object that is actively processing the event object with an event listener. endIndexIdentifies the index of the last changed item. itemsAn array that lists the items that were changed. startIndexIdentifies the index of the first changed item. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/DataChangeEvent.html#event:preDataChange" title="DataChangeEvent.preDataChange" text="preDataChange Defines the value of the type property of a preDataChange event object. This event object is dispatched before a change is made to component data. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. changeTypeIdentifies the type of change to be made. currentTargetThe object that is actively processing the event object with an event listener. endIndexIdentifies the index of the last item to be changed. itemsAn array that lists the items to be changed. startIndexIdentifies the index of the first item to be changed. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/SliderEvent.html" title="SliderEvent class" text="SliderEvent The SliderEvent class defines events that are associated with the Slider component. These include the following: SliderEvent.CHANGE: dispatched after there is a change in the position of the slider. SliderEvent.THUMB_DRAG: dispatched when a user drags the thumb of the slider. SliderEvent.THUMB_PRESS: dispatched when a user presses the thumb of the slider. SliderEvent.THUMB_RELEASE: dispatched when the user releases the thumb of the slider."/>
<page href="fl/events/SliderEvent.html#SliderEvent()" title="SliderEvent.SliderEvent()" text="SliderEvent Creates a new SliderEvent object with the specified parameters. type value clickTarget triggerEvent keyCode The event type; this value identifies the action that triggered the event. The new value of the slider. Indicates whether a slider thumb or the slider track was pressed. A value of SliderEventClickTarget.THUMB indicates that the slider thumb was pressed; a value of SliderEventClickTarget.TRACK indicates that the slider track was pressed. A String that indicates the source of the input. A value of InteractionInputType.MOUSE indicates that the mouse was the source of input; a value of InteractionInputType.KEYBOARD indicates that the keyboard was the source of input. If the event was triggered by a key press, this value is the key code that identifies that key."/>
<page href="fl/events/SliderEvent.html#clone()" title="SliderEvent.clone()" text="clone Creates a copy of the SliderEvent object and sets the value of each parameter to match the original."/>
<page href="fl/events/SliderEvent.html#toString()" title="SliderEvent.toString()" text="toString Returns a string that contains all the properties of the SliderEvent object. The string is in the following format: [SliderEvent type=value value=value bubbles=value cancelable=value keycode=value triggerEvent=value clickTarget=value]"/>
<page href="fl/events/SliderEvent.html#CHANGE" title="SliderEvent.CHANGE" text="CHANGE Defines the value of the type property of a change event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. clickTargetIdentifies whether the slider track or a slider thumb was pressed. currentTargetThe object that is actively processing the event object with an event listener. keyCodeIf the event was triggered by a key press, the code for the key that was pressed. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event. triggerEventThe type of device that triggered the event. A value of InteractionInputType.MOUSE indicates that a mouse was the source of input; a value of InteractionInputType.KEYBOARD indicates that a keyboard was the source of input. valueThe value of the slider after the event."/>
<page href="fl/events/SliderEvent.html#clickTarget" title="SliderEvent.clickTarget" text="clickTarget Gets a string that indicates whether the slider thumb or a slider track was pressed. A value of SliderEventClickTarget.THUMB indicates that the slider thumb was pressed; a value of SliderEventClickTarget.TRACK indicates that the slider track was pressed."/>
<page href="fl/events/SliderEvent.html#keyCode" title="SliderEvent.keyCode" text="keyCode Gets the key code for the key that was pressed to trigger the event. A key code is a numeric value that identifies the key that was pressed."/>
<page href="fl/events/SliderEvent.html#THUMB_DRAG" title="SliderEvent.THUMB_DRAG" text="THUMB_DRAG Defines the value of the type property of a thumbDrag event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. clickTargetIdentifies whether the slider track or a slider thumb was pressed. currentTargetThe object that is actively processing the event object with an event listener. keyCodeIf the event was triggered by a key press, the code for the key that was pressed. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event. triggerEventThe type of device that triggered the event. A value of InteractionInputType.MOUSE indicates that a mouse was the source of the input; a value of InteractionInputType.KEYBOARD indicates that a keyboard was the source of the input. valueThe value of the slider after the event."/>
<page href="fl/events/SliderEvent.html#THUMB_PRESS" title="SliderEvent.THUMB_PRESS" text="THUMB_PRESS Defines the value of the type property of a thumbPress event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. clickTargetIdentifies whether the slider track or a slider thumb was pressed. currentTargetThe object that is actively processing the event object with an event listener. keyCodeIf the event was triggered by a key press, the code for the key that was pressed. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event. triggerEventThe type of device that triggered the event. A value of InteractionInputType.MOUSE indicates that a mouse was the source of the input; a value of InteractionInputType.KEYBOARD indicates that a keyboard was the source of the input. valueThe value of the slider after the event."/>
<page href="fl/events/SliderEvent.html#THUMB_RELEASE" title="SliderEvent.THUMB_RELEASE" text="THUMB_RELEASE Defines the value of the type property of a thumbRelease event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. clickTargetIdentifies whether the slider track or a slider thumb was pressed. currentTargetThe object that is actively processing the event object with an event listener. keyCodeIf the event was triggered by a key press, the code for the key that was pressed. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event. triggerEventThe type of device that triggered the event. A value of InteractionInputType.MOUSE indicates that a mouse was the source of the input; a value of InteractionInputType.KEYBOARD indicates that a keyboard was the source of the input. valueThe value of the slider after the event."/>
<page href="fl/events/SliderEvent.html#triggerEvent" title="SliderEvent.triggerEvent" text="triggerEvent Gets the type of device that was used to send the input. A value of InteractionInputType.MOUSE indicates that a mouse was the source of the input; a value of InteractionInputType.KEYBOARD indicates that a keyboard was the source of the input."/>
<page href="fl/events/SliderEvent.html#value" title="SliderEvent.value" text="value Gets the new value of the slider, based on its position."/>
<page href="fl/events/SliderEvent.html#event:change" title="SliderEvent.change" text="change Defines the value of the type property of a change event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. clickTargetIdentifies whether the slider track or a slider thumb was pressed. currentTargetThe object that is actively processing the event object with an event listener. keyCodeIf the event was triggered by a key press, the code for the key that was pressed. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event. triggerEventThe type of device that triggered the event. A value of InteractionInputType.MOUSE indicates that a mouse was the source of input; a value of InteractionInputType.KEYBOARD indicates that a keyboard was the source of input. valueThe value of the slider after the event."/>
<page href="fl/events/SliderEvent.html#event:thumbDrag" title="SliderEvent.thumbDrag" text="thumbDrag Defines the value of the type property of a thumbDrag event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. clickTargetIdentifies whether the slider track or a slider thumb was pressed. currentTargetThe object that is actively processing the event object with an event listener. keyCodeIf the event was triggered by a key press, the code for the key that was pressed. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event. triggerEventThe type of device that triggered the event. A value of InteractionInputType.MOUSE indicates that a mouse was the source of the input; a value of InteractionInputType.KEYBOARD indicates that a keyboard was the source of the input. valueThe value of the slider after the event."/>
<page href="fl/events/SliderEvent.html#event:thumbPress" title="SliderEvent.thumbPress" text="thumbPress Defines the value of the type property of a thumbPress event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. clickTargetIdentifies whether the slider track or a slider thumb was pressed. currentTargetThe object that is actively processing the event object with an event listener. keyCodeIf the event was triggered by a key press, the code for the key that was pressed. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event. triggerEventThe type of device that triggered the event. A value of InteractionInputType.MOUSE indicates that a mouse was the source of the input; a value of InteractionInputType.KEYBOARD indicates that a keyboard was the source of the input. valueThe value of the slider after the event."/>
<page href="fl/events/SliderEvent.html#event:thumbRelease" title="SliderEvent.thumbRelease" text="thumbRelease Defines the value of the type property of a thumbRelease event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. clickTargetIdentifies whether the slider track or a slider thumb was pressed. currentTargetThe object that is actively processing the event object with an event listener. keyCodeIf the event was triggered by a key press, the code for the key that was pressed. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event. triggerEventThe type of device that triggered the event. A value of InteractionInputType.MOUSE indicates that a mouse was the source of the input; a value of InteractionInputType.KEYBOARD indicates that a keyboard was the source of the input. valueThe value of the slider after the event."/>
<page href="fl/events/DataGridEvent.html" title="DataGridEvent class" text="DataGridEvent The DataGridEvent class defines events that are associated with the DataGrid component. These include the following events: DataGridEvent.COLUMN_STRETCH: dispatched after a user resizes a column horizontally. DataGridEvent.HEADER_RELEASE: dispatched after the user presses and releases the mouse on a column header. DataGridEvent.ITEM_EDIT_BEGIN: dispatched when an item is ready to be edited. DataGridEvent.ITEM_EDIT_BEGINNING: dispatched after the user is prepared to edit an item; this is indicated, for example, by the user releasing the mouse button when the mouse is over the item. DataGridEvent.ITEM_EDIT_END: dispatched when an edit session is ending. DataGridEvent.ITEM_FOCUS_IN: dispatched after an item receives focus. DataGridEvent.ITEM_FOCUS_OUT: dispatched after an item loses focus."/>
<page href="fl/events/DataGridEvent.html#DataGridEvent()" title="DataGridEvent.DataGridEvent()" text="DataGridEvent Creates a new DataGridEvent object with the specified parameters. type bubbles cancelable columnIndex rowIndex itemRenderer dataField reason The event type; this value indicates the action that caused the event. Indicates whether the event can bubble up the display list hierarchy. Indicates whether the behavior associated with the event can be prevented. The zero-based index of the column that contains the renderer. The zero-based index of the row that contains the renderer. The item renderer for the item that is being edited or the header render that is being clicked or stretched. The name of the field or property in the data associated with the column. The reason the itemEditEnd event was dispatched."/>
<page href="fl/events/DataGridEvent.html#clone()" title="DataGridEvent.clone()" text="clone Creates a copy of the DataGridEvent object and sets the value of each property to match the original."/>
<page href="fl/events/DataGridEvent.html#toString()" title="DataGridEvent.toString()" text="toString Returns a string that contains all the properties of the DataGridEvent object. The string is in the following format: [DataGridEvent type=value bubbles=value cancelable=value columnIndex=value rowIndex=value itemRenderer=value dataField=value reason=value]"/>
<page href="fl/events/DataGridEvent.html#COLUMN_STRETCH" title="DataGridEvent.COLUMN_STRETCH" text="COLUMN_STRETCH The DataGridEvent.COLUMN_STRETCH constant defines the value of the type property of a columnStretch event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. columnIndexThe zero-based index of the header column in the columns array of the DataGrid object. currentTargetThe object that is actively processing the event object with an event listener. dataFieldThe name of the field or property in the data associated with the column of the item. itemRendererThe header renderer for the column that was stretched. reasonnull rowIndexThe zero-based index of the item in the data provider. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event. The following example creates a DataGrid component and listens for its columnStretch event: import fl.controls.DataGrid; import fl.controls.dataGridClasses.DataGridColumn; import fl.data.DataProvider; import fl.events.DataGridEvent; var dp:DataProvider = new DataProvider(); dp.addItem({col1:&quot;item 1.A&quot;, col2:&quot;item 1.B&quot;, col3:&quot;item 1.C&quot;}); dp.addItem({col1:&quot;item 2.A&quot;, col2:&quot;item 2.B&quot;, col3:&quot;item 2.C&quot;}); dp.addItem({col1:&quot;item 3.A&quot;, col2:&quot;item 3.B&quot;, col3:&quot;item 3.C&quot;}); dp.addItem({col1:&quot;item 4.A&quot;, col2:&quot;item 4.B&quot;, col3:&quot;item 4.C&quot;}); var myDataGrid:DataGrid = new DataGrid(); myDataGrid.addColumn(&quot;col1&quot;); myDataGrid.addColumn(&quot;col2&quot;); myDataGrid.addColumn(&quot;col3&quot;); myDataGrid.dataProvider = dp; myDataGrid.setSize(300, 200); myDataGrid.move(10, 10); myDataGrid.addEventListener(DataGridEvent.COLUMN_STRETCH, columnStretchHandler); addChild(myDataGrid); function columnStretchHandler(event:DataGridEvent):void { var dg:DataGrid = event.target as DataGrid; var column:DataGridColumn; var columnArray:Array = dg.columns; var dgColWidth:String; trace(&quot;resized column:&quot;, event.dataField); trace(&quot;columnIndex:&quot;, event.columnIndex); for each (column in columnArray) { dgColWidth = Number(column.width / dg.width * 100).toFixed(1); trace(column.dataField + &quot;.width:&quot;, column.width + &quot; pixels (&quot; + dgColWidth + &quot;%)&quot;); } trace(&quot;----------&quot;); }"/>
<page href="fl/events/DataGridEvent.html#dataField" title="DataGridEvent.dataField" text="dataField Gets or sets the name of the field or property in the data associated with the column."/>
<page href="fl/events/DataGridEvent.html#HEADER_RELEASE" title="DataGridEvent.HEADER_RELEASE" text="HEADER_RELEASE The DataGridEvent.HEADER_RELEASE constant defines the value of the type property of a headerRelease event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. columnIndexThe zero-based index of the header column in the columns array of the DataGrid object. currentTargetThe object that is actively processing the event object with an event listener. dataFieldThe name of the field or property in the data associated with the column of the item. itemRendererThe header renderer that was clicked. reasonnull rowIndex-1 targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event. The following example creates a DataGrid component instance and listens for its headerRelease event: import fl.controls.DataGrid; import fl.controls.dataGridClasses.DataGridColumn; import fl.data.DataProvider; import fl.events.DataGridEvent; var dp:DataProvider = new DataProvider(); dp.addItem({col1:&quot;item 1.A&quot;, col2:&quot;item 1.B&quot;, col3:&quot;item 1.C&quot;}); dp.addItem({col1:&quot;item 2.A&quot;, col2:&quot;item 2.B&quot;, col3:&quot;item 2.C&quot;}); dp.addItem({col1:&quot;item 3.A&quot;, col2:&quot;item 3.B&quot;, col3:&quot;item 3.C&quot;}); dp.addItem({col1:&quot;item 4.A&quot;, col2:&quot;item 4.B&quot;, col3:&quot;item 4.C&quot;}); var myDataGrid:DataGrid = new DataGrid(); myDataGrid.addColumn(&quot;col1&quot;); myDataGrid.addColumn(&quot;col2&quot;); myDataGrid.addColumn(&quot;col3&quot;); myDataGrid.dataProvider = dp; myDataGrid.setSize(300, 200); myDataGrid.move(10, 10); myDataGrid.addEventListener(DataGridEvent.HEADER_RELEASE, headerReleaseHandler); addChild(myDataGrid); function headerReleaseHandler(event:DataGridEvent):void { var dg:DataGrid = event.target as DataGrid; trace(&quot;dataField:&quot;, event.dataField, &quot;(columnIndex:&quot; + event.columnIndex + &quot;)&quot;); trace(&quot;sortIndex:&quot;, dg.sortIndex); trace(&quot;sortDescending:&quot;, dg.sortDescending); trace(&quot;----------&quot;); }"/>
<page href="fl/events/DataGridEvent.html#ITEM_EDIT_BEGIN" title="DataGridEvent.ITEM_EDIT_BEGIN" text="ITEM_EDIT_BEGIN The DataGridEvent.ITEM_EDIT_BEGIN constant defines the value of the type property of an itemEditBegin event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. columnIndexThe zero-based index of the header column in the columns array of the DataGrid object. currentTargetThe object that is actively processing the event object with an event listener. dataFieldnull itemRendererThe item renderer for the item to be edited. reasonnull rowIndexThe zero-based index of the item in the data provider. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/DataGridEvent.html#ITEM_EDIT_BEGINNING" title="DataGridEvent.ITEM_EDIT_BEGINNING" text="ITEM_EDIT_BEGINNING The DataGridEvent.ITEM__EDIT_BEGINNING constant defines the value of the type property of an itemEditBeginning event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. columnIndexThe zero-based index of the header column in the columns array of the DataGrid object. currentTargetThe object that is actively processing the event object with an event listener. dataFieldThe name of the field or property in the data associated with the column of the item. itemRendererThe item renderer for the item to be edited. reasonnull rowIndexThe zero-based index of the item in the data provider. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/DataGridEvent.html#ITEM_EDIT_END" title="DataGridEvent.ITEM_EDIT_END" text="ITEM_EDIT_END The DataGridEvent.ITEM_EDIT_END constant defines the value of the type property of an itemEditEnd event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. columnIndexThe zero-based index of the header column in the columns array of the DataGrid object. currentTargetThe object that is actively processing the event object with an event listener. dataFieldThe name of the field or property in the data associated with the column of the item. itemRendererThe item renderer for the item to be edited. reasonA constant defining the reason for the event. The value must be a member of the DataGridEventReason class. rowIndexThe zero-based index of the item in the data provider. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/DataGridEvent.html#ITEM_FOCUS_IN" title="DataGridEvent.ITEM_FOCUS_IN" text="ITEM_FOCUS_IN The DataGridEvent.ITEM_FOCUS_IN constant defines the value of the type property of a itemFocusIn event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. columnIndexThe zero-based index of the header column in the columns array of the DataGrid object. currentTargetThe object that is actively processing the event object with an event listener. dataFieldnull itemRendererThe item renderer for the item to be edited. reasonnull rowIndexThe zero-based index of the item in the data provider. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/DataGridEvent.html#ITEM_FOCUS_OUT" title="DataGridEvent.ITEM_FOCUS_OUT" text="ITEM_FOCUS_OUT The DataGridEvent.ITEM_FOCUS_OUT constant defines the value of the type property of an itemFocusOut event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. columnIndexThe zero-based index of the header column in the columns array of the DataGrid object. currentTargetThe object that is actively processing the event object with an event listener. dataFieldnull itemRendererThe item renderer for the item to be edited. reasonnull rowIndexThe zero-based index of the item in the data provider. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/DataGridEvent.html#itemRenderer" title="DataGridEvent.itemRenderer" text="itemRenderer Gets the item renderer for the item that is being edited or the header renderer that is being clicked or resized."/>
<page href="fl/events/DataGridEvent.html#reason" title="DataGridEvent.reason" text="reason Gets the reason the itemEditEnd event was dispatched. This property is only valid for events of type DataGridEvent.ITEM_EDIT_END. The possible values are defined in the DataGridEventReason class."/>
<page href="fl/events/DataGridEvent.html#event:columnStretch" title="DataGridEvent.columnStretch" text="columnStretch The DataGridEvent.COLUMN_STRETCH constant defines the value of the type property of a columnStretch event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. columnIndexThe zero-based index of the header column in the columns array of the DataGrid object. currentTargetThe object that is actively processing the event object with an event listener. dataFieldThe name of the field or property in the data associated with the column of the item. itemRendererThe header renderer for the column that was stretched. reasonnull rowIndexThe zero-based index of the item in the data provider. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event. The following example creates a DataGrid component and listens for its columnStretch event: import fl.controls.DataGrid; import fl.controls.dataGridClasses.DataGridColumn; import fl.data.DataProvider; import fl.events.DataGridEvent; var dp:DataProvider = new DataProvider(); dp.addItem({col1:&quot;item 1.A&quot;, col2:&quot;item 1.B&quot;, col3:&quot;item 1.C&quot;}); dp.addItem({col1:&quot;item 2.A&quot;, col2:&quot;item 2.B&quot;, col3:&quot;item 2.C&quot;}); dp.addItem({col1:&quot;item 3.A&quot;, col2:&quot;item 3.B&quot;, col3:&quot;item 3.C&quot;}); dp.addItem({col1:&quot;item 4.A&quot;, col2:&quot;item 4.B&quot;, col3:&quot;item 4.C&quot;}); var myDataGrid:DataGrid = new DataGrid(); myDataGrid.addColumn(&quot;col1&quot;); myDataGrid.addColumn(&quot;col2&quot;); myDataGrid.addColumn(&quot;col3&quot;); myDataGrid.dataProvider = dp; myDataGrid.setSize(300, 200); myDataGrid.move(10, 10); myDataGrid.addEventListener(DataGridEvent.COLUMN_STRETCH, columnStretchHandler); addChild(myDataGrid); function columnStretchHandler(event:DataGridEvent):void { var dg:DataGrid = event.target as DataGrid; var column:DataGridColumn; var columnArray:Array = dg.columns; var dgColWidth:String; trace(&quot;resized column:&quot;, event.dataField); trace(&quot;columnIndex:&quot;, event.columnIndex); for each (column in columnArray) { dgColWidth = Number(column.width / dg.width * 100).toFixed(1); trace(column.dataField + &quot;.width:&quot;, column.width + &quot; pixels (&quot; + dgColWidth + &quot;%)&quot;); } trace(&quot;----------&quot;); }"/>
<page href="fl/events/DataGridEvent.html#event:headerRelease" title="DataGridEvent.headerRelease" text="headerRelease The DataGridEvent.HEADER_RELEASE constant defines the value of the type property of a headerRelease event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. columnIndexThe zero-based index of the header column in the columns array of the DataGrid object. currentTargetThe object that is actively processing the event object with an event listener. dataFieldThe name of the field or property in the data associated with the column of the item. itemRendererThe header renderer that was clicked. reasonnull rowIndex-1 targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event. The following example creates a DataGrid component instance and listens for its headerRelease event: import fl.controls.DataGrid; import fl.controls.dataGridClasses.DataGridColumn; import fl.data.DataProvider; import fl.events.DataGridEvent; var dp:DataProvider = new DataProvider(); dp.addItem({col1:&quot;item 1.A&quot;, col2:&quot;item 1.B&quot;, col3:&quot;item 1.C&quot;}); dp.addItem({col1:&quot;item 2.A&quot;, col2:&quot;item 2.B&quot;, col3:&quot;item 2.C&quot;}); dp.addItem({col1:&quot;item 3.A&quot;, col2:&quot;item 3.B&quot;, col3:&quot;item 3.C&quot;}); dp.addItem({col1:&quot;item 4.A&quot;, col2:&quot;item 4.B&quot;, col3:&quot;item 4.C&quot;}); var myDataGrid:DataGrid = new DataGrid(); myDataGrid.addColumn(&quot;col1&quot;); myDataGrid.addColumn(&quot;col2&quot;); myDataGrid.addColumn(&quot;col3&quot;); myDataGrid.dataProvider = dp; myDataGrid.setSize(300, 200); myDataGrid.move(10, 10); myDataGrid.addEventListener(DataGridEvent.HEADER_RELEASE, headerReleaseHandler); addChild(myDataGrid); function headerReleaseHandler(event:DataGridEvent):void { var dg:DataGrid = event.target as DataGrid; trace(&quot;dataField:&quot;, event.dataField, &quot;(columnIndex:&quot; + event.columnIndex + &quot;)&quot;); trace(&quot;sortIndex:&quot;, dg.sortIndex); trace(&quot;sortDescending:&quot;, dg.sortDescending); trace(&quot;----------&quot;); }"/>
<page href="fl/events/DataGridEvent.html#event:itemEditBegin" title="DataGridEvent.itemEditBegin" text="itemEditBegin The DataGridEvent.ITEM_EDIT_BEGIN constant defines the value of the type property of an itemEditBegin event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. columnIndexThe zero-based index of the header column in the columns array of the DataGrid object. currentTargetThe object that is actively processing the event object with an event listener. dataFieldnull itemRendererThe item renderer for the item to be edited. reasonnull rowIndexThe zero-based index of the item in the data provider. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/DataGridEvent.html#event:itemEditBeginning" title="DataGridEvent.itemEditBeginning" text="itemEditBeginning The DataGridEvent.ITEM__EDIT_BEGINNING constant defines the value of the type property of an itemEditBeginning event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. columnIndexThe zero-based index of the header column in the columns array of the DataGrid object. currentTargetThe object that is actively processing the event object with an event listener. dataFieldThe name of the field or property in the data associated with the column of the item. itemRendererThe item renderer for the item to be edited. reasonnull rowIndexThe zero-based index of the item in the data provider. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/DataGridEvent.html#event:itemEditEnd" title="DataGridEvent.itemEditEnd" text="itemEditEnd The DataGridEvent.ITEM_EDIT_END constant defines the value of the type property of an itemEditEnd event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. columnIndexThe zero-based index of the header column in the columns array of the DataGrid object. currentTargetThe object that is actively processing the event object with an event listener. dataFieldThe name of the field or property in the data associated with the column of the item. itemRendererThe item renderer for the item to be edited. reasonA constant defining the reason for the event. The value must be a member of the DataGridEventReason class. rowIndexThe zero-based index of the item in the data provider. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/DataGridEvent.html#event:itemFocusIn" title="DataGridEvent.itemFocusIn" text="itemFocusIn The DataGridEvent.ITEM_FOCUS_IN constant defines the value of the type property of a itemFocusIn event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. columnIndexThe zero-based index of the header column in the columns array of the DataGrid object. currentTargetThe object that is actively processing the event object with an event listener. dataFieldnull itemRendererThe item renderer for the item to be edited. reasonnull rowIndexThe zero-based index of the item in the data provider. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/DataGridEvent.html#event:itemFocusOut" title="DataGridEvent.itemFocusOut" text="itemFocusOut The DataGridEvent.ITEM_FOCUS_OUT constant defines the value of the type property of an itemFocusOut event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. columnIndexThe zero-based index of the header column in the columns array of the DataGrid object. currentTargetThe object that is actively processing the event object with an event listener. dataFieldnull itemRendererThe item renderer for the item to be edited. reasonnull rowIndexThe zero-based index of the item in the data provider. targetThe object that dispatched the event. The target is not always the object listening for the event. Use the currentTarget property to access the object that is listening for the event."/>
<page href="fl/events/InteractionInputType.html" title="InteractionInputType class" text="InteractionInputType The InteractionInputType class defines constants for the values of the triggerEvent property of the SliderEvent object. These constants define strings to identify the sources of input that can trigger an event: the mouse and the keyboard."/>
<page href="fl/events/InteractionInputType.html#KEYBOARD" title="InteractionInputType.KEYBOARD" text="KEYBOARD The InteractionInputType.KEYBOARD constant defines the value of the type property of a keyboard event object."/>
<page href="fl/events/InteractionInputType.html#MOUSE" title="InteractionInputType.MOUSE" text="MOUSE The InteractionInputType.MOUSE constant defines the value of the type property of a mouse event object."/>
<page href="fl/events/DataGridEventReason.html" title="DataGridEventReason class" text="DataGridEventReason The DataGridEventReason class defines constants that are used for the values of the reason property of the DataGridEvent object when the value of the type property is itemEditEnd."/>
<page href="fl/events/DataGridEventReason.html#CANCELLED" title="DataGridEventReason.CANCELLED" text="CANCELLED The user canceled editing and does not want to save the edited data. Even if you call the preventDefault() method from your event listener for the itemEditEnd event, Flash still calls the destroyItemEditor() editor to close the editor."/>
<page href="fl/events/DataGridEventReason.html#NEW_COLUMN" title="DataGridEventReason.NEW_COLUMN" text="NEW_COLUMN The user moved focus to a new column in the same row. Your event listener can include logic that permits a change in focus or that stops it. For example, if an event listener detects that the user entered an invalid value, the event listener can make a call to the preventDefault() method to stop focus from being moved to a new item. The item editor remains open and the user continues to edit the current item. To close the editor that is associated with the current item, call the destroyItemEditor() method."/>
<page href="fl/events/DataGridEventReason.html#NEW_ROW" title="DataGridEventReason.NEW_ROW" text="NEW_ROW Indicates that the user moved focus to a new row. Your event listener can include logic that permits a change in focus or that stops it. For example, if an event listener detects that the user entered an invalid value, the event listener can make a call to the preventDefault() method to stop focus from being moved to a new row. The item editor remains open and the user continues to edit the current item. To close the editor that is associated with the current item, call the destroyItemEditor() method."/>
<page href="fl/events/DataGridEventReason.html#OTHER" title="DataGridEventReason.OTHER" text="OTHER The list component lost focus, was scrolled, or is in a state where editing is not allowed. Even if you call the preventDefault() method from your event listener for the itemEditEnd event, Flash still calls the destroyItemEditor() editor to close the editor."/>
<page href="fl/events/SliderEventClickTarget.html" title="SliderEventClickTarget class" text="SliderEventClickTarget The SliderEventClickTarget class defines constants for the values of the clickTarget property of the SliderEvent class."/>
<page href="fl/events/SliderEventClickTarget.html#THUMB" title="SliderEventClickTarget.THUMB" text="THUMB The Slider thumb was clicked."/>
<page href="fl/events/SliderEventClickTarget.html#TRACK" title="SliderEventClickTarget.TRACK" text="TRACK The Slider track was clicked."/>
<page href="fl/events/DataChangeType.html" title="DataChangeType class" text="DataChangeType The DataChangeType class defines constants for the DataChangeEvent.changeType event. These constants are used by the DataChangeEvent class to identify the type of change that was applied to the data in a list-based component such as a List, ComboBox, TileList, or DataGrid."/>
<page href="fl/events/DataChangeType.html#ADD" title="DataChangeType.ADD" text="ADD Items were added to the data provider."/>
<page href="fl/events/DataChangeType.html#CHANGE" title="DataChangeType.CHANGE" text="CHANGE A change was made to the component data. This value does not affect the component data that it describes."/>
<page href="fl/events/DataChangeType.html#INVALIDATE" title="DataChangeType.INVALIDATE" text="INVALIDATE A change was made to the data contained in an item."/>
<page href="fl/events/DataChangeType.html#INVALIDATE_ALL" title="DataChangeType.INVALIDATE_ALL" text="INVALIDATE_ALL The data set is invalid."/>
<page href="fl/events/DataChangeType.html#REMOVE" title="DataChangeType.REMOVE" text="REMOVE Items were removed from the data provider."/>
<page href="fl/events/DataChangeType.html#REMOVE_ALL" title="DataChangeType.REMOVE_ALL" text="REMOVE_ALL All items were removed from the data provider."/>
<page href="fl/events/DataChangeType.html#REPLACE" title="DataChangeType.REPLACE" text="REPLACE The items in the data provider were replaced by new items."/>
<page href="fl/events/DataChangeType.html#SORT" title="DataChangeType.SORT" text="SORT The data provider was sorted. This constant is used to indicate a change in the order of the data, not a change in the data itself."/>
<page href="fl/events/DataChangeType.html#event:add" title="DataChangeType.add" text="add Items were added to the data provider."/>
<page href="fl/events/DataChangeType.html#event:change" title="DataChangeType.change" text="change A change was made to the component data. This value does not affect the component data that it describes."/>
<page href="fl/events/DataChangeType.html#event:invalidate" title="DataChangeType.invalidate" text="invalidate A change was made to the data contained in an item."/>
<page href="fl/events/DataChangeType.html#event:invalidateAll" title="DataChangeType.invalidateAll" text="invalidateAll The data set is invalid."/>
<page href="fl/events/DataChangeType.html#event:remove" title="DataChangeType.remove" text="remove Items were removed from the data provider."/>
<page href="fl/events/DataChangeType.html#event:removeAll" title="DataChangeType.removeAll" text="removeAll All items were removed from the data provider."/>
<page href="fl/events/DataChangeType.html#event:replace" title="DataChangeType.replace" text="replace The items in the data provider were replaced by new items."/>
<page href="fl/events/DataChangeType.html#event:sort" title="DataChangeType.sort" text="sort The data provider was sorted. This constant is used to indicate a change in the order of the data, not a change in the data itself."/>
<page href="fl/motion/MotionEvent.html" title="MotionEvent class" text="MotionEvent The MotionEvent class represents events that are broadcast by the fl.motion.Animator class. Use these events with an event listener to initiate custom functions. For example, if you have an Animator instance named abox_animator, Flash Player executes the following trace statement when the animation is complete: import fl.motion.MotionEvent; abox_animator.addEventListener(MotionEvent.MOTION_END,afterMotion); function afterMotion(e:MotionEvent) { trace(&quot;animation complete!&quot;); }"/>
<page href="fl/motion/MotionEvent.html#MotionEvent()" title="MotionEvent.MotionEvent()" text="MotionEvent Constructor. type bubbles cancelable The event type; indicates the action that caused the event. Specifies whether the event can bubble up the display list hierarchy. Specifies whether the behavior associated with the event can be prevented."/>
<page href="fl/motion/MotionEvent.html#MOTION_END" title="MotionEvent.MOTION_END" text="MOTION_END Indicates that the motion has stopped, whether by an explicit call to Animator.stop() or Animator.end(), or by reaching the end of the Motion instance. The properties of the event object have the following values: PropertyValue bubblesfalse cancelablefalse currentTargetThe object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget. targetThe object that dispatched the event; it is not always the object listening for the event. Use the currentTarget property to always access the object listening for the event."/>
<page href="fl/motion/MotionEvent.html#MOTION_START" title="MotionEvent.MOTION_START" text="MOTION_START Indicates that the Motion instance has started playing. The properties of the event object have the following values: PropertyValue bubblesfalse cancelablefalse currentTargetThe object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget. targetThe object that dispatched the event; it is not always the object listening for the event. Use the currentTarget property to always access the object listening for the event."/>
<page href="fl/motion/MotionEvent.html#MOTION_UPDATE" title="MotionEvent.MOTION_UPDATE" text="MOTION_UPDATE Indicates that the Motion instance has changed and the screen has been updated. The properties of the event object have the following values: PropertyValue bubblesfalse cancelablefalse currentTargetThe object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget. targetThe object that dispatched the event; it is not always the object listening for the event. Use the currentTarget property to always access the object listening for the event."/>
<page href="fl/motion/MotionEvent.html#TIME_CHANGE" title="MotionEvent.TIME_CHANGE" text="TIME_CHANGE Indicates that the Animator instance's time value has changed, but the screen has not yet been updated (Flash Player has not dispatched the motionUpdate event). The properties of the event object have the following values: PropertyValue bubblesfalse cancelablefalse currentTargetThe object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget. targetThe object that dispatched the event; it is not always the object listening for the event. Use the currentTarget property to always access the object listening for the event."/>
<page href="fl/motion/MotionEvent.html#event:motionEnd" title="MotionEvent.motionEnd" text="motionEnd Indicates that the motion has stopped, whether by an explicit call to Animator.stop() or Animator.end(), or by reaching the end of the Motion instance. The properties of the event object have the following values: PropertyValue bubblesfalse cancelablefalse currentTargetThe object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget. targetThe object that dispatched the event; it is not always the object listening for the event. Use the currentTarget property to always access the object listening for the event."/>
<page href="fl/motion/MotionEvent.html#event:motionStart" title="MotionEvent.motionStart" text="motionStart Indicates that the Motion instance has started playing. The properties of the event object have the following values: PropertyValue bubblesfalse cancelablefalse currentTargetThe object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget. targetThe object that dispatched the event; it is not always the object listening for the event. Use the currentTarget property to always access the object listening for the event."/>
<page href="fl/motion/MotionEvent.html#event:motionUpdate" title="MotionEvent.motionUpdate" text="motionUpdate Indicates that the Motion instance has changed and the screen has been updated. The properties of the event object have the following values: PropertyValue bubblesfalse cancelablefalse currentTargetThe object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget. targetThe object that dispatched the event; it is not always the object listening for the event. Use the currentTarget property to always access the object listening for the event."/>
<page href="fl/motion/MotionEvent.html#event:timeChange" title="MotionEvent.timeChange" text="timeChange Indicates that the Animator instance's time value has changed, but the screen has not yet been updated (Flash Player has not dispatched the motionUpdate event). The properties of the event object have the following values: PropertyValue bubblesfalse cancelablefalse currentTargetThe object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget. targetThe object that dispatched the event; it is not always the object listening for the event. Use the currentTarget property to always access the object listening for the event."/>
<page href="fl/motion/MatrixTransformer.html" title="MatrixTransformer class" text="MatrixTransformer The MatrixTransformer class contains methods for modifying individual properties of a transformation matrix: horizontal and vertical scale, horizontal and vertical skew, and rotation. This class also has methods for rotating around a given transformation point rather than the typical (0, 0) point."/>
<page href="fl/motion/MatrixTransformer.html#getRotation()" title="MatrixTransformer.getRotation()" text="getRotation Calculates the angle of rotation present in a matrix, in degrees. If the horizontal and vertical skews are not equal, the vertical skew value is used. This matches the rotation behavior in Flash Player. m A Matrix instance."/>
<page href="fl/motion/MatrixTransformer.html#getRotationRadians()" title="MatrixTransformer.getRotationRadians()" text="getRotationRadians Calculates the angle of rotation present in a matrix, in radians. If the horizontal and vertical skews are not equal, the vertical skew value is used. m A Matrix instance."/>
<page href="fl/motion/MatrixTransformer.html#getScaleX()" title="MatrixTransformer.getScaleX()" text="getScaleX Calculates the horizontal scale present in a matrix. m A Matrix instance."/>
<page href="fl/motion/MatrixTransformer.html#getScaleY()" title="MatrixTransformer.getScaleY()" text="getScaleY Calculates the vertical scale present in a matrix. m A Matrix instance."/>
<page href="fl/motion/MatrixTransformer.html#getSkewX()" title="MatrixTransformer.getSkewX()" text="getSkewX Calculates the angle of horizontal skew present in a matrix, in degrees. m A Matrix instance."/>
<page href="fl/motion/MatrixTransformer.html#getSkewXRadians()" title="MatrixTransformer.getSkewXRadians()" text="getSkewXRadians Calculates the angle of horizontal skew present in a matrix, in radians. m A Matrix instance."/>
<page href="fl/motion/MatrixTransformer.html#getSkewY()" title="MatrixTransformer.getSkewY()" text="getSkewY Calculates the angle of vertical skew present in a matrix, in degrees. m A Matrix instance."/>
<page href="fl/motion/MatrixTransformer.html#getSkewYRadians()" title="MatrixTransformer.getSkewYRadians()" text="getSkewYRadians Calculates the angle of vertical skew present in a matrix, in radians. m A Matrix instance."/>
<page href="fl/motion/MatrixTransformer.html#matchInternalPointWithExternal()" title="MatrixTransformer.matchInternalPointWithExternal()" text="matchInternalPointWithExternal Moves a matrix as necessary to align an internal point with an external point. This can be used to match a point in a transformed movie clip with one in its parent. m internalPoint externalPoint A Matrix instance. A Point instance defining a position within the matrix's transformation space. A Point instance defining a reference position outside the matrix's transformation space."/>
<page href="fl/motion/MatrixTransformer.html#rotateAroundExternalPoint()" title="MatrixTransformer.rotateAroundExternalPoint()" text="rotateAroundExternalPoint Rotates a matrix about a point defined outside the matrix's transformation space. This can be used to rotate a movie clip around a transformation point in its parent. m x y angleDegrees A Matrix instance. The x coordinate of the point. The y coordinate of the point. The angle of rotation in degrees."/>
<page href="fl/motion/MatrixTransformer.html#rotateAroundInternalPoint()" title="MatrixTransformer.rotateAroundInternalPoint()" text="rotateAroundInternalPoint Rotates a matrix about a point defined inside the matrix's transformation space. This can be used to rotate a movie clip around a transformation point inside itself. m x y angleDegrees A Matrix instance. The x coordinate of the point. The y coordinate of the point. The angle of rotation in degrees."/>
<page href="fl/motion/MatrixTransformer.html#setRotation()" title="MatrixTransformer.setRotation()" text="setRotation Changes the angle of rotation in a matrix. If the horizontal and vertical skews are not equal, the vertical skew is set to the rotation value and the horizontal skew is increased by the difference between the old rotation and the new rotation. This matches the rotation behavior in Flash Player. m rotation A Matrix instance. The angle of rotation, in degrees."/>
<page href="fl/motion/MatrixTransformer.html#setRotationRadians()" title="MatrixTransformer.setRotationRadians()" text="setRotationRadians Changes the angle of rotation in a matrix. If the horizontal and vertical skews are not equal, the vertical skew is set to the rotation value and the horizontal skew is increased by the difference between the old rotation and the new rotation. This matches the rotation behavior in Flash Player. m rotation A Matrix instance. The angle of rotation, in radians."/>
<page href="fl/motion/MatrixTransformer.html#setScaleX()" title="MatrixTransformer.setScaleX()" text="setScaleX Changes the horizontal scale in a matrix. m scaleX A Matrix instance to be modified. The new horizontal scale."/>
<page href="fl/motion/MatrixTransformer.html#setScaleY()" title="MatrixTransformer.setScaleY()" text="setScaleY Changes the vertical scale in a matrix. m scaleY A Matrix instance to be modified. The new vertical scale."/>
<page href="fl/motion/MatrixTransformer.html#setSkewX()" title="MatrixTransformer.setSkewX()" text="setSkewX Changes the horizontal skew in a matrix. m skewX A Matrix instance to be modified. The new horizontal skew, in degrees."/>
<page href="fl/motion/MatrixTransformer.html#setSkewXRadians()" title="MatrixTransformer.setSkewXRadians()" text="setSkewXRadians Changes the horizontal skew in a matrix. m skewX A Matrix instance to be modified. The new horizontal skew, in radians."/>
<page href="fl/motion/MatrixTransformer.html#setSkewY()" title="MatrixTransformer.setSkewY()" text="setSkewY Changes the vertical skew in a matrix. m skewY A Matrix instance to be modified. The new vertical skew, in degrees."/>
<page href="fl/motion/MatrixTransformer.html#setSkewYRadians()" title="MatrixTransformer.setSkewYRadians()" text="setSkewYRadians Changes the vertical skew in a matrix. m skewY A Matrix instance to be modified. The new vertical skew, in radians."/>
<page href="fl/motion/FunctionEase.html" title="FunctionEase class" text="FunctionEase The FunctionEase class allows custom interpolation functions to be used with the fl.motion framework in place of other interpolations like SimpleEase and CustomEase. The fl.motion framework includes several easing functions in the fl.motion.easing package."/>
<page href="fl/motion/FunctionEase.html#FunctionEase()" title="FunctionEase.FunctionEase()" text="FunctionEase Constructor for FunctionEase instances. xml An optional E4X XML instance."/>
<page href="fl/motion/FunctionEase.html#getValue()" title="FunctionEase.getValue()" text="getValue Calculates an interpolated value for a numerical property of animation, using the specified easing function. If the parameters array has been set beforehand, those values will be passed to the easing function in addition to the time, begin, change, and duration values. time begin change duration The time value, which must lie between 0 and duration, inclusive. You can choose any unit (for example, frames, seconds, milliseconds), but your choice must match the duration unit. The value of the animation property at the start of the tween, when time is 0. The change in the value of the animation property over the course of the tween. The value can be positive or negative. For example, if an object rotates from 90 to 60 degrees, the change is -30. The length of time for the tween. Must be greater than zero. You can choose any unit (for example, frames, seconds, milliseconds), but your choice must match the time unit."/>
<page href="fl/motion/FunctionEase.html#easingFunction" title="FunctionEase.easingFunction" text="easingFunction A reference to a function with a (t, b, c, d) signature like the methods in the fl.motion.easing classes."/>
<page href="fl/motion/FunctionEase.html#functionName" title="FunctionEase.functionName" text="functionName The fully qualified name of an easing function, such as fl.motion.easing.Bounce.easeOut(). The function must be a method of a class (Bounce, Cubic, Elastic, another class). If Flash Player cannot find the class, an exception is thrown."/>
<page href="fl/motion/FunctionEase.html#parameters" title="FunctionEase.parameters" text="parameters An optional array of values to be passed to the easing function as additional arguments."/>
<page href="fl/motion/FunctionEase.html#target" title="FunctionEase.target" text="target The name of the animation property to target."/>
<page href="fl/motion/SimpleEase.html" title="SimpleEase class" text="SimpleEase The SimpleEase class allows you to control an animation with the kind of percentage easing that is used in the Flash timeline."/>
<page href="fl/motion/SimpleEase.html#SimpleEase()" title="SimpleEase.SimpleEase()" text="SimpleEase Constructor for SimpleEase instances. xml Optional E4X XML object defining a SimpleEase object in Motion XML format."/>
<page href="fl/motion/SimpleEase.html#easeNone()" title="SimpleEase.easeNone()" text="easeNone Calculates an interpolated value for a numerical property of animation, using a linear tween of constant velocity. The function signature matches that of the easing functions in the fl.motion.easing package. time begin change duration This value is between 0 and duration, inclusive. You can choose any unit(for example, frames, seconds, milliseconds), but your choice must match the duration unit. The value of the animation property at the start of the tween, when time is 0. The change in the value of the animation property over the course of the tween. This value can be positive or negative. For example, if an object rotates from 90 to 60 degrees, the change is -30. The length of time for the tween. This value must be greater than zero. You can choose any unit (for example, frames, seconds, milliseconds), but your choice must match the time unit."/>
<page href="fl/motion/SimpleEase.html#easeQuadPercent()" title="SimpleEase.easeQuadPercent()" text="easeQuadPercent Calculates an interpolated value for a numerical property of animation, using a percentage of quadratic easing. The function signature matches that of the easing functions in the fl.motion.easing package. time begin change duration percent This value is between 0 and duration, inclusive. You can choose any unit (for example, frames, seconds, milliseconds), but your choice must match the duration unit. The value of the animation property at the start of the tween, when time is 0. The change in the value of the animation property over the course of the tween. This value can be positive or negative. For example, if an object rotates from 90 to 60 degrees, the change is -30. The length of time for the tween. This value must be greater than zero. You can choose any unit (for example, frames, seconds, milliseconds), but your choice must match the time unit. A percentage between -1 (100% ease in or acceleration) and 1 (100% ease out or deceleration)."/>
<page href="fl/motion/SimpleEase.html#getValue()" title="SimpleEase.getValue()" text="getValue Calculates an interpolated value for a numerical property of animation, using a percentage of quadratic easing. The percent value is read from the SimpleEase instance's ease property rather than being passed into the method. Using this property allows the function signature to match the ITween interface. time begin change duration This value is between 0 and duration, inclusive. You can choose any unit (for example, frames, seconds, milliseconds), but your choice must match the duration unit. The value of the animation property at the start of the tween, when time is 0. The change in the value of the animation property over the course of the tween. This value can be positive or negative. For example, if an object rotates from 90 to 60 degrees, the change is -30. The length of time for the tween. This value must be greater than zero. You can choose any unit (for example, frames, seconds, milliseconds), but your choice must match the time unit."/>
<page href="fl/motion/SimpleEase.html#ease" title="SimpleEase.ease" text="ease A percentage between -1 (100% ease in or acceleration) and 1 (100% ease out or deceleration). Defaults to 0, which means that the tween animates at a constant speed, without acceleration or deceleration."/>
<page href="fl/motion/SimpleEase.html#target" title="SimpleEase.target" text="target The name of the animation property to target."/>
<page href="fl/motion/Animator.html" title="Animator class" text="Animator The Animator class applies an XML description of a motion tween to a display object. The properties and methods of the Animator class control the playback of the motion, and Flash Player broadcasts events in response to changes in the motion's status. The Animator class is primarily used by the Copy Motion as ActionScript command in Flash CS3. You can then edit the ActionScript using the application programming interface (API) or construct your own custom animation. If you plan to call methods of the Animator class within a function, declare the Animator instance outside of the function so the scope of the object is not restricted to the function itself. If you declare the instance within a function, Flash Player deletes the Animator instance at the end of the function as part of Flash Player's routine &quot;garbage collection&quot; and the target object will not animate."/>
<page href="fl/motion/Animator.html#Animator()" title="Animator.Animator()" text="Animator Creates an Animator object to apply the XML-based motion tween description to a display object. xml target An E4X object containing an XML-based motion tween description. The display object using the motion tween."/>
<page href="fl/motion/Animator.html#end()" title="Animator.end()" text="end Stops the animation and Flash Player goes immediately to the last frame in the animation sequence. If the autoRewind property is set to true, Flash Player goes to the first frame in the animation sequence."/>
<page href="fl/motion/Animator.html#fromXMLString()" title="Animator.fromXMLString()" text="fromXMLString Creates an Animator object from a string of XML. This method is an alternative to using the Animator constructor, which accepts an E4X object instead. xmlString target A string of XML describing the motion tween. The display object using the motion tween."/>
<page href="fl/motion/Animator.html#nextFrame()" title="Animator.nextFrame()" text="nextFrame Advances Flash Player to the next frame in the animation sequence."/>
<page href="fl/motion/Animator.html#pause()" title="Animator.pause()" text="pause Pauses the animation until you call the resume() method."/>
<page href="fl/motion/Animator.html#play()" title="Animator.play()" text="play Begins the animation. Call the end() method before you call the play() method to ensure that any previous instance of the animation has ended before you start a new one."/>
<page href="fl/motion/Animator.html#resume()" title="Animator.resume()" text="resume Resumes the animation after it has been paused by the pause() method."/>
<page href="fl/motion/Animator.html#rewind()" title="Animator.rewind()" text="rewind Sets Flash Player to the first frame of the animation. If the animation was playing, it continues playing from the first frame. If the animation was stopped, it remains stopped at the first frame."/>
<page href="fl/motion/Animator.html#stop()" title="Animator.stop()" text="stop Stops the animation and Flash Player goes back to the first frame in the animation sequence."/>
<page href="fl/motion/Animator.html#autoRewind" title="Animator.autoRewind" text="autoRewind Sets the animation to restart after it finishes."/>
<page href="fl/motion/Animator.html#isPlaying" title="Animator.isPlaying" text="isPlaying Indicates whether the animation is currently playing."/>
<page href="fl/motion/Animator.html#motion" title="Animator.motion" text="motion The object that contains the motion tween properties for the animation."/>
<page href="fl/motion/Animator.html#orientToPath" title="Animator.orientToPath" text="orientToPath Sets the position of the display object along the motion path. If set to true the baseline of the display object orients to the motion path; otherwise the registration point orients to the motion path."/>
<page href="fl/motion/Animator.html#positionMatrix" title="Animator.positionMatrix" text="positionMatrix The Matrix object that applies an overall transformation to the motion path. This matrix allows the path to be shifted, scaled, skewed or rotated, without changing the appearance of the display object."/>
<page href="fl/motion/Animator.html#repeatCount" title="Animator.repeatCount" text="repeatCount Number of times to repeat the animation. Possible values are any integer greater than or equal to 0. A value of 1 means to play the animation once. A value of 0 means to play the animation indefinitely until explicitly stopped (by a call to the end() method, for example)."/>
<page href="fl/motion/Animator.html#target" title="Animator.target" text="target The display object being animated. Any subclass of flash.display.DisplayObject can be used, such as a MovieClip, Sprite, or Bitmap."/>
<page href="fl/motion/Animator.html#time" title="Animator.time" text="time A zero-based integer that indicates and controls the time in the current animation. At the animation's first frame time is 0. If the animation has a duration of 10 frames, at the last frame time is 9."/>
<page href="fl/motion/Animator.html#transformationPoint" title="Animator.transformationPoint" text="transformationPoint The point of reference for rotating or scaling a display object. The transformation point is relative to the display object's bounding box. The point's coordinates must be scaled to a 1px x 1px box, where (1, 1) is the object's lower-right corner, and (0, 0) is the object's upper-left corner."/>
<page href="fl/motion/Animator.html#event:motionEnd" title="Animator.motionEnd" text="motionEnd Dispatched when the motion finishes playing, either when it reaches the end, or when the motion has been interrupted by a call to the stop() or end() methods."/>
<page href="fl/motion/Animator.html#event:motionStart" title="Animator.motionStart" text="motionStart Dispatched when the motion starts playing."/>
<page href="fl/motion/Animator.html#event:motionUpdate" title="Animator.motionUpdate" text="motionUpdate Dispatched when the motion has changed and the screen has been updated."/>
<page href="fl/motion/Animator.html#event:timeChange" title="Animator.timeChange" text="timeChange Dispatched when the Animator's time value has changed, but the screen has not yet been updated (i.e., the motionUpdate event)."/>
<page href="fl/motion/CustomEase.html" title="CustomEase class" text="CustomEase The CustomEase class is used to modify specific properties of the easing behavior of a motion tween as the tween progresses over time. A custom easing curve is composed of one or more cubic Bezier curves. You can apply the custom easing curve to all properties at once, or you can define different curves for different properties. The implementation of this class parallels the Flash CS3 Custom Ease In/Ease Out dialog box. Flash CS3 displays a graph in the Custom Ease In/Ease Out dialog box representing the degree of motion over time. The horizontal axis represents frames, and the vertical axis represents the percent of change of a property through the progression of the tween. The first keyframe is represented as 0%, and the last keyframe is represented as 100%. The slope of the graph's curve represents the rate of change of the object. When the curve is horizontal (no slope), the velocity is zero; when the curve is vertical, an instantaneous rate of change occurs."/>
<page href="fl/motion/CustomEase.html#CustomEase()" title="CustomEase.CustomEase()" text="CustomEase Constructor for CustomEase instances. xml Optional E4X XML object defining a CustomEase in Motion XML format."/>
<page href="fl/motion/CustomEase.html#getValue()" title="CustomEase.getValue()" text="getValue Calculates an interpolated value for a numerical property of animation, using a custom easing curve. The percent value is read from the CustomEase instance's points property, rather than being passed into the method. Using the property value allows the function signature to match the ITween interface. time begin change duration The time value, which must lie between 0 and duration, inclusive. You can choose any unit (for example. frames, seconds, milliseconds), but your choice must match the duration unit. The value of the animation property at the start of the tween, when time is 0. The change in the value of the animation property over the course of the tween. The value can be positive or negative. For example, if an object rotates from 90 to 60 degrees, the change is -30. The length of time for the tween. This value must be greater than zero. You can choose any unit (for example, frames, seconds, milliseconds), but your choice must match the time unit."/>
<page href="fl/motion/CustomEase.html#points" title="CustomEase.points" text="points An ordered collection of points in the custom easing curve. Each item in the array is a flash.geom.Point instance. The x and y properties of each point are normalized to fall between 0 and 1, where 0 is the value of the animation property at the beginning of the tween, and 1 is the value at the end of the tween. The first and last points of the curve are not included in the array because the first point is locked to the starting value defined by the current keyframe, and the last point is locked to the ending value defined by the next keyframe. On the custom easing curve, these points correspond to values of (0, 0) and (1, 1), respectively."/>
<page href="fl/motion/CustomEase.html#points" title="CustomEase.points" text="points"/>
<page href="fl/motion/CustomEase.html#target" title="CustomEase.target" text="target The name of the animation property to target."/>
<page href="fl/motion/Color.html" title="Color class" text="Color The Color class extends the Flash Player ColorTransform class, adding the ability to control brightness and tint. It also contains static methods for interpolating between two ColorTransform objects or between two color numbers."/>
<page href="fl/motion/Color.html#Color()" title="Color.Color()" text="Color Constructor for Color instances. redMultiplier greenMultiplier blueMultiplier alphaMultiplier redOffset greenOffset blueOffset alphaOffset The percentage to apply the color, as a decimal value between 0 and 1. The percentage to apply the color, as a decimal value between 0 and 1. The percentage to apply the color, as a decimal value between 0 and 1. A decimal value that is multiplied with the alpha transparency channel value, as a decimal value between 0 and 1. A number from -255 to 255 that is added to the red channel value after it has been multiplied by the redMultiplier value. A number from -255 to 255 that is added to the green channel value after it has been multiplied by the greenMultiplier value. A number from -255 to 255 that is added to the blue channel value after it has been multiplied by the blueMultiplier value. A number from -255 to 255 that is added to the alpha channel value after it has been multiplied by the alphaMultiplier value."/>
<page href="fl/motion/Color.html#fromXML()" title="Color.fromXML()" text="fromXML Creates a Color instance from XML. xml An E4X XML object containing a &lt;color&gt; node from Motion XML."/>
<page href="fl/motion/Color.html#interpolateColor()" title="Color.interpolateColor()" text="interpolateColor Blends smoothly from one color value to another. fromColor toColor progress The starting color value, in the 0xRRGGBB or 0xAARRGGBB format. The ending color value, in the 0xRRGGBB or 0xAARRGGBB format. The percent of the transition as a decimal, where 0 is the start and 1 is the end."/>
<page href="fl/motion/Color.html#interpolateTransform()" title="Color.interpolateTransform()" text="interpolateTransform Blends smoothly from one ColorTransform object to another. fromColor toColor progress The starting ColorTransform object. The ending ColorTransform object. The percent of the transition as a decimal, where 0 is the start and 1 is the end."/>
<page href="fl/motion/Color.html#setTint()" title="Color.setTint()" text="setTint Sets the tint color and amount at the same time. tintColor tintMultiplier The tinting color value in the 0xRRGGBB format. The percentage to apply the tint color, as a decimal value between 0 and 1. When tintMultiplier = 0, the target object is its original color and no tint color is visible. When tintMultiplier = 1, the target object is completely tinted and none of its original color is visible."/>
<page href="fl/motion/Color.html#brightness" title="Color.brightness" text="brightness The percentage of brightness, as a decimal between -1 and 1. Positive values lighten the object, and a value of 1 turns the object completely white. Negative values darken the object, and a value of -1 turns the object completely black."/>
<page href="fl/motion/Color.html#tintColor" title="Color.tintColor" text="tintColor The tinting color value in the 0xRRGGBB format."/>
<page href="fl/motion/Color.html#tintMultiplier" title="Color.tintMultiplier" text="tintMultiplier The percentage to apply the tint color, as a decimal value between 0 and 1. When tintMultiplier = 0, the target object is its original color and no tint color is visible. When tintMultiplier = 1, the target object is completely tinted and none of its original color is visible."/>
<page href="fl/motion/ITween.html" title="ITween interface" text="ITween The ITween interface defines the application programming interface (API) that interpolation classes implement in order to work with the fl.motion classes. The SimpleEase, CustomEase, BezierEase, and FunctionEase classes implement the ITween interface."/>
<page href="fl/motion/ITween.html#getValue()" title="ITween.getValue()" text="getValue Calculates an interpolated value for a numerical property of animation. The function signature matches that of the easing functions in the fl.motion.easing package. Various ITween classes will produce different styles of interpolation for the same inputs. time begin change duration The time value, which must be between 0 and duration, inclusive. You can choose any unit (for example, frames, seconds, milliseconds), but your choice must match the duration unit. The value of the animation property at the start of the tween, when time is 0. The change in the value of the animation property over the course of the tween. This value can be positive or negative. For example, if an object rotates from 90 to 60 degrees, the change is -30. The length of time for the tween. This value must be greater than zero. You can choose any unit (for example, frames, seconds, milliseconds), but your choice must match the time unit."/>
<page href="fl/motion/ITween.html#target" title="ITween.target" text="target The name of the animation property to target. The default value is &quot;&quot; (empty quotes), which targets all properties. The other acceptable values are &quot;x&quot;, &quot;y&quot;, &quot;position&quot; (which targets both x and y), &quot;scaleX&quot;, &quot;scaleY&quot;, &quot;scale&quot; (which targets both scaleX and scaleY), &quot;skewX&quot;, &quot;skewY&quot;, &quot;rotation&quot; (which targets both scaleX and scaleY), &quot;color&quot;, and &quot;filters&quot;."/>
<page href="fl/motion/Motion.html" title="Motion class" text="Motion The Motion class stores a keyframe animation sequence that can be applied to a visual object. The animation data includes position, scale, rotation, skew, color, filters, and easing. The Motion class has methods for retrieving data at specific points in time, and interpolating values between keyframes automatically."/>
<page href="fl/motion/Motion.html#Motion()" title="Motion.Motion()" text="Motion Constructor for Motion instances. By default, one initial keyframe is created automatically, with default transform properties. xml Optional E4X XML object defining a Motion instance."/>
<page href="fl/motion/Motion.html#addKeyframe()" title="Motion.addKeyframe()" text="addKeyframe Adds a keyframe object to the Motion instance. newKeyframe A keyframe object with an index property already set."/>
<page href="fl/motion/Motion.html#fromXMLString()" title="Motion.fromXMLString()" text="fromXMLString A method needed to create a Motion instance from a string of XML. xmlString A string of motion XML."/>
<page href="fl/motion/Motion.html#getColorTransform()" title="Motion.getColorTransform()" text="getColorTransform Retrieves an interpolated ColorTransform object at a specific time index in the Motion instance. index The time index of a frame in the Motion instance, as an integer greater than or equal to zero."/>
<page href="fl/motion/Motion.html#getCurrentKeyframe()" title="Motion.getCurrentKeyframe()" text="getCurrentKeyframe Retrieves the keyframe that is currently active at a specific frame in the Motion instance. A frame that is not a keyframe derives its values from the keyframe that preceded it. This method can also filter values by the name of a specific tweenables property. You can find the currently active keyframe for x, which may not be the same as the currently active keyframe in general. index tweenableName The index of a frame in the Motion instance, as an integer greater than or equal to zero. Optional name of a tweenable's property (like &quot;x&quot; or &quot;rotation&quot;)."/>
<page href="fl/motion/Motion.html#getFilters()" title="Motion.getFilters()" text="getFilters Retrieves an interpolated array of filters at a specific time index in the Motion instance. index The time index of a frame in the Motion, as an integer greater than or equal to zero."/>
<page href="fl/motion/Motion.html#getNextKeyframe()" title="Motion.getNextKeyframe()" text="getNextKeyframe Retrieves the next keyframe after a specific frame in the Motion instance. If a frame is not a keyframe, and is in the middle of a tween, this method derives its values from both the preceding keyframe and the following keyframe. This method can also filter by the name of a specific tweenables property. This allows you to find the next keyframe for x, which may not be the same as the next keyframe in general. index tweenableName The index of a frame in the Motion instance, as an integer greater than or equal to zero. Optional name of a tweenable's property (like &quot;x&quot; or &quot;rotation&quot;)."/>
<page href="fl/motion/Motion.html#getValue()" title="Motion.getValue()" text="getValue Retrieves the value for an animation property at a point in time. index tweenableName The time index of a frame in the Motion instance, as an integer greater than or equal to zero. The name of a tweenable's property (like &quot;x&quot; or &quot;rotation&quot;)."/>
<page href="fl/motion/Motion.html#interpolateFilter()" title="Motion.interpolateFilter()" text="interpolateFilter Blends filters smoothly from one filter object to another. fromFilter toFilter progress The starting filter object. The ending filter object. The percent of the transition as a decimal, where 0 is the start and 1 is the end."/>
<page href="fl/motion/Motion.html#interpolateFilters()" title="Motion.interpolateFilters()" text="interpolateFilters Blends filters smoothly from one array of filter objects to another. fromFilters toFilters progress The starting array of filter objects. The ending array of filter objects. The percent of the transition as a decimal, where 0 is the start and 1 is the end."/>
<page href="fl/motion/Motion.html#setValue()" title="Motion.setValue()" text="setValue Sets the value of a specific tweenables property at a given time index in the Motion instance. If a keyframe doesn't exist at the index, one is created automatically. index tweenableName value The time index of a frame in the Motion instance, as an integer greater than zero. If the index is zero, no change is made. Because the transform properties are relative to the starting transform of the target object, the first frame's values are always default values and should not be changed. The name of a tweenable's property (like &quot;x&quot; or &quot;rotation&quot;). The new value of the tweenable property."/>
<page href="fl/motion/Motion.html#duration" title="Motion.duration" text="duration Controls the Motion instance's length of time, measured in frames. The duration cannot be less than the time occupied by the Motion instance's keyframes."/>
<page href="fl/motion/Motion.html#keyframes" title="Motion.keyframes" text="keyframes An array of keyframes that define the motion's behavior over time. This property is a sparse array, where a keyframe is placed at an index in the array that matches its own index. A motion object with keyframes at 0 and 5 has a keyframes array with a length of 6. Indices 0 and 5 in the array each contain a keyframe, and indices 1 through 4 have null values."/>
<page href="fl/motion/Motion.html#keyframes" title="Motion.keyframes" text="keyframes"/>
<page href="fl/motion/Motion.html#keyframesCompact" title="Motion.keyframesCompact" text="keyframesCompact A compact array of keyframes, where each index is occupied by a keyframe. By contrast, a sparse array has empty indices (as in the keyframes property). In the compact array, no null values are used to fill indices between keyframes. However, the index of a keyframe in keyframesCompact likely does not match its index in the keyframes array. This property is primarily used for compatibility with the Flex MXML compiler, which generates a compact array from the motion XML."/>
<page href="fl/motion/Motion.html#source" title="Motion.source" text="source An object that stores information about the context in which the motion was created, such as framerate, dimensions, transformation point, and initial position, scale, rotation and skew."/>
<page href="fl/motion/BezierSegment.html" title="BezierSegment class" text="BezierSegment A Bezier segment consists of four Point objects that define a single cubic Bezier curve. The BezierSegment class also contains methods to find coordinate values along the curve."/>
<page href="fl/motion/BezierSegment.html#BezierSegment()" title="BezierSegment.BezierSegment()" text="BezierSegment Constructor for BezierSegment instances. a b c d The first point of the curve, a node. The second point of the curve, a control point. The third point of the curve, a control point. The fourth point of the curve, a node."/>
<page href="fl/motion/BezierSegment.html#getCubicCoefficients()" title="BezierSegment.getCubicCoefficients()" text="getCubicCoefficients Calculates the coefficients for a cubic polynomial equation, given the values of the corresponding cubic Bezier equation. a b c d The first value of the Bezier equation. The second value of the Bezier equation. The third value of the Bezier equation. The fourth value of the Bezier equation."/>
<page href="fl/motion/BezierSegment.html#getCubicRoots()" title="BezierSegment.getCubicRoots()" text="getCubicRoots Finds the real solutions, if they exist, to a cubic polynomial equation of the form: at^3 + bt^2 + ct + d. This method is used to evaluate custom easing curves. a b c d The first coefficient of the cubic equation, which is multiplied by the cubed variable (t^3). The second coefficient of the cubic equation, which is multiplied by the squared variable (t^2). The third coefficient of the cubic equation, which is multiplied by the linear variable (t). The fourth coefficient of the cubic equation, which is the constant."/>
<page href="fl/motion/BezierSegment.html#getQuadraticRoots()" title="BezierSegment.getQuadraticRoots()" text="getQuadraticRoots Finds the real solutions, if they exist, to a quadratic equation of the form: at^2 + bt + c. a b c The first coefficient of the quadratic equation, which is multiplied by the squared variable (t^2). The second coefficient of the quadratic equation, which is multiplied by the linear variable (t). The third coefficient of the quadratic equation, which is the constant."/>
<page href="fl/motion/BezierSegment.html#getSingleValue()" title="BezierSegment.getSingleValue()" text="getSingleValue Calculates the value of a one-dimensional cubic Bezier equation at a specific time. By contrast, a Bezier curve is usually two-dimensional and uses two of these equations, one for the x coordinate and one for the y coordinate. t a b c d The time or degree of progress along the curve, as a decimal value between 0 and 1. Note: The t parameter does not necessarily move along the curve at a uniform speed. For example, a t value of 0.5 does not always produce a value halfway along the curve. The first value of the Bezier equation. The second value of the Bezier equation. The third value of the Bezier equation. The fourth value of the Bezier equation."/>
<page href="fl/motion/BezierSegment.html#getValue()" title="BezierSegment.getValue()" text="getValue Calculates the location of a two-dimensional cubic Bezier curve at a specific time. t The time or degree of progress along the curve, as a decimal value between 0 and 1. Note: The t parameter does not necessarily move along the curve at a uniform speed. For example, a t value of 0.5 does not always produce a value halfway along the curve."/>
<page href="fl/motion/BezierSegment.html#getYForX()" title="BezierSegment.getYForX()" text="getYForX Finds the y value of a cubic Bezier curve at a given x coordinate. Some Bezier curves overlap themselves horizontally, resulting in more than one y value for a given y value. In that case, this method will return whichever value is most logical. Used by CustomEase and BezierEase interpolation. x coefficients An x coordinate that lies between the first and last point, inclusive. An optional array of number values that represent the polynomial coefficients for the Bezier. This array can be used to optimize performance by precalculating values that are the same everywhere on the curve and do not need to be recalculated for each iteration."/>
<page href="fl/motion/BezierSegment.html#a" title="BezierSegment.a" text="a The first point of the Bezier curve. It is a node, which means it falls directly on the curve."/>
<page href="fl/motion/BezierSegment.html#b" title="BezierSegment.b" text="b The second point of the Bezier curve. It is a control point, which means the curve moves toward it, but usually does not pass through it."/>
<page href="fl/motion/BezierSegment.html#c" title="BezierSegment.c" text="c The third point of the Bezier curve. It is a control point, which means the curve moves toward it, but usually does not pass through it."/>
<page href="fl/motion/BezierSegment.html#d" title="BezierSegment.d" text="d The fourth point of the Bezier curve. It is a node, which means it falls directly on the curve."/>
<page href="fl/motion/Tweenables.html" title="Tweenables class" text="Tweenables The Tweenables class provides constant values for the names of animation properties used in the Motion and Keyframe classes."/>
<page href="fl/motion/Tweenables.html#ROTATION" title="Tweenables.ROTATION" text="ROTATION Constant for the rotation property."/>
<page href="fl/motion/Tweenables.html#SCALE_X" title="Tweenables.SCALE_X" text="SCALE_X Constant for the scaleX property."/>
<page href="fl/motion/Tweenables.html#SCALE_Y" title="Tweenables.SCALE_Y" text="SCALE_Y Constant for the scaleY property."/>
<page href="fl/motion/Tweenables.html#SKEW_X" title="Tweenables.SKEW_X" text="SKEW_X Constant for the skewX property."/>
<page href="fl/motion/Tweenables.html#SKEW_Y" title="Tweenables.SKEW_Y" text="SKEW_Y Constant for the skewY property."/>
<page href="fl/motion/Tweenables.html#X" title="Tweenables.X" text="X Constant for the x property."/>
<page href="fl/motion/Tweenables.html#Y" title="Tweenables.Y" text="Y Constant for the y property."/>
<page href="fl/motion/RotateDirection.html" title="RotateDirection class" text="RotateDirection The RotateDirection class provides constant values for rotation behavior during a tween. Used by the rotateDirection property of the fl.motion.Keyframe class."/>
<page href="fl/motion/RotateDirection.html#AUTO" title="RotateDirection.AUTO" text="AUTO Chooses a direction of rotation that requires the least amount of turning."/>
<page href="fl/motion/RotateDirection.html#CCW" title="RotateDirection.CCW" text="CCW Ensures that the object rotates counterclockwise during a tween to match the rotation of the object in the following keyframe."/>
<page href="fl/motion/RotateDirection.html#CW" title="RotateDirection.CW" text="CW Ensures that the object rotates clockwise during a tween to match the rotation of the object in the following keyframe."/>
<page href="fl/motion/RotateDirection.html#NONE" title="RotateDirection.NONE" text="NONE Prevents the object from rotating during a tween until the next keyframe is reached."/>
<page href="fl/motion/Keyframe.html" title="Keyframe class" text="Keyframe The Keyframe class defines the visual state at a specific time in a motion tween. The primary animation properties are position, scale, rotation, skew, and color. A keyframe can, optionally, define one or more of these properties. For instance, one keyframe may affect only position, while another keyframe at a different point in time may affect only scale. Yet another keyframe may affect all properties at the same time. Within a motion tween, each time index can have only one keyframe. A keyframe also has other properties like blend mode, filters, and cacheAsBitmap, which are always available. For example, a keyframe always has a blend mode."/>
<page href="fl/motion/Keyframe.html#Keyframe()" title="Keyframe.Keyframe()" text="Keyframe Constructor for keyframe instances. xml Optional E4X XML object defining a keyframe in Motion XML format."/>
<page href="fl/motion/Keyframe.html#affectsTweenable()" title="Keyframe.affectsTweenable()" text="affectsTweenable Indicates whether the keyframe has an influence on a specific animation property. tweenableName The name of a tweenable property, such as &quot;x&quot; or &quot;rotation&quot;."/>
<page href="fl/motion/Keyframe.html#getTween()" title="Keyframe.getTween()" text="getTween Retrieves an ITween object for a specific animation property. target The name of the property being tweened."/>
<page href="fl/motion/Keyframe.html#getValue()" title="Keyframe.getValue()" text="getValue Retrieves the value of a specific tweenable property on the keyframe. tweenableName The name of a tweenable property, such as &quot;x&quot; or &quot;rotation&quot;."/>
<page href="fl/motion/Keyframe.html#setValue()" title="Keyframe.setValue()" text="setValue Changes the value of a specific tweenable property on the keyframe. tweenableName newValue The name of a tweenable property, such as &quot;x&quot; or &quot;rotation&quot;. A numerical value to assign to the tweenable property."/>
<page href="fl/motion/Keyframe.html#blank" title="Keyframe.blank" text="blank Indicates that the target object should not be displayed on this keyframe."/>
<page href="fl/motion/Keyframe.html#blendMode" title="Keyframe.blendMode" text="blendMode A value from the BlendMode class that specifies how Flash Player mixes the display object's colors with graphics underneath it."/>
<page href="fl/motion/Keyframe.html#cacheAsBitmap" title="Keyframe.cacheAsBitmap" text="cacheAsBitmap If set to true, Flash Player caches an internal bitmap representation of the display object. Using this property often allows faster rendering than the default use of vectors."/>
<page href="fl/motion/Keyframe.html#color" title="Keyframe.color" text="color A color object that adjusts the color transform in the target object."/>
<page href="fl/motion/Keyframe.html#filters" title="Keyframe.filters" text="filters An array that contains each filter object to be applied to the target object at a particular keyframe."/>
<page href="fl/motion/Keyframe.html#filters" title="Keyframe.filters" text="filters"/>
<page href="fl/motion/Keyframe.html#firstFrame" title="Keyframe.firstFrame" text="firstFrame Stores the name of the first frame for motion tweens, which affects graphic symbols only. This property is used in the Copy and Paste Motion feature in Flash CS3 but does not affect motion tweens defined using ActionScript. It is included here for compatibility with the Flex 2 compiler."/>
<page href="fl/motion/Keyframe.html#index" title="Keyframe.index" text="index The keyframe's unique time value in the motion tween. The first frame in a motion tween has an index of 0."/>
<page href="fl/motion/Keyframe.html#label" title="Keyframe.label" text="label A string used to describe the keyframe."/>
<page href="fl/motion/Keyframe.html#loop" title="Keyframe.loop" text="loop Stores the value of the Loop checkbox for motion tweens, which affects graphic symbols only. This property is used in the Copy and Paste Motion feature in Flash CS3 but does not affect motion tweens defined using ActionScript. It is included here for compatibility with the Flex 2 compiler."/>
<page href="fl/motion/Keyframe.html#orientToPath" title="Keyframe.orientToPath" text="orientToPath If set to true, this property causes the target object to rotate automatically to follow the angle of its path."/>
<page href="fl/motion/Keyframe.html#rotateDirection" title="Keyframe.rotateDirection" text="rotateDirection Controls how the target object rotates during a motion tween, with a value from the RotateDirection class."/>
<page href="fl/motion/Keyframe.html#rotateTimes" title="Keyframe.rotateTimes" text="rotateTimes Adds rotation to the target object during a motion tween, in addition to any existing rotation. This rotation is dependent on the value of the rotateDirection property, which must be set to RotateDirection.CW or RotateDirection.CCW. The rotateTimes value must be an integer that is equal to or greater than zero. For example, if the object would normally rotate from 0 to 40 degrees, setting rotateTimes to 1 and rotateDirection to RotateDirection.CW will add a full turn, for a total rotation of 400 degrees. If rotateDirection is set to RotateDirection.CCW, 360 degrees will be subtracted from the normal rotation, resulting in a counterclockwise turn of 320 degrees."/>
<page href="fl/motion/Keyframe.html#rotation" title="Keyframe.rotation" text="rotation Indicates the rotation of the target object in degrees from its original orientation as applied from the transformation point. A value of NaN means that the keyframe does not affect this property."/>
<page href="fl/motion/Keyframe.html#scaleX" title="Keyframe.scaleX" text="scaleX Indicates the horizontal scale as a percentage of the object as applied from the transformation point. A value of 1 is 100% of normal size. A value of NaN means that the keyframe does not affect this property."/>
<page href="fl/motion/Keyframe.html#scaleY" title="Keyframe.scaleY" text="scaleY Indicates the vertical scale as a percentage of the object as applied from the transformation point. A value of 1 is 100% of normal size. A value of NaN means that the keyframe does not affect this property."/>
<page href="fl/motion/Keyframe.html#skewX" title="Keyframe.skewX" text="skewX Indicates the horizontal skew angle of the target object in degrees as applied from the transformation point. A value of NaN means that the keyframe does not affect this property."/>
<page href="fl/motion/Keyframe.html#skewY" title="Keyframe.skewY" text="skewY Indicates the vertical skew angle of the target object in degrees as applied from the transformation point. A value of NaN means that the keyframe does not affect this property."/>
<page href="fl/motion/Keyframe.html#tweens" title="Keyframe.tweens" text="tweens An array that contains each tween object to be applied to the target object at a particular keyframe. One tween can target all animation properties (as with standard tweens on the Flash authoring tool's timeline), or multiple tweens can target individual properties (as with separate custom easing curves)."/>
<page href="fl/motion/Keyframe.html#tweens" title="Keyframe.tweens" text="tweens"/>
<page href="fl/motion/Keyframe.html#tweenScale" title="Keyframe.tweenScale" text="tweenScale A flag that controls whether scale will be interpolated during a tween. If false, the display object will stay the same size during the tween, until the next keyframe."/>
<page href="fl/motion/Keyframe.html#tweenSnap" title="Keyframe.tweenSnap" text="tweenSnap Stores the value of the Snap checkbox for motion tweens, which snaps the object to a motion guide. This property is used in the Copy and Paste Motion feature in Flash CS3 but does not affect motion tweens defined using ActionScript. It is included here for compatibility with the Flex 2 compiler."/>
<page href="fl/motion/Keyframe.html#tweenSync" title="Keyframe.tweenSync" text="tweenSync Stores the value of the Sync checkbox for motion tweens, which affects graphic symbols only. This property is used in the Copy and Paste Motion feature in Flash CS3 but does not affect motion tweens defined using ActionScript. It is included here for compatibility with the Flex 2 compiler."/>
<page href="fl/motion/Keyframe.html#x" title="Keyframe.x" text="x The horizontal position of the target object's transformation point in its parent's coordinate space. A value of NaN means that the keyframe does not affect this property."/>
<page href="fl/motion/Keyframe.html#y" title="Keyframe.y" text="y The vertical position of the target object's transformation point in its parent's coordinate space. A value of NaN means that the keyframe does not affect this property."/>
<page href="fl/motion/Source.html" title="Source class" text="Source The Source class stores information about the context in which a Motion instance was generated. Many of its properties do not affect animation created using ActionScript with the Animator class but are present to store data from the Motion XML. The transformationPoint property is the most important for an ActionScript Motion instance."/>
<page href="fl/motion/Source.html#Source()" title="Source.Source()" text="Source Constructor for Source instances. xml Optional E4X XML object defining a Source instance in Motion XML format."/>
<page href="fl/motion/Source.html#dimensions" title="Source.dimensions" text="dimensions Indicates the position and size of the bounding box of the object from which the Motion instance was generated. This property stores data from Motion XML but does not affect Motion instances created using ActionScript."/>
<page href="fl/motion/Source.html#elementType" title="Source.elementType" text="elementType Indicates the type of object from which the Motion instance was generated. Possible values are &quot;rectangle object&quot;, &quot;oval object&quot;, &quot;drawing object&quot;, &quot;group&quot;, &quot;bitmap&quot;, &quot;compiled clip&quot;, &quot;video&quot;, &quot;text&quot;"/>
<page href="fl/motion/Source.html#frameRate" title="Source.frameRate" text="frameRate Indicates the frames per second of the movie in which the Motion instance was generated. This property stores data from Motion XML but does not affect Motion instances created using ActionScript."/>
<page href="fl/motion/Source.html#instanceName" title="Source.instanceName" text="instanceName Indicates the instance name given to the movie clip from which the Motion instance was generated. This property stores data from Motion XML but does not affect Motion instances created using ActionScript."/>
<page href="fl/motion/Source.html#linkageID" title="Source.linkageID" text="linkageID Indicates the library linkage identifier for the symbol from which the Motion instance was generated. This property stores data from Motion XML but does not affect Motion instances created using ActionScript."/>
<page href="fl/motion/Source.html#rotation" title="Source.rotation" text="rotation Indicates the rotation value of the original object."/>
<page href="fl/motion/Source.html#scaleX" title="Source.scaleX" text="scaleX Indicates the scaleX value of the original object."/>
<page href="fl/motion/Source.html#scaleY" title="Source.scaleY" text="scaleY Indicates the scaleY value of the original object."/>
<page href="fl/motion/Source.html#skewX" title="Source.skewX" text="skewX Indicates the skewX value of the original object."/>
<page href="fl/motion/Source.html#skewY" title="Source.skewY" text="skewY Indicates the skewY value of the original object."/>
<page href="fl/motion/Source.html#symbolName" title="Source.symbolName" text="symbolName Indicates the name of the symbol from which the Motion instance was generated. This property stores data from Motion XML but does not affect Motion instances created using ActionScript."/>
<page href="fl/motion/Source.html#transformationPoint" title="Source.transformationPoint" text="transformationPoint Specifies the location of the transformation or &quot;pivot&quot; point of the original object, from which transformations are applied. The coordinates of the transformation point are defined as a percentage of the visual object's dimensions (its bounding box). If the transformation point is at the upper-left corner of the bounding box, the coordinates are (0, 0). The lower-right corner of the bounding box is (1, 1). This property allows the transformation point to be applied consistently to objects of different proportions and registration points. The transformation point can lie outside of the bounding box, in which case the coordinates may be less than 0 or greater than 1. This property has a strong effect on Motion instances created using ActionScript."/>
<page href="fl/motion/Source.html#x" title="Source.x" text="x Indicates the x value of the original object."/>
<page href="fl/motion/Source.html#y" title="Source.y" text="y Indicates the y value of the original object."/>
<page href="fl/motion/BezierEase.html" title="BezierEase class" text="BezierEase The BezierEase class provides precise easing control for a motion tween between two keyframes. You can apply an instance of this class to all properties of a keyframe at once, or you can define different curves for different properties. Both this class and the CustomEase class use one or more cubic Bezier curves to define the interpolation. However, the BezierEase class defines its coordinates slightly differently than the CustomEase class. The BezierEase class uses literal values for the y coordinates of the curve, rather than normalized values between 0 and 1. This allows you to create curves that cannot be created with custom easing. For example, you can create a curve where the start and end values are identical, but the curve rises and falls in between those values. Also, depending on the context, you may want to define the easing curve with literal values instead of percentages."/>
<page href="fl/motion/BezierEase.html#BezierEase()" title="BezierEase.BezierEase()" text="BezierEase Constructor for BezierEase instances. xml Optional E4X XML object defining a BezierEase in Motion XML format."/>
<page href="fl/motion/BezierEase.html#getValue()" title="BezierEase.getValue()" text="getValue Calculates an interpolated value for a numerical property of animation, using a Bezier easing curve. The percent value is read from the BezierEase instance's points property, rather than being passed into the method. Using the points property value allows the function signature to match the ITween interface. time begin change duration The time value, which must be between 0 and duration, inclusive. The unit can be freely chosen (for example, frames, seconds, milliseconds), but must match the duration unit. The value of the animation property at the start of the tween, when time is 0. The change in the value of the animation property over the course of the tween. This value can be positive or negative. For example, if an object rotates from 90 to 60 degrees, the change is -30. The length of time for the tween. This value must be greater than zero. The unit can be freely chosen (for example, frames, seconds, milliseconds), but must match the time unit."/>
<page href="fl/motion/BezierEase.html#points" title="BezierEase.points" text="points An ordered collection of points in the custom easing curve. Each item in the array is a flash.geom.Point instance, with x and y properties. The x coordinate of each point represents the time coordinate of the ease, as a percentage. The x value is normalized to fall between 0 and 1, where 0 is the beginning of the tween and 1 is the end of the tween. The y coordinate of each point contains the literal value of the animation property at that point in the ease. The y value is not normalized to fall between 0 and 1. The first and last points of the curve are not included in the array, because the first point is locked to the starting value, defined by the current keyframe, and the last point is locked to the ending value, defined by the next keyframe."/>
<page href="fl/motion/BezierEase.html#points" title="BezierEase.points" text="points"/>
<page href="fl/motion/BezierEase.html#target" title="BezierEase.target" text="target The name of the animation property to target."/>
<page href="fl/motion/easing/Sine.html" title="Sine class" text="Sine The Sine class defines three easing functions to implement motion with ActionScript animation. The acceleration of motion for a Sine easing equation is less than that for a Quadratic equation."/>
<page href="fl/motion/easing/Sine.html#easeIn()" title="Sine.easeIn()" text="easeIn The easeIn() method starts motion from zero velocity and then accelerates motion as it executes. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Sine.html#easeInOut()" title="Sine.easeInOut()" text="easeInOut The easeInOut() method combines the motion of the easeIn() and easeOut() methods to start the motion from a zero velocity, accelerate motion, then decelerate to a zero velocity. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Sine.html#easeOut()" title="Sine.easeOut()" text="easeOut The easeOut() method starts motion fast and then decelerates motion to a zero velocity as it executes. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Quadratic.html" title="Quadratic class" text="Quadratic The Quadratic class defines three easing functions to implement accelerated motion with ActionScript animations. The acceleration of motion for a Quadratic easing equation is the same as for a timeline tween at 100% easing and is less dramatic than for the Cubic easing equation."/>
<page href="fl/motion/easing/Quadratic.html#easeIn()" title="Quadratic.easeIn()" text="easeIn The easeIn() method starts motion from a zero velocity and then accelerates motion as it executes. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Quadratic.html#easeInOut()" title="Quadratic.easeInOut()" text="easeInOut The easeInOut() method combines the motion of the easeIn() and easeOut() methods to start the motion from a zero velocity, accelerate motion, then decelerate to a zero velocity. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Quadratic.html#easeOut()" title="Quadratic.easeOut()" text="easeOut The easeOut() method starts motion fast and then decelerates motion to a zero velocity as it executes. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Elastic.html" title="Elastic class" text="Elastic The Elastic class defines three easing functions to implement motion with ActionScript animation, where the motion is defined by an exponentially decaying sine wave."/>
<page href="fl/motion/easing/Elastic.html#easeIn()" title="Elastic.easeIn()" text="easeIn The easeIn() method starts motion slowly and then accelerates motion as it executes. t b c d a p Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion. Specifies the amplitude of the sine wave. Specifies the period of the sine wave."/>
<page href="fl/motion/easing/Elastic.html#easeInOut()" title="Elastic.easeInOut()" text="easeInOut The easeInOut() method combines the motion of the easeIn() and easeOut() methods to start the motion slowly, accelerate motion, then decelerate. t b c d a p Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion. Specifies the amplitude of the sine wave. Specifies the period of the sine wave."/>
<page href="fl/motion/easing/Elastic.html#easeOut()" title="Elastic.easeOut()" text="easeOut The easeOut() method starts motion fast and then decelerates motion as it executes. t b c d a p Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion. Specifies the amplitude of the sine wave. Specifies the period of the sine wave."/>
<page href="fl/motion/easing/Quintic.html" title="Quintic class" text="Quintic The Quintic class defines three easing functions to implement motion with ActionScript animation. The acceleration of motion for a Quintic easing equation is greater than for a Quartic easing equation."/>
<page href="fl/motion/easing/Quintic.html#easeIn()" title="Quintic.easeIn()" text="easeIn The easeIn() method starts motion from zero velocity and then accelerates motion as it executes. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Quintic.html#easeInOut()" title="Quintic.easeInOut()" text="easeInOut The easeInOut() method combines the motion of the easeIn() and easeOut() methods to start the motion from a zero velocity, accelerate motion, then decelerate to a zero velocity. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Quintic.html#easeOut()" title="Quintic.easeOut()" text="easeOut The easeOut() method starts motion fast and then decelerates motion to a zero velocity as it executes. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Cubic.html" title="Cubic class" text="Cubic The Cubic class defines three easing functions to implement motion with ActionScript animation. The acceleration of motion for a Cubic easing equation is greater than for a Quadratic easing equation."/>
<page href="fl/motion/easing/Cubic.html#easeIn()" title="Cubic.easeIn()" text="easeIn The easeIn() method starts motion from zero velocity and then accelerates motion as it executes. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Cubic.html#easeInOut()" title="Cubic.easeInOut()" text="easeInOut The easeInOut() method combines the motion of the easeIn() and easeOut() methods to start the motion from a zero velocity, accelerate motion, then decelerate to a zero velocity. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Cubic.html#easeOut()" title="Cubic.easeOut()" text="easeOut The easeOut() method starts motion fast and then decelerates motion to a zero velocity as it executes. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Quartic.html" title="Quartic class" text="Quartic The Quartic class defines three easing functions to implement motion with ActionScript animation. The acceleration of motion for a Quartic easing equation is greater than for a Cubic easing equation."/>
<page href="fl/motion/easing/Quartic.html#easeIn()" title="Quartic.easeIn()" text="easeIn The easeIn() method starts motion from zero velocity and then accelerates motion as it executes. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Quartic.html#easeInOut()" title="Quartic.easeInOut()" text="easeInOut The easeInOut() method combines the motion of the easeIn() and easeOut() methods to start the motion from a zero velocity, accelerate motion, then decelerate to a zero velocity. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Quartic.html#easeOut()" title="Quartic.easeOut()" text="easeOut The easeOut() method starts motion fast and then decelerates motion to a zero velocity as it executes. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Circular.html" title="Circular class" text="Circular The Circular class defines three easing functions to implement motion with ActionScript animation. The acceleration of motion for a Circular easing equation produces an abrupt change in velocity."/>
<page href="fl/motion/easing/Circular.html#easeIn()" title="Circular.easeIn()" text="easeIn The easeIn() method starts motion from zero velocity and then accelerates motion as it executes. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Circular.html#easeInOut()" title="Circular.easeInOut()" text="easeInOut The easeInOut() method combines the motion of the easeIn() and easeOut() methods to start the motion from a zero velocity, accelerate motion, then decelerate to a zero velocity. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Circular.html#easeOut()" title="Circular.easeOut()" text="easeOut The easeOut() method starts motion fast and then decelerates motion to a zero velocity as it executes. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Bounce.html" title="Bounce class" text="Bounce The Bounce class defines three easing functions to implement bouncing motion with ActionScript animation, similar to a ball falling and bouncing on a floor with several decaying rebounds."/>
<page href="fl/motion/easing/Bounce.html#easeIn()" title="Bounce.easeIn()" text="easeIn The easeIn() method starts the bounce motion slowly and then accelerates motion as it executes. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Bounce.html#easeInOut()" title="Bounce.easeInOut()" text="easeInOut The easeInOut() method combines the motion of the easeIn() and easeOut() methods to start the bounce motion slowly, accelerate motion, then decelerate. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Bounce.html#easeOut()" title="Bounce.easeOut()" text="easeOut The easeOut() method starts the bounce motion fast and then decelerates motion as it executes. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Linear.html" title="Linear class" text="Linear The Linear class defines easing functions to implement non-accelerated motion with ActionScript animations. Its methods all produce the same effect, a constant motion. The various names easeIn, easeOut and so on, are provided in the interest of polymorphism."/>
<page href="fl/motion/easing/Linear.html#easeIn()" title="Linear.easeIn()" text="easeIn The easeIn() method defines a constant motion with no acceleration. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Linear.html#easeInOut()" title="Linear.easeInOut()" text="easeInOut The easeInOut() method defines a constant motion with no acceleration. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Linear.html#easeNone()" title="Linear.easeNone()" text="easeNone The easeNone() method defines a constant motion with no acceleration. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Linear.html#easeOut()" title="Linear.easeOut()" text="easeOut The easeOut() method defines a constant motion with no acceleration. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Back.html" title="Back class" text="Back The Back class defines three easing functions to implement motion with ActionScript animations."/>
<page href="fl/motion/easing/Back.html#easeIn()" title="Back.easeIn()" text="easeIn The easeIn() method starts the motion by backtracking and then reversing direction and moving toward the target. t b c d s Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion. Specifies the amount of overshoot, where the higher the value, the greater the overshoot."/>
<page href="fl/motion/easing/Back.html#easeInOut()" title="Back.easeInOut()" text="easeInOut The easeInOut() method combines the motion of the easeIn() and easeOut() methods to start the motion by backtracking, then reversing direction and moving toward the target, overshooting the target slightly, reversing direction again, and then moving back toward the target. t b c d s Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion. Specifies the amount of overshoot, where the higher the value, the greater the overshoot."/>
<page href="fl/motion/easing/Back.html#easeOut()" title="Back.easeOut()" text="easeOut The easeOut() method starts the motion by moving towards the target, overshooting it slightly, and then reversing direction back toward the target. t b c d s Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion. Specifies the amount of overshoot, where the higher the value, the greater the overshoot."/>
<page href="fl/motion/easing/Exponential.html" title="Exponential class" text="Exponential The Exponential class defines three easing functions to implement motion with ActionScript animation. It produces an effect similar to the popular &quot;Zeno's paradox&quot; style of scripted easing, where each interval of time decreases the remaining distance by a constant proportion."/>
<page href="fl/motion/easing/Exponential.html#easeIn()" title="Exponential.easeIn()" text="easeIn The easeIn() method starts motion slowly and then accelerates motion as it executes. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial position of a component. Specifies the total change in position of the component. Specifies the duration of the effect, in milliseconds."/>
<page href="fl/motion/easing/Exponential.html#easeInOut()" title="Exponential.easeInOut()" text="easeInOut The easeInOut() method combines the motion of the easeIn() and easeOut() methods to start the motion from a zero velocity, accelerate motion, then decelerate to a zero velocity. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/motion/easing/Exponential.html#easeOut()" title="Exponential.easeOut()" text="easeOut The easeOut() method starts motion fast and then decelerates motion to a zero velocity as it executes. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="flash/xml/XMLNodeType.html" title="XMLNodeType class" text="XMLNodeType The XMLNodeType class contains constants used with XMLNode.nodeType. The values are defined by the NodeType enumeration in the W3C DOM Level 1 recommendation: http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html"/>
<page href="flash/xml/XMLNodeType.html#ELEMENT_NODE" title="XMLNodeType.ELEMENT_NODE" text="ELEMENT_NODE Specifies that the node is an element. This constant is used with XMLNode.nodeType. The value is defined by the NodeType enumeration in the W3C DOM Level 1 recommendation: http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html"/>
<page href="flash/xml/XMLNodeType.html#TEXT_NODE" title="XMLNodeType.TEXT_NODE" text="TEXT_NODE Specifies that the node is a text node. This constant is used with XMLNode.nodeType. The value is defined by the NodeType enumeration in the W3C DOM Level 1 recommendation: http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html"/>
<page href="flash/xml/XMLNode.html" title="XMLNode class" text="XMLNode The XMLNode class represents the legacy XML object that was present in ActionScript 2.0 and that was renamed in ActionScript 3.0. In ActionScript 3.0, consider using the new top-level XML class and related classes instead, which support E4X (ECMAScript for XML). The XMLNode class is present for backward compatibility."/>
<page href="flash/xml/XMLNode.html#XMLNode()" title="XMLNode.XMLNode()" text="XMLNode Creates a new XMLNode object. You must use the constructor to create an XMLNode object before you call any of the methods of the XMLNode class. Note: Use the createElement() and createTextNode() methods to add elements and text nodes to an XML document tree. type value The node type: either 1 for an XML element or 3 for a text node. The XML text parsed to create the new XMLNode object."/>
<page href="flash/xml/XMLNode.html#appendChild()" title="XMLNode.appendChild()" text="appendChild Appends the specified node to the XML object'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. node An XMLNode that represents the node to be moved from its current location to the child list of the my_xml object."/>
<page href="flash/xml/XMLNode.html#cloneNode()" title="XMLNode.cloneNode()" text="cloneNode Constructs 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'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. deep A Boolean value; if set to true, the children of the specified XML object will be recursively cloned."/>
<page href="flash/xml/XMLNode.html#getNamespaceForPrefix()" title="XMLNode.getNamespaceForPrefix()" text="getNamespaceForPrefix Returns the namespace URI that is associated with the specified prefix for the node. To determine the URI, getPrefixForNamespace() searches up the XML hierarchy from the node, as necessary, and returns the namespace URI of the first xmlns declaration for the given prefix. If no namespace is defined for the specified prefix, the method returns null. If you specify an empty string (&quot;&quot;) as the prefix and there is a default namespace defined for the node (as in xmlns=&quot;http://www.example.com/&quot;), the method returns that default namespace URI. prefix The prefix for which the method returns the associated namespace."/>
<page href="flash/xml/XMLNode.html#getPrefixForNamespace()" title="XMLNode.getPrefixForNamespace()" text="getPrefixForNamespace Returns the prefix that is associated with the specified namespace URI for the node. To determine the prefix, getPrefixForNamespace() searches up the XML hierarchy from the node, as necessary, and returns the prefix of the first xmlns declaration with a namespace URI that matches ns. If there is no xmlns assignment for the given URI, the method returns null. If there is an xmlns assignment for the given URI but no prefix is associated with the assignment, the method returns an empty string (&quot;&quot;). ns The namespace URI for which the method returns the associated prefix."/>
<page href="flash/xml/XMLNode.html#hasChildNodes()" title="XMLNode.hasChildNodes()" text="hasChildNodes Indicates whether the specified XMLNode object has child nodes. This property is true if the specified XMLNode object has child nodes; otherwise, it is false."/>
<page href="flash/xml/XMLNode.html#insertBefore()" title="XMLNode.insertBefore()" text="insertBefore Inserts a new child node into the XML object's child list, before the beforeNode node. If the beforeNode parameter is undefined or null, the node is added using the appendChild() method. If beforeNode is not a child of my_xml, the insertion fails. node before The XMLNode object to be inserted. The XMLNode object before the insertion point for the childNode."/>
<page href="flash/xml/XMLNode.html#removeNode()" title="XMLNode.removeNode()" text="removeNode Removes the specified XML object from its parent. Also deletes all descendants of the node."/>
<page href="flash/xml/XMLNode.html#toString()" title="XMLNode.toString()" text="toString Evaluates the specified XMLNode 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 XMLDocument objects (those created with the constructor), the XMLDocument.toString() method outputs the document's XML declaration (stored in the XMLDocument.xmlDecl property), followed by the document's DOCTYPE declaration (stored in the XMLDocument.docTypeDecl property), followed by the text representation of all XML nodes in the object. The XML declaration is not output if the XMLDocument.xmlDecl property is null. The DOCTYPE declaration is not output if the XMLDocument.docTypeDecl property is null."/>
<page href="flash/xml/XMLNode.html#attributes" title="XMLNode.attributes" text="attributes An object containing all of the attributes of the specified XMLNode instance. The XMLNode.attributes object contains one variable for each attribute of the XMLNode 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's value by specifying color as the property name, as the following code shows: var myColor:String = doc.firstChild.attributes.color"/>
<page href="flash/xml/XMLNode.html#childNodes" title="XMLNode.childNodes" text="childNodes An array of the specified XMLNode object's children. Each element in the array is a reference to an XMLNode 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)."/>
<page href="flash/xml/XMLNode.html#firstChild" title="XMLNode.firstChild" text="firstChild Evaluates the specified XMLDocument object and references the first child in the parent node'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."/>
<page href="flash/xml/XMLNode.html#lastChild" title="XMLNode.lastChild" text="lastChild An XMLNode value that references the last child in the node's child list. The XMLNode.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."/>
<page href="flash/xml/XMLNode.html#localName" title="XMLNode.localName" text="localName The local name portion of the XML node's name. This is the element name without the namespace prefix. For example, the node &lt;contact:mailbox/&gt;bob@example.com&lt;/contact:mailbox&gt; has the local name &quot;mailbox&quot;, and the prefix &quot;contact&quot;, which comprise the full element name &quot;contact.mailbox&quot;. You can access the namespace prefix through the prefix property of the XML node object. The nodeName property returns the full name (including the prefix and the local name)."/>
<page href="flash/xml/XMLNode.html#namespaceURI" title="XMLNode.namespaceURI" text="namespaceURI If the XML node has a prefix, namespaceURI is the value of the xmlns declaration for that prefix (the URI), which is typically called the namespace URI. The xmlns declaration is in the current node or in a node higher in the XML hierarchy. If the XML node does not have a prefix, the value of the namespaceURI property depends on whether there is a default namespace defined (as in xmlns=&quot;http://www.example.com/&quot;). If there is a default namespace, the value of the namespaceURI property is the value of the default namespace. If there is no default namespace, the namespaceURI property for that node is an empty string (&quot;&quot;). You can use the getNamespaceForPrefix() method to identify the namespace associated with a specific prefix. The namespaceURI property returns the prefix associated with the node name."/>
<page href="flash/xml/XMLNode.html#nextSibling" title="XMLNode.nextSibling" text="nextSibling An XMLNode value that references the next sibling in the parent node'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."/>
<page href="flash/xml/XMLNode.html#nodeName" title="XMLNode.nodeName" text="nodeName A string representing the node name of the XMLNode object. If the XMLNode 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 XMLNode object is a text node (nodeType == 3), nodeName is null."/>
<page href="flash/xml/XMLNode.html#nodeType" title="XMLNode.nodeType" text="nodeType A nodeType constant value, either XMLNodeType.ELEMENT_NODE for an XML element or XMLNodeType.TEXT_NODE for a text node. The nodeType is a numeric value from the NodeType enumeration in the W3C DOM Level 1 recommendation: http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html. The following table lists the values: Integer valueDefined constant1ELEMENT_NODE2ATTRIBUTE_NODE 3TEXT_NODE4CDATA_SECTION_NODE 5ENTITY_REFERENCE_NODE6ENTITY_NODE 7PROCESSING_INSTRUCTION_NODE8COMMENT_NODE 9DOCUMENT_NODE10DOCUMENT_TYPE_NODE 11DOCUMENT_FRAGMENT_NODE12NOTATION_NODE In Flash Player, the built-in XMLNode class only supports XMLNodeType.ELEMENT_NODE and XMLNodeType.TEXT_NODE."/>
<page href="flash/xml/XMLNode.html#nodeValue" title="XMLNode.nodeValue" text="nodeValue The node value of the XMLDocument object. If the XMLDocument object is a text node, the nodeType is 3, and the nodeValue is the text of the node. If the XMLDocument object is an XML element (nodeType is 1), nodeValue is null and read-only."/>
<page href="flash/xml/XMLNode.html#parentNode" title="XMLNode.parentNode" text="parentNode 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."/>
<page href="flash/xml/XMLNode.html#prefix" title="XMLNode.prefix" text="prefix The prefix portion of the XML node name. For example, the node &lt;contact:mailbox/&gt;bob@example.com&lt;/contact:mailbox&gt; prefix &quot;contact&quot; and the local name &quot;mailbox&quot;, which comprise the full element name &quot;contact.mailbox&quot;. The nodeName property of an XML node object returns the full name (including the prefix and the local name). You can access the local name portion of the element's name via the localName property."/>
<page href="flash/xml/XMLNode.html#previousSibling" title="XMLNode.previousSibling" text="previousSibling An XMLNode value that references the previous sibling in the parent node'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."/>
<page href="flash/xml/XMLDocument.html" title="XMLDocument class" text="XMLDocument The XMLDocument class represents the legacy XML object that was present in ActionScript 2.0. It was renamed in ActionScript 3.0 to XMLDocument to avoid name conflicts with the new XML class in ActionScript 3.0. In ActionScript 3.0, it is recommended that you use the new XML class and related classes, which support E4X (ECMAScript for XML). The XMLDocument class, as well as XMLNode and XMLNodeType, are present for backward compatibility. The functionality for loading XML documents can now be found in the URLLoader class."/>
<page href="flash/xml/XMLDocument.html#XMLDocument()" title="XMLDocument.XMLDocument()" text="XMLDocument Creates a new XMLDocument object. You must use the constructor to create an XMLDocument object before you call any of the methods of the XMLDocument class. Note: Use the createElement() and createTextNode() methods to add elements and text nodes to an XML document tree. source The XML text parsed to create the new XMLDocument object."/>
<page href="flash/xml/XMLDocument.html#createElement()" title="XMLDocument.createElement()" text="createElement Creates a new XMLNode object with the name specified in the parameter. The new node initially has no parent, no children, and no siblings. The method returns a reference to the newly created XMLNode object that represents the element. This method and the XMLDocument.createTextNode() method are the constructor methods for creating nodes for an XMLDocument object. name The tag name of the XMLDocument element being created."/>
<page href="flash/xml/XMLDocument.html#createTextNode()" title="XMLDocument.createTextNode()" text="createTextNode Creates 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 XMLDocument object that represents the new text node. This method and the XMLDocument.createElement() method are the constructor methods for creating nodes for an XMLDocument object. text The text used to create the new text node."/>
<page href="flash/xml/XMLDocument.html#parseXML()" title="XMLDocument.parseXML()" text="parseXML Parses the XML text specified in the value parameter and populates the specified XMLDocument object with the resulting XML tree. Any existing trees in the XMLDocument object are discarded. source The XML text to be parsed and passed to the specified XMLDocument object."/>
<page href="flash/xml/XMLDocument.html#toString()" title="XMLDocument.toString()" text="toString Returns a string representation of the XML object."/>
<page href="flash/xml/XMLDocument.html#docTypeDecl" title="XMLDocument.docTypeDecl" text="docTypeDecl Specifies information about the XML document's DOCTYPE declaration. After the XML text has been parsed into an XMLDocument object, the XMLDocument.docTypeDecl property of the XMLDocument object is set to the text of the XML document's DOCTYPE declaration (for example, &lt;!DOCTYPE greeting SYSTEM &quot;hello.dtd&quot;&gt;). This property is set using a string representation of the DOCTYPE declaration, not an XMLNode object. The legacy ActionScript XML parser is not a validating parser. The DOCTYPE declaration is read by the parser and stored in the XMLDocument.docTypeDecl property, but no DTD validation is performed. If no DOCTYPE declaration was encountered during a parse operation, the XMLDocument.docTypeDecl property is set to null. 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 XMLDocument.docTypeDecl is null, no DOCTYPE declaration is output."/>
<page href="flash/xml/XMLDocument.html#idMap" title="XMLDocument.idMap" text="idMap An Object containing the nodes of the XML that have an id attribute assigned. The names of the properties of the object (each containing a node) match the values of the id attributes. Consider the following XMLDocument object: &lt;employee id='41'&gt; &lt;name&gt; John Doe &lt;/name&gt; &lt;address&gt; 601 Townsend St. &lt;/address&gt; &lt;/employee&gt; &lt;employee id='42'&gt; &lt;name&gt; Jane Q. Public &lt;/name&gt; &lt;/employee&gt; &lt;department id=&quot;IT&quot;&gt; Information Technology &lt;/department&gt; In this example, the idMap property for this XMLDocument object is an Object with three properties: 41, 42, and IT. Each of these properties is an XMLNode that has the matching id value. For example, the IT property of the idMap object is this node: &lt;department id=&quot;IT&quot;&gt; Information Technology &lt;/department&gt; You must use the parseXML() method on the XMLDocument object for the idMap property to be instantiated. If there is more than one XMLNode with the same id value, the matching property of the idNode object is that of the last node parsed. For example: var x1:XML = new XMLDocument(&quot;&lt;a id='1'&gt;&lt;b id='2' /&gt;&lt;c id='1' /&gt;&lt;/a&gt;&quot;); x2 = new XMLDocument(); x2.parseXML(x1); trace(x2.idMap['1']); This will output the &lt;c&gt; node: &lt;c id='1' /&gt;"/>
<page href="flash/xml/XMLDocument.html#ignoreWhite" title="XMLDocument.ignoreWhite" text="ignoreWhite 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. The default setting is false. You can set the ignoreWhite property for individual XMLDocument objects, as the following code shows: my_xml.ignoreWhite = true;"/>
<page href="flash/xml/XMLDocument.html#xmlDecl" title="XMLDocument.xmlDecl" text="xmlDecl A string that specifies information about a document's XML declaration. After the XML document is parsed into an XMLDocument object, this property is set to the text of the document's XML declaration. This property is set using a string representation of the XML declaration, not an XMLNode object. If no XML declaration is encountered during a parse operation, the property is set to null. The XMLDocument.toString() method outputs the contents of the XML.xmlDecl property before any other text in the XML object. If the XML.xmlDecl property contains null, no XML declaration is output."/>
<page href="flash/net/URLRequestMethod.html" title="URLRequestMethod class" text="URLRequestMethod The URLRequestMethod class provides values that specify whether the URLRequest object should use the POST method or the GET method when sending data to a server."/>
<page href="flash/net/URLRequestMethod.html#GET" title="URLRequestMethod.GET" text="GET Specifies that the URLRequest object is a GET."/>
<page href="flash/net/URLRequestMethod.html#POST" title="URLRequestMethod.POST" text="POST Specifies that the URLRequest object is a POST."/>
<page href="flash/net/LocalConnection.html" title="LocalConnection class" text="LocalConnection The LocalConnection class lets you create a LocalConnection object that can invoke a method in another LocalConnection object, either within a single SWF file or between multiple SWF files. Local connections enable this kind of communication between SWF files without the use of fscommand() or JavaScript. LocalConnection objects can communicate only among SWF files that are running on the same client computer, but they can be running in different applications — for example, a SWF file running in a browser and a SWF file running in a projector. (A projector is a SWF file saved in a format that can run as a stand-alone application — that is, without Flash Player.) LocalConnection objects created in ActionScript 3.0 can communicate with LocalConnection objects created in ActionScript 1.0 or 2.0. The reverse is also true: LocalConnection objects created in ActionScript 1.0 or 2.0 can communicate with LocalConnection objects created in ActionScript 3.0. Flash Player handles this communication between LocalConnection objects of different versions automatically. To understand how to use LocalConnection objects to implement communication between two SWF files, it is helpful to identify the commands used in each file. One SWF file is called the sending SWF file; it is the file that contains the method to be invoked. The sending SWF file must contain a LocalConnection object and a call to the send() method. The other SWF file is called the receiving SWF file; it is the file that invokes the method. The receiving SWF file must contain another LocalConnection object and a call to the connect() method. Your use of send() and connect() differs depending on whether the SWF files are in the same domain, in different domains with predictable domain names, or in different domains with unpredictable or dynamic domain names. The following paragraphs explain the three different situations, with code samples for each. Same domain. This is the simplest way to use a LocalConnection object, to allow communication only between LocalConnection objects that are located in the same domain, because Flash Player allows same-domain communication by default. When two SWF files from the same domain communicate, you do not need to implement any special security measures, and you simply pass the same value for the connectionName parameter to both the connect() and send() methods: Different domains with predictable domain names. When two SWF files from different domains communicate, you need to allow communication between the two domains by calling the allowDomain() method. You also need to qualify the connection name in the send() method with the receiving LocalConnection object's domain name: Different domains with unpredictable domain names. Sometimes, you might want to make the SWF file with the receiving LocalConnection object more portable between domains. To avoid specifying the domain name in the send() method, but to indicate to Flash Player that the receiving and sending LocalConnection objects are not in the same domain, precede the connection name with an underscore (_), in both the connect() and send() calls. To allow communication between the two domains, call the allowDomain() method and pass the domains from which you want to allow LocalConnection calls. Alternatively, pass the wildcard ( argument to allow calls from all domains: You can use LocalConnection objects to send and receive data within a single SWF file, but this is not a typical implementation. For more information about the send() and connect() methods, see the discussion of the connectionName parameter in the LocalConnection.send() and LocalConnection.connect()entries. Also, see the allowDomain() and domain entries."/>
<page href="flash/net/LocalConnection.html#LocalConnection()" title="LocalConnection.LocalConnection()" text="LocalConnection Creates a LocalConnection object. You can use LocalConnection objects to enable communication between different SWF files that are running on the same client computer."/>
<page href="flash/net/LocalConnection.html#allowDomain()" title="LocalConnection.allowDomain()" text="allowDomain Specifies one or more domains that can send LocalConnection calls to this LocalConnection instance. You cannot 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 the allowInsecureDomain() method instead. You may want to use this method so that a child SWF file from a different domain can make LocalConnection calls to the parent SWF file, without knowing the final domain from which the child SWF file will come. This can happen, for example, when you use load-balancing redirects or third-party servers. In this situation, you can use the url property of the LoaderInfo object used with the load, to get the domain to use with the allowDomain() method. For example, if you use a Loader object to load a child SWF file, once the file is loaded, you can check the contentLoaderInfo.url property of the Loader object, and parse the domain out of the full URL string. If you do this, make sure that you wait until the SWF file is loaded, because the contentLoaderInfo.url property will not have its final, correct value until the file is completely loaded. The opposite situation can also occur: you might create a child SWF file that wants to accept LocalConnection calls from its parent but doesn't know the domain of its parent. In this situation, implement this method by checking whether the domain argument matches the domain of the loaderInfo.url property in the loaded SWF file. Again, you must parse the domain out of the full URL from loaderInfo.url. In this situation, you don't have to wait for the parent SWF file to load; the parent will already be loaded by the time the child loads. When using this method, consider the Flash Player security model. By default, a LocalConnection object is associated with the sandbox of the SWF file that created it, and cross-domain calls to LocalConnection objects are not allowed unless you call the LocalConnection.allowDomain() method in the receiving SWF file. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper Note: The allowDomain() method has changed from the form it had in ActionScript 1.0 and 2.0. In those earlier versions, allowDomain was a callback method that you implemented. In ActionScript 3.0, allowDomain() is a built-in method of LocalConnection that you call. With this change, allowDomain() works in much the same way as flash.system.Security.allowDomain(). domains One or more strings that name the domains from which you want to allow LocalConnection calls. This parameter has two special cases: You can specify a wildcard character &quot;~~&quot; to allow calls from all domains. You can specify the string &quot;localhost&quot; to allow calls to this SWF file from SWF files that are installed locally. Flash Player 8 introduced security restrictions on local SWF files. By default, a SWF file that is allowed to access the Internet cannot also have access to the local file system. If you specify &quot;localhost&quot;, any local SWF file can access this SWF file. All parameters specified must be non-null strings."/>
<page href="flash/net/LocalConnection.html#allowInsecureDomain()" title="LocalConnection.allowInsecureDomain()" text="allowInsecureDomain Specifies one or more domains that can send LocalConnection calls to this LocalConnection object. The allowInsecureDomain() method works just like the allowDomain() method, except that the allowInsecureDomain() method additionally permits SWF files from non-HTTPS origins to send LocalConnection calls to SWF files from HTTPS origins. This difference is meaningful only if you call the allowInsecureDomain() method from a SWF file that was loaded using HTTPS. You must call the allowInsecureDomain() method even if you are crossing a non-HTTPS/HTTPS boundary within the same domain; by default, LocalConnection calls are never permitted from non-HTTPS SWF files to HTTPS SWF files, even within the same domain. Calling allowInsecureDomain() is not recommended, because it can compromise the security offered by HTTPS. When you load a SWF file over HTTPS, you can be reasonably sure that that SWF file will not be tampered with during delivery over the network. If you then permit a non-HTTPS SWF file to make LocalConnection calls to the HTTPS SWF file, you are accepting calls from a SWF file that may in fact have been tampered with during delivery. This generally requires extra vigilance because you cannot trust the authenticity of LocalConnection calls arriving at your HTTPS 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. Using this method to override the default behavior is not recommended, because it compromises HTTPS security. However, you might need to do so, for example, if you need to permit access to HTTPS files published for Flash Player 9 or later from HTTP files published for Flash Player 6 or earlier. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper domains One or more strings that name the domains from which you want to allow LocalConnection calls. There are two special cases for this parameter: You can specify the wildcard character &quot;~~&quot; to allow calls from all domains. Specifying &quot;~~&quot; does not include local hosts. You can specify the string &quot;localhost&quot; to allow calls to this SWF file from SWF files that are installed locally. Flash Player 8 introduced security restrictions on local SWF files. A SWF file that is allowed to access the Internet cannot also have access to the local file system. If you specify &quot;localhost&quot;, any local SWF file can access this SWF file. Remember that you must also designate the calling SWF file as a local-with-networking SWF file at authoring time. All parameters specified must be non-null strings."/>
<page href="flash/net/LocalConnection.html#close()" title="LocalConnection.close()" text="close Closes (disconnects) a LocalConnection object. Issue this command when you no longer want the object to accept commands — for example, when you want to issue a connect() command using the same connectionName parameter in another SWF file. The LocalConnection instance is not connected, so it cannot be closed."/>
<page href="flash/net/LocalConnection.html#connect()" title="LocalConnection.connect()" text="connect Prepares a LocalConnection object to receive commands from a send() command (called the sending LocalConnection object). The object used with this command is called the receiving LocalConnection object. The receiving and sending objects must be running on the same client computer. To avoid a race condition, define the methods attached to the receiving LocalConnection object before calling this method, as shown in the LocalConnection class example. By default, Flash Player resolves connectionName into a value of &quot;superdomain:connectionName&quot;, where superdomain is the superdomain of the SWF file that contains the connect() command. For example, if the SWF file that contains the receiving LocalConnection object is located at www.someDomain.com, connectionName resolves to &quot;someDomain.com:connectionName&quot;. (If a SWF file is located on the client computer, the value assigned to superdomain is &quot;localhost&quot;.) Also by default, Flash Player lets the receiving LocalConnection object accept commands only from sending LocalConnection objects whose connection name also resolves into a value of &quot;superdomain:connectionName&quot;. In this way, Flash makes it simple for SWF files that are located in the same domain to communicate with each other. If you are implementing communication only between SWF files in the same domain, specify a string for connectionName that does not begin with an underscore (_) and that does not specify a domain name (for example, &quot;myDomain:connectionName&quot;). Use the same string in the connect(connectionName) method. If you are implementing communication between SWF files in different domains, specifying a string for connectionName that begins with an underscore (_) makes the SWF file with the receiving LocalConnection object more portable between domains. Here are the two possible cases: If the string for connectionNamedoes not begin with an underscore (_), Flash Player adds a prefix with the superdomain and a colon (for example, &quot;myDomain:connectionName&quot;). Although this ensures that your connection does not conflict with connections of the same name from other domains, any sending LocalConnection objects must specify this superdomain (for example, &quot;myDomain:connectionName&quot;). If the SWF file with the receiving LocalConnection object is moved to another domain, the player changes the prefix to reflect the new superdomain (for example, &quot;anotherDomain:connectionName&quot;). All sending LocalConnection objects would have to be manually edited to point to the new superdomain. If the string for connectionNamebegins with an underscore (for example, &quot;_connectionName&quot;), Flash Player does not add a prefix to the string. This means that the receiving and sending LocalConnection objects use identical strings for connectionName. If the receiving object uses allowDomain() to specify that connections from any domain will be accepted, the SWF file with the receiving LocalConnection object can be moved to another domain without altering any sending LocalConnection objects. For more information, see the discussion in the class overview and the discussion of connectionName in send(), and also the allowDomain() and domain entries. Note: Colons are used as special characters to separate the superdomain from the connectionName string. A string for connectionName that contains a colon is not valid. When using this method, consider the Flash Player security model. By default, a LocalConnection object is associated with the sandbox of the SWF file that created it, and cross-domain calls to LocalConnection objects are not allowed unless you call the LocalConnection.allowDomain() method in the receiving SWF file. 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. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper connectionName A string that corresponds to the connection name specified in the send() command that wants to communicate with the receiving LocalConnection object. The value passed to the connectionName parameter must be non-null."/>
<page href="flash/net/LocalConnection.html#send()" title="LocalConnection.send()" text="send Invokes the method named methodName on a connection opened with the connect(connectionName) method (the receiving LocalConnection object). The object used with this command is called the sending LocalConnection object. The SWF files that contain the sending and receiving objects must be running on the same client computer. There is a 40 kilobyte limit to the amount of data you can pass as parameters to this command. If send() throws an ArgumentError but your syntax is correct, try dividing the send() requests into multiple commands, each with less than 40K of data. As discussed in the connect() entry, Flash Player adds the current superdomain to connectionName by default. If you are implementing communication between different domains, you need to define connectionName in both the sending and receiving LocalConnection objects in such a way that Flash does not add the current superdomain to connectionName. You can do this in one of the following two ways: Use an underscore (_) at the beginning of connectionName in both the sending and receiving LocalConnection objects. In the SWF file that contains the receiving object, use LocalConnection.allowDomain() to specify that connections from any domain will be accepted. This implementation lets you store your sending and receiving SWF files in any domain. Include the superdomain in connectionName in the sending LocalConnection object — for example, myDomain.com:myConnectionName. In the receiving object, use LocalConnection.allowDomain() to specify that connections from the specified superdomain will be accepted (in this case, myDomain.com) or that connections from any domain will be accepted. Note: You cannot specify a superdomain in connectionName in the receiving LocalConnection object — you can do this in only the sending LocalConnection object. When using this method, consider the Flash Player security model. By default, a LocalConnection object is associated with the sandbox of the SWF file that created it, and cross-domain calls to LocalConnection objects are not allowed unless you call the LocalConnection.allowDomain() method in the receiving SWF file. 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. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper connectionName methodName arguments Corresponds to the connection name specified in the connect() command that wants to communicate with the sending LocalConnection object. The name of the method to be invoked in the receiving LocalConnection object. The following method names cause the command to fail: send, connect, close, allowDomain, allowInsecureDomain, client, and domain. Additional optional parameters to be passed to the specified method. The value of either connectionName or methodName is null. Pass non-null values for these parameters."/>
<page href="flash/net/LocalConnection.html#client" title="LocalConnection.client" text="client Indicates the object on which callback methods are invoked. The default object is this, the local connection being created. You can set the client property to another object, and callback methods are invoked on that other object. The client property must be set to a non-null object."/>
<page href="flash/net/LocalConnection.html#domain" title="LocalConnection.domain" text="domain A string representing the domain of the location of the current SWF file. In SWF files published for Flash Player 9 or later, the returned string is the exact domain of the current SWF file, including subdomains. For example, if the SWF file is located at www.adobe.com, this command returns &quot;www.adobe.com&quot;. If the current SWF file is a local file residing on the client computer, this command returns &quot;localhost&quot;. The most common ways to use this property are to include the domain name of the sending LocalConnection object as a parameter to the method you plan to invoke in the receiving LocalConnection object, or to use it with LocalConnection.allowDomain() to accept commands from a specified domain. If you are enabling communication only between LocalConnection objects that are located in the same domain, you probably don't need to use this property."/>
<page href="flash/net/LocalConnection.html#event:asyncError" title="LocalConnection.asyncError" text="asyncError Dispatched when an exception is thrown asynchronously — that is, from native asynchronous code."/>
<page href="flash/net/LocalConnection.html#event:securityError" title="LocalConnection.securityError" text="securityError Dispatched if a call to LocalConnection.send() attempts to send data to a different security sandbox."/>
<page href="flash/net/LocalConnection.html#event:status" title="LocalConnection.status" text="status Dispatched when a LocalConnection object reports its status. If LocalConnection.send() is successful, the value of the status event object's level property is &quot;status&quot;; if the call fails, the level property is &quot;error&quot;. If the receiving SWF file refuses the connection, the call can fail without notification to the sending SWF file."/>
<page href="flash/net/FileFilter.html" title="FileFilter class" text="FileFilter The FileFilter class is used to indicate what files on the user's system are shown in the file-browsing dialog box that is displayed when FileReference.browse() or FileReferenceList.browse() is called. FileFilter instances are passed to a browse() function. If you use a FileFilter instance, extensions and file types that aren't specified in the FileFilter instance are filtered out; that is, they are not available to the user to select for uploading. If no FileFilter object is passed to browse(), all files are shown in the dialog box. You can use FileFilter instances in one of two ways: A description with Windows file extensions only A description with Windows file extensions and Macintosh file types The two formats are not interchangeable within a single browse() call. You must use one or the other. You can pass one or more FileFilter instances to FileReference.browse() or FileReferenceList.browse(). The following examples show different ways to create and pass FileFilter instances to a browse() call (for Windows only). The first example creates FileFilter instances outside of the browse() call: var imagesFilter:FileFilter = new FileFilter(&quot;Images&quot;, &quot;~~.jpg;~~.gif;~~.png&quot;); var docFilter:FileFilter = new FileFilter(&quot;Documents&quot;, &quot;~~.pdf;~~.doc;~~.txt&quot;); var myFileReference:FileReference = new FileReference(); myFileReference.browse([imagesFilter, docFilter]); The second example creates FileFilter instances within the browse() call: myFileReference.browse( [ new FileFilter(&quot;Images&quot;, &quot;~~.jpg;~~.gif;~~.png&quot;), new FileFilter(&quot;Flash Movies&quot;, &quot;~~.swf&quot;) ] ); The list of extensions in the FileFilter.extension property is used to filter the files in Windows, depending on the file selected by the user. It is not actually displayed in the dialog box; to display the file types for users, you must list the file types in the description string as well as in the extension list. The description string is displayed in the dialog box in Windows. (It is not used on the Macintosh.) On the Macintosh, if you supply a list of Macintosh file types, that list is used to filter the files. If not, the list of Windows extensions is used."/>
<page href="flash/net/FileFilter.html#FileFilter()" title="FileFilter.FileFilter()" text="FileFilter Creates a new FileFilter instance. description extension macType The description string that is visible to users when they select files for uploading. A list of file extensions that indicate which Windows file formats are visible to users when they select files for uploading. A list of Macintosh file types that indicate which file types are visible to users when they select files for uploading. If no value is passed, this parameter is set to null."/>
<page href="flash/net/FileFilter.html#description" title="FileFilter.description" text="description The description string for the filter. The description is visible to the user in the dialog box that opens when FileReference.browse() or FileReferenceList.browse() is called. The description string contains a string, such as &quot;Images (~~.gif, ~~.jpg, ~~.png)&quot;, that can help instruct the user on what file types can be uploaded or downloaded. Note that the actual file types that are supported by this FileReference object are stored in the extension property."/>
<page href="flash/net/FileFilter.html#extension" title="FileFilter.extension" text="extension A list of file extensions. This list indicates the types of files that you want to show in the file-browsing dialog box. (The list is not visible to the user; the user sees only the value of the description property.) The extension property contains a semicolon-delimited list of Windows file extensions, with a wildcard (~~) preceding each extension, as shown in the following string: &quot;~~.jpg;~~.gif;~~.png&quot;."/>
<page href="flash/net/FileFilter.html#macType" title="FileFilter.macType" text="macType A list of Macintosh file types. This list indicates the types of files that you want to show in the file-browsing dialog box. (This list itself is not visible to the user; the user sees only the value of the description property.) The macType property contains a semicolon-delimited list of Macintosh file types, as shown in the following string: &quot;JPEG;jp2_;GIFF&quot;."/>
<page href="flash/net/Responder.html" title="Responder class" text="Responder The Responder class provides an object that is used in NetConnection.call() to handle return values from the server related to the success or failure of specific operations. When working with NetConnection.call(), you may encounter a network operation fault specific to the current operation or a fault related to the current connection status. Operation errors target the Responder object instead of the NetConnection object for easier error handling."/>
<page href="flash/net/Responder.html#Responder()" title="Responder.Responder()" text="Responder Creates a new Responder object. You pass a Responder object to NetConnection.call() to handle return values from the server. You may pass null for either or both parameters. result status The function invoked if the call to the server succeeds and returns a result. The function invoked if the server returns an error."/>
<page href="flash/net/FileReferenceList.html" title="FileReferenceList class" text="FileReferenceList The FileReferenceList class provides a means to let users select one or more files for uploading. A FileReferenceList object represents a group of one or more local files on the user's disk as an array of FileReference objects. For detailed information and important considerations about FileReference objects and the FileReference class, which you use with FileReferenceList, see the FileReference class. To work with the FileReferenceList class: Instantiate the class: var myFileRef = new FileReferenceList(); Call the FileReferenceList.browse() method, which opens a dialog box that lets the user select one or more files for upload: myFileRef.browse(); After the browse() method is called successfully, the fileList property of the FileReferenceList object is populated with an array of FileReference objects. Call FileReference.upload() on each element in the fileList array. The FileReferenceList class includes a browse() method and a fileList property for working with multiple files. While a call to FileReferenceList.browse() is executing, SWF file playback pauses on stand-alone and external players for Linux and Mac OS X 10.1 and earlier."/>
<page href="flash/net/FileReferenceList.html#FileReferenceList()" title="FileReferenceList.FileReferenceList()" text="FileReferenceList Creates a new FileReferenceList object. A FileReferenceList object contains nothing until you call the browse() method on it and the user selects one or more files. When you call browse() on the FileReference object, the fileList property of the object is populated with an array of FileReference objects."/>
<page href="flash/net/FileReferenceList.html#browse()" title="FileReferenceList.browse()" text="browse Displays a file-browsing dialog box that lets the user select one or more local files to upload. The dialog box is native to the user's operating system. When you call this method and the user successfully selects files, the fileList property of this FileReferenceList object is populated with an array of FileReference objects, one for each file that the user selects. Each subsequent time that the FileReferenceList.browse() method is called, the FileReferenceList.fileList property is reset to the file(s) that the user selects in the dialog box. Using the typeFilter parameter, you can determine which files the dialog box displays. Only one FileReference.browse(), FileReference.download(), or FileReferenceList.browse() session can be performed at a time on a FileReferenceList object (because only one dialog box can be opened at a time). typeFilter An array of FileFilter instances used to filter the files that are displayed in the dialog box. If you omit this parameter, all files are displayed. For more information, see the FileFilter class. Thrown for the following reasons: 1) Another FileReference or FileReferenceList browse session is in progress; only one file browsing session may be performed at a time. 2) A setting in the user's mms.cfg file prohibits this operation."/>
<page href="flash/net/FileReferenceList.html#fileList" title="FileReferenceList.fileList" text="fileList An array of FileReference objects. When the FileReferenceList.browse() method is called and the user has selected one or more files from the dialog box that the browse() method opens, this property is populated with an array of FileReference objects, each of which represents the files the user selected. You can then use this array to upload each file with the FileReference.upload()method. You must upload one file at a time. The fileList property is populated anew each time browse() is called on that FileReferenceList object. The properties of FileReference objects are described in the FileReference class documentation."/>
<page href="flash/net/FileReferenceList.html#event:cancel" title="FileReferenceList.cancel" text="cancel Dispatched when the user dismisses the file-browsing dialog box. (This dialog box opens when you call the FileReferenceList.browse(), FileReference.browse(), or FileReference.download() methods.)"/>
<page href="flash/net/FileReferenceList.html#event:select" title="FileReferenceList.select" text="select Dispatched when the user selects one or more files to upload from the file-browsing dialog box. (This dialog box opens when you call the FileReferenceList.browse(), FileReference.browse(), or FileReference.download() methods.) When the user selects a file and confirms the operation (for example, by clicking Save), the FileReferenceList object is populated with FileReference objects that represent the files that the user selects."/>
<page href="flash/net/IDynamicPropertyOutput.html" title="IDynamicPropertyOutput interface" text="IDynamicPropertyOutput This interface controls the serialization of dynamic properties of dynamic objects. You use this interface with the IDynamicPropertyWriter interface and the ObjectEncoding.dynamicPropertyWriter property."/>
<page href="flash/net/IDynamicPropertyOutput.html#writeDynamicProperty()" title="IDynamicPropertyOutput.writeDynamicProperty()" text="writeDynamicProperty Adds a dynamic property to the binary output of a serialized object. When the object is subsequently read (using a method such as readObject), it contains the new property. You can use this method to exclude properties of dynamic objects from serialization; to write values to properties of dynamic objects; or to create new properties for dynamic objects. name value The name of the property. You can use this parameter either to specify the name of an existing property of the dynamic object or to create a new property. The value to write to the specified property."/>
<page href="flash/net/URLVariables.html" title="URLVariables class" text="URLVariables The URLVariables class allows you to transfer variables between a Flash® application and a server. Use URLVariables objects with methods of the URLLoader class, with the data property of the URLRequest class, and with flash.net package functions."/>
<page href="flash/net/URLVariables.html#URLVariables()" title="URLVariables.URLVariables()" text="URLVariables Creates a new URLVariables object. You pass URLVariables objects to the data property of URLRequest objects. If you call the URLVariables constructor with a string, the decode() method is automatically called to convert the string to properties of the URLVariables object. source A URL-encoded string containing name/value pairs."/>
<page href="flash/net/URLVariables.html#decode()" title="URLVariables.decode()" text="decode Converts the variable string to properties of the specified URLVariables object. This method is used internally by the URLVariables events. Most users do not need to call this method directly. source A URL-encoded query string containing name/value pairs. The source parameter must be a URL-encoded query string containing name/value pairs."/>
<page href="flash/net/URLVariables.html#toString()" title="URLVariables.toString()" text="toString Returns a string containing all enumerable variables, in the MIME content encoding application/x-www-form-urlencoded."/>
<page href="flash/net/SharedObject.html" title="SharedObject class" text="SharedObject The SharedObject class is used to read and store limited amounts of data on a user's computer or on a server. Shared objects offer real-time data sharing between multiple client SWF files and objects that are persistent on the local computer or remote server. Local shared objects are similar to browser cookies and remote shared objects are similar to real-time data transfer devices. To use remote shared objects, you need Adobe Flash Media Server. Use shared objects to do the following: Maintain local persistence. This is the simplest way to use a shared object, and does not require Flash Media Server. For example, you can call SharedObject.getLocal() to create a shared object in a Flash Player application, such as a calculator with memory. When the user closes the calculator, Flash Player saves the last value in a shared object on the user's computer. The next time the calculator is run, it contains the values it had previously. Alternatively, if you set the shared object's properties to null before the calculator application is closed, the next time the application runs, it opens without any values. Another example of maintaining local persistence is tracking user preferences or other data for a complex website, such as a record of which articles a user read on a news site. Tracking this information would allow you to display articles that have already been read differently from new, unread articles. Storing this information on the user's computer reduces server load. Store and share data on Flash Media Server. A shared object can store data on the server for other clients to retrieve. For example, call SharedObject.getRemote() to create a remote shared object, such as a phone list, that is persistent on the server. Whenever a client makes changes to the shared object, the revised data is available to all clients currently connected to the object or who later connect to it. If the object is also persistent locally, and a client changes data while not connected to the server, the data is copied to the remote shared object the next time the client connects to the object. Share data in real time. A shared object can share data among multiple clients in real time. For example, you can open a remote shared object that stores a list of users connected to a chat room that is visible to all clients connected to the object. When a user enters or leaves the chat room, the object is updated and all clients that are connected to the object see the revised list of chat room users. To create a local shared object, call SharedObject.getLocal(). To create a remote shared object, call SharedObject.getRemote(). When an application closes, shared objects are flushed, or written to a disk. You can also call the flush() method to explicitly write data to a disk. Local disk space considerations. Local shared objects have some limitations that are important to consider as you design your application. Sometimes SWF files may not be allowed to write local shared objects, and sometimes the data stored in local shared objects can be deleted without your knowledge. Flash Player users can manage the disk space that is available to individual domains or to all domains. When users decrease the amount of disk space available, some local shared objects may be deleted. Flash Player users also have privacy controls that can prevent third-party domains (domains other than the domain in the current browser address bar) from reading or writing local shared objects. Note: SWF files that are stored and run on a local computer, not from a remote server, can always write third-party shared objects to disk. For more information about third-party shared objects, see the Global Storage Settings panel in Flash Player Help. It's a good idea to check for failures related to the amount of disk space and to user privacy controls. Perform these checks when you call getLocal() and flush(): SharedObject.getLocal() — Flash Player throws an exception when a call to this method fails, such as when the user has disabled third-party shared objects and the domain of your SWF file does not match the domain in the browser address bar. SharedObject.flush() — Flash Player throws an exception when a call to this method fails. It returns SharedObjectFlushStatus.FLUSHED when it succeeds. It returns SharedObjectFlushStatus.PENDING when additional storage space is needed. Flash Player prompts the user to allow an increase in storage space for locally saved information. Thereafter, the netStatus event is dispatched with an information object indicating whether the flush failed or succeeded. If your SWF file attempts to create or modify local shared objects, make sure that your SWF file is at least 215 pixels wide and at least 138 pixels high (the minimum dimensions for displaying the dialog box that prompts users to increase their local shared object storage limit). If your SWF file is smaller than these dimensions and an increase in the storage limit is required, SharedObject.flush() fails, returning SharedObjectFlushedStatus.PENDING and dispatching the netStatus event. Remote shared objects. With Flash Media Server, you can create and use remote shared objects, that are shared in real-time by all clients connected to your application. When one client changes a property of a remote shared object, the property is changed for all connected clients. You can use remote shared objects to synchronize clients, for example, users in a multi-player game. Each remote shared object has a data property which is an Object with properties that store data. Call setProperty() to change an property of the data object. The server updates the properties, dispatches a sync event, and sends the properties back to the connected clients. You can choose to make remote shared objects persistent on the client, the server, or both. By default, Flash Player saves locally persistent remote shared objects up to 100K in size. When you try to save a larger object, Flash Player displays the Local Storage dialog box, which lets the user allow or deny local storage for the shared object. Make sure your Stage size is at least 215 by 138 pixels; this is the minimum size Flash requires to display the dialog box. If the user selects Allow, the server saves the shared object and dispatches a netStatus event with a code property of SharedObject.Flush.Success. If the user select Deny, the server does not save the shared object and dispatches a netStatus event with a code property of SharedObject.Flush.Failed."/>
<page href="flash/net/SharedObject.html#clear()" title="SharedObject.clear()" text="clear For local shared objects, purges all of the data and deletes the shared object from the disk. The reference to the shared object is still active, but its data properties are deleted. For remote shared objects used with Flash Media Server, clear() disconnects the object and purges all of the data. If the shared object is locally persistent, this method also deletes the shared object from the disk. The reference to the shared object is still active, but its data properties are deleted. The following code creates (and on subsequent executions, retrieves) a SharedObject object using an id with the value of hostName. A property named username is added to the data property of the SharedObject object. The clear() method is finally called, which wipes out all information that was added to the data object (in this case was a single property named username). package { import flash.net.SharedObject; public class SharedObject_clear { private var hostName:String = &quot;yourDomain&quot;; private var username:String = &quot;yourUsername&quot;; public function SharedObject_clear() { var mySo:SharedObject = SharedObject.getLocal(hostName); if(mySo.data.username == null) { mySo.data.username = username; trace(&quot;set: &quot; + mySo.data.username); // yourUsername } else { mySo.clear(); trace(&quot;cleared: &quot; + mySo.data.username); // undefined } } } }"/>
<page href="flash/net/SharedObject.html#close()" title="SharedObject.close()" text="close Closes the connection between a remote shared object and the server. If a remote shared object is locally persistent, the user can make changes to the local copy of the object after this method is called. Any changes made to the local object are sent to the server the next time the user connects to the remote shared object."/>
<page href="flash/net/SharedObject.html#connect()" title="SharedObject.connect()" text="connect Connects to a remote shared object on a server through a specified NetConnection object. Use this method after calling getRemote(). When a connection is successful, the sync event is dispatched. Before attempting to work with a remote shared object, first check for any errors using a try..catch..finally statement. Then, listen for and handle the sync event before you make changes to the shared object. Any changes made locally — before the sync event is dispatched — might be lost. Call the connect() method to connect to a remote shared object, for example: var myRemoteSO:SharedObject = SharedObject.getRemote(&quot;mo&quot;, myNC.uri, false); myRemoteSO.connect(myNC); myConnection params A NetConnection object that uses the Real-Time Messaging Protocol (RTMP), such as a NetConnection object used to communicate with Flash Media Server. A string defining a message to pass to the remote shared object on the server. Cannot be used with Flash Media Server. Flash Player could not connect to the specified remote shared object. Verify that the NetConnection instance is valid and connected and that the remote shared object was successfully created on the server."/>
<page href="flash/net/SharedObject.html#flush()" title="SharedObject.flush()" text="flush Immediately writes a locally persistent shared object to a local file. If you don't use this method, Flash Player writes the shared object to a file when the shared object session ends — that is, when the SWF file is closed, when the shared object is garbage-collected because it no longer has any references to it, or when you call SharedObject.clear() or SharedObject.close(). If this method returns SharedObjectFlushStatus.PENDING, Flash Player displays a dialog box asking the user to increase the amount of disk space available to objects from this domain. To allow space for the shared object to grow when it is saved in the future, which avoids return values of PENDING, pass a value for minDiskSpace. When Flash Player tries to write the file, it looks for the number of bytes passed to minDiskSpace, instead of looking for enough space to save the shared object at its current size. For example, if you expect a shared object to grow to a maximum size of 500 bytes, even though it might start out much smaller, pass 500 for minDiskSpace. If Flash asks the user to allot disk space for the shared object, it asks for 500 bytes. After the user allots the requested amount of space, Flash won't have to ask for more space on future attempts to flush the object (as long as its size doesn't exceed 500 bytes). After the user responds to the dialog box, this method is called again. A netStatus event is dispatched with a code property of SharedObject.Flush.Success or SharedObject.Flush.Failed. minDiskSpace The minimum disk space, in bytes, that must be allotted for this object. The following code creates (and on subsequent executions, retrieves) a SharedObject object using an id with the value of hostName. A property named username is added to the data property of the SharedObject object. The flush() method is then called, followed by a check to see if the string pending, or a boolean value of true or false was returned. One should be aware that all open SharedObject instances will automatically be flushed whenever the current instance of the Flash Player is closed. package { import flash.net.SharedObject; public class SharedObject_flush { private var hostName:String = &quot;yourDomain&quot;; private var username:String = &quot;yourUsername&quot;; public function SharedObject_flush() { var mySo:SharedObject = SharedObject.getLocal(hostName); mySo.data.username = username; var flushResult:Object = mySo.flush(); trace(&quot;flushResult: &quot; + flushResult); trace(mySo.data.username); // yourUsername } } } Flash Player cannot write the shared object to disk. This error might occur if the user has permanently disallowed local information storage for objects from this domain. Note: Local content can always write shared objects from third-party domains (domains other than the domain in the current browser address bar) to disk, even if writing of third-party shared objects to disk is disallowed."/>
<page href="flash/net/SharedObject.html#getLocal()" title="SharedObject.getLocal()" text="getLocal Returns a reference to a locally persistent shared object that is only available to the current client. If the shared object does not already exist, this method creates one. If any values passed to getLocal() are invalid or if the call fails, Flash Player throws an exception. The following code shows how you assign the returned shared object reference to a variable: var so:SharedObject = SharedObject.getLocal(&quot;savedData&quot;); Note: If the user has chosen to never allow local storage for this domain, the object is not saved locally, even if a value for localPath is specified. The exception to this rule is local content. Local content can always write shared objects from third-party domains (domains other than the domain in the current browser address bar) to disk, even if writing of third-party shared objects to disk is disallowed. To avoid name conflicts, Flash looks at the location of the SWF file creating the shared object. For example, if a SWF file at www.myCompany.com/apps/stockwatcher.swf creates a shared object named portfolio, that shared object does not conflict with another object named portfolio that was created by a SWF file at www.yourCompany.com/photoshoot.swf because the SWF files originate from different directories. Although the localPath parameter is optional, you should give some thought to its use, especially if other SWF files need to access the shared object. If the data in the shared object is specific to one SWF file that will not be moved to another location, then use of the default value makes sense. If other SWF files need access to the shared object, or if the SWF file that creates the shared object will later be moved, then the value of this parameter affects how accessible the shared object will be. For example, if you create a shared object with localPath set to the default value of the full path to the SWF file, no other SWF file can access that shared object. If you later move the original SWF file to another location, not even that SWF file can access the data already stored in the shared object. To avoid inadvertently restricting access to a shared object, use the localpath parameter. The most permissive approach is to set localPath to / (slash), which makes the shared object available to all SWF files in the domain, but increases the likelihood of name conflicts with other shared objects in the domain. A more restrictive approach is to append localPath with folder names that are in the full path to the SWF file. For example, for a portfolio shared object created by the SWF file at www.myCompany.com/apps/stockwatcher.swf, you could set the localPath parameter to /, /apps, or /apps/stockwatcher.swf. You must determine which approach provides optimal flexibility for your application. When using this method, consider the Flash Player security model: You cannot access shared objects across sandbox boundaries. Users can restrict shared object access by using the Flash Player Settings dialog box or the Settings Manager. By default, an application can create shared objects of up 100 KB of data per domain. Administrators and users can also place restrictions on the ability to write to the file system. Suppose you publish SWF file content to be played back as local files (either locally installed SWF files or EXE files), and you need to access a specific shared object from more than one local SWF file. In this situation, be aware that for local files, two different locations might be used to store shared objects. The domain that is used depends on the security permissions granted to the local file that created the shared object. Local files can have three different levels of permissions: Access to the local filesystem only. Access to the network only. Access to both the network and the local filesystem. Local files with access to the local filesystem (level 1 or 3) store their shared objects in one location. Local files without access to the local filesystem (level 2) store their shared objects in another location. 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. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper name localPath secure The name of the object. The name can include forward slashes (/); for example, work/addresses is a legal name. Spaces are not allowed in a shared object name, nor are the following characters: ~ % &amp; \ ; : &quot; ' , &lt; &gt; ? # The full or partial path to the SWF file that created the shared object, and that determines where the shared object will be stored locally. If you do not specify this parameter, the full path is used. Determines whether access to this shared object is restricted to SWF files that are delivered over an HTTPS connection. If your SWF file is delivered over HTTPS, this parameter's value has the following effects: If this parameter is set to true, Flash Player creates a new secure shared object or gets a reference to an existing secure shared object. This secure shared object can be read from or written to only by SWF files delivered over HTTPS that call SharedObject.getLocal() with the secure parameter set to true. If this parameter is set to false, Flash Player creates a new shared object or gets a reference to an existing shared object that can be read from or written to by SWF files delivered over non-HTTPS connections. If your SWF file is delivered over a non-HTTPS connection and you try to set this parameter to true, the creation of a new shared object (or the access of a previously created secure shared object) fails and null is returned. Regardless of the value of this parameter, the created shared objects count toward the total amount of disk space allowed for a domain. The following diagram shows the use of the secure parameter: Flash Player cannot create the shared object for whatever reason. This error might occur is if persistent shared object creation and storage by third-party Flash content is prohibited (does not apply to local content). Users can prohibit third-party persistent shared objects on the Global Storage Settings panel of the Settings Manager, located at http://www.adobe.com/support/documentation/en/flashplayer/help/settings_manager03.html."/>
<page href="flash/net/SharedObject.html#getRemote()" title="SharedObject.getRemote()" text="getRemote Returns a reference to a shared object on Flash Media Server that multiple clients can access. If the remote shared object does not already exist, this method creates one. To create a remote shared object, call getRemote() the call connect() to connect the remote shared object to the server, as in the following: var nc:NetConnection = new NetConnection(); nc.connect(&quot;rtmp://somedomain.com/applicationName&quot;); var myRemoteSO:SharedObject = SharedObject.getRemote(&quot;mo&quot;, nc.uri, false); myRemoteSO.connect(nc); To confirm that the local and remote copies of the shared object are synchronized, listen for and handle the sync event. All clients that want to share this object must pass the same values for the name and remotePath parameters. To create a shared object that is available only to the current client, use SharedObject.getLocal(). name remotePath persistence secure The name of the remote shared object. The name can include forward slashes (/); for example, work/addresses is a legal name. Spaces are not allowed in a shared object name, nor are the following characters: ~ % &amp; \ ; : &quot; ' , &gt; ? ? # The URI of the server on which the shared object will be stored. This URI must be identical to the URI of the NetConnection object passed to the connect() method. Specifies whether the attributes of the shared object's data property are persistent locally, remotely, or both. This parameter can also specify where the shared object will be stored locally. Acceptable values are as follows: A value of false specifies that the shared object is not persistent on the client or server. A value of true specifies that the shared object is persistent only on the server. A full or partial local path to the shared object indicates that the shared object is persistent on the client and the server. On the client, it is stored in the specified path; on the server, it is stored in a subdirectory within the application directory. Note: If the user has chosen to never allow local storage for this domain, the object will not be saved locally, even if a local path is specified for persistence. For more information, see the class description. Determines whether access to this shared object is restricted to SWF files that are delivered over an HTTPS connection. For more information, see the description of the secure parameter in the getLocal method entry. Flash Player can't create or find the shared object. This might occur if nonexistent paths were specified for the remotePath and persistence parameters."/>
<page href="flash/net/SharedObject.html#send()" title="SharedObject.send()" text="send Broadcasts a message to all clients connected to a remote shared object, including the client that sent the message. To process and respond to the message, create a callback function attached to the shared object. arguments One or more arguments: A string that identifies the message, the name of one or more handler functions to attach to the shared object, and optional parameters of any type. The handler name can be only one level deep (that is, it can't be of the form parent/child) and is relative to the shared object. The arguments are serialized and sent over the connection, and the receiving handler receives them in the same order. If a parameter is a circular object (for example, a linked list that is circular), the serializer handles the references correctly. Note: Do not use a reserved term for the function names. For example, myRemoteSO.send(&quot;close&quot;) will fail."/>
<page href="flash/net/SharedObject.html#setDirty()" title="SharedObject.setDirty()" text="setDirty Indicates to the server that the value of a property in the shared object has changed. This method marks properties as dirty, which means changed. Call the SharedObject.setProperty() to create properties for a shared object. The SharedObject.setProperty() method implements setDirty(). In most cases, such as when the value of a property is a primitive type like String or Number, you can call setProperty() instead of calling setDirty(). However, when the value of a property is an object that contains its own properties, call setDirty() to indicate when a value within the object has changed. propertyName The name of the property that has changed."/>
<page href="flash/net/SharedObject.html#setProperty()" title="SharedObject.setProperty()" text="setProperty Updates the value of a property in a shared object and indicates to the server that the value of the property has changed. The setProperty() method explicitly marks properties as changed, or dirty. For more information about remote shared objects see the Flash Media Server documentation. Note: The SharedObject.setProperty() method implements the setDirty() method. In most cases, such as when the value of a property is a primitive type like String or Number, you would use setProperty() instead of setDirty. However, when the value of a property is an object that contains its own properties, use setDirty() to indicate when a value within the object has changed. In general, it is a good idea to call setProperty() rather than setDirty(), because setProperty() updates a property value only when that value has changed, whereas setDirty() forces synchronization on all subscribed clients. propertyName value The name of the property in the shared object. The value of the property (an ActionScript object), or null to delete the property."/>
<page href="flash/net/SharedObject.html#client" title="SharedObject.client" text="client Indicates the object on which callback methods are invoked. The default object is this. You can set the client property to another object, and callback methods will be invoked on that other object. The client property must be set to a non-null object."/>
<page href="flash/net/SharedObject.html#data" title="SharedObject.data" text="data The collection of attributes assigned to the data property of the object; these attributes can be shared and stored. Each attribute can be an object of any ActionScript or JavaScript type — Array, Number, Boolean, ByteArray, XML, and so on. For example, the following lines assign values to various aspects of a shared object: var items_array:Array = new Array(101, 346, 483); var 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]); } All attributes of a shared object's data property are saved if the object is persistent, and the shared object contains the following information: userName: Ramona adminPrivileges: true itemNumbers: 101,346,483 Note: Do not assign values directly to the data property of a shared object, as in so.data = someValue; Flash Player 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 Blue favoriteNightClub: The Bluenote Tavern favoriteColor: blue data: [object Object] For remote shared objects used with a server, all attributes of the data property are available to all clients connected to the shared object, and all attributes are saved if the object is persistent. If one client changes the value of an attribute, all clients now see the new value."/>
<page href="flash/net/SharedObject.html#defaultObjectEncoding" title="SharedObject.defaultObjectEncoding" text="defaultObjectEncoding The default object encoding (AMF version) for all local shared objects created in the SWF file. When local shared objects are written to disk, the SharedObject.defaultObjectEncoding property indicates which Action Message Format version should be used: the ActionScript 3.0 format (AMF3) or the ActionScript 1.0 or 2.0 format (AMF0). For more information about object encoding, including the difference between encoding in local and remote shared objects, see the description of the objectEncoding property. The default value of SharedObject.defaultObjectEncoding is set to use the ActionScript 3.0 format, AMF3. If you need to write local shared objects that ActionScript 2.0 or 1.0 SWF files can read, set SharedObject.defaultObjectEncoding to use the ActionScript 1.0 or ActionScript 2.0 format, flash.net.ObjectEncoding.AMF0, at the beginning of your script, before you create any local shared objects. All local shared objects created thereafter will use AMF0 encoding and can interact with older content. You cannot change the objectEncoding value of existing local shared objects by setting SharedObject.defaultObjectEncoding after the local shared objects have been created. To set the object encoding on a per-object basis, rather than for all shared objects created by the SWF file, set the objectEncoding property of the local shared object instead."/>
<page href="flash/net/SharedObject.html#fps" title="SharedObject.fps" text="fps Specifies the number of times per second that a client's changes to a shared object are sent to the server. Use this method when you want to control the amount of traffic between the client and the server. For example, if the connection between the client and server is relatively slow, you may want to set fps to a relatively low value. Conversely, if the client is connected to a multiuser application in which timing is important, you may want to set fps to a relatively high value. Setting fps will trigger a sync event and update all changes to the server. If you only want to update the server manually, set fps to 0. Changes are not sent to the server until the sync event has been dispatched. That is, if the response time from the server is slow, updates may be sent to the server less frequently than the value specified in this property."/>
<page href="flash/net/SharedObject.html#objectEncoding" title="SharedObject.objectEncoding" text="objectEncoding The object encoding (AMF version) for this shared object. When a local shared object is written to disk, the objectEncoding property indicates which Action Message Format version should be used: the ActionScript 3.0 format (AMF3) or the ActionScript 1.0 or 2.0 format (AMF0). Object encoding is handled differently depending if the shared object is local or remote. Local shared objects. You can get or set the value of the objectEncoding property for local shared objects. The value of objectEncoding affects what formatting is used for writing this local shared object. If this local shared object must be readable by ActionScript 2.0 or 1.0 SWF files, set objectEncoding to ObjectEncoding.AMF0. Even if object encoding is set to write AMF3, Flash Player can still read AMF0 local shared objects. That is, if you use the default value of this property, ObjectEncoding.AMF3, your SWF file can still read shared objects created by ActionScript 2.0 or 1.0 SWF files. Remote shared objects. When connected to the server, a remote shared object inherits its objectEncoding setting from the associated NetConnection instance (the instance used to connect to the remote shared object). When not connected to the server, a remote shared object inherits the defaultObjectEncoding setting from the associated NetConnection instance. Because the value of a remote shared object's objectEncoding property is determined by the NetConnection instance, this property is read-only for remote shared objects. You attempted to set the value of the objectEncoding property on a remote shared object. This property is read-only for remote shared objects because its value is determined by the associated NetConnection instance."/>
<page href="flash/net/SharedObject.html#size" title="SharedObject.size" text="size 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. The following code creates a SharedObject object using an id &quot;thehobbit&quot;. A property named username is added to the data property of the SharedObject object. The size property is then traced, which returns the value indicated. import flash.net.SharedObject; // if these get copied or not var mySo:SharedObject = SharedObject.getLocal(&quot;thehobbit&quot;); mySo.data.username = &quot;bilbobaggins&quot;; trace(mySo.size); // 55"/>
<page href="flash/net/SharedObject.html#event:asyncError" title="SharedObject.asyncError" text="asyncError Dispatched when an exception is thrown asynchronously — that is, from native asynchronous code."/>
<page href="flash/net/SharedObject.html#event:netStatus" title="SharedObject.netStatus" text="netStatus Dispatched when a SharedObject instance is reporting its status or error condition. The netStatus event contains an info property, which is an information object that contains specific information about the event, such as whether a connection attempt succeeded or whether the shared object was successfully written to the local disk."/>
<page href="flash/net/SharedObject.html#event:sync" title="SharedObject.sync" text="sync Dispatched when a remote shared object has been updated by the server."/>
<page href="flash/net/URLRequestHeader.html" title="URLRequestHeader class" text="URLRequestHeader A URLRequestHeader object encapsulates a single HTTP request header and consists of a name/value pair. URLRequestHeader objects are used in the requestHeaders property of the URLRequest class. The following request headers cannot be used, and the restricted terms are not case-sensitive (for example, Get, get, and GET are all not allowed). Also, hyphenated terms apply if an underscore character is used (for example, both Content-Length and Content_Length are not allowed): Accept-Charset, Accept-Encoding, Accept-Ranges, Age, Allow, Allowed, Authorization, Charge-To, Connect, Connection, Content-Length, Content-Location, Content-Range, Cookie, Date, Delete, ETag, Expect, Get, Head, Host, Keep-Alive, Last-Modified, Location, Max-Forwards, Options, Post, Proxy-Authenticate, Proxy-Authorization, Proxy-Connection, Public, Put, Range, Referer, Request-Range, Retry-After, Server, TE, Trace, Trailer, Transfer-Encoding, Upgrade, URI, User-Agent, Vary, Via, Warning, WWW-Authenticate, x-flash-version. URLRequestHeader objects are restricted in length. If the cumulative length of a URLRequestHeader object (the length of the name property plus the value property) or an array of URLRequestHeader objects used in the URLRequest.requestHeaders property exceeds the acceptable length, Adobe® Flash® Player throws an exception."/>
<page href="flash/net/URLRequestHeader.html#URLRequestHeader()" title="URLRequestHeader.URLRequestHeader()" text="URLRequestHeader Creates a new URLRequestHeader object that encapsulates a single HTTP request header. URLRequestHeader objects are used in the requestHeaders property of the URLRequest class. name value An HTTP request header name (such as Content-Type or SOAPAction). The value associated with the name property (such as text/plain)."/>
<page href="flash/net/URLRequestHeader.html#name" title="URLRequestHeader.name" text="name An HTTP request header name (such as Content-Type or SOAPAction)."/>
<page href="flash/net/URLRequestHeader.html#value" title="URLRequestHeader.value" text="value The value associated with the name property (such as text/plain)."/>
<page href="flash/net/FileReference.html" title="FileReference class" text="FileReference The FileReference class provides a means to upload and download files between a user's computer and a server. An operating-system dialog box prompts the user to select a file to upload or a location for download. Each FileReference object refers to a single file on the user's disk and has properties that contain information about the file's size, type, name, creation date, modification date, and creator type (Macintosh only). FileReference instances are created in two ways: When you use the new operator with the FileReference constructor: var myFileReference = new FileReference(); When you call the FileReferenceList.browse() method, which creates an array of FileReference objects. During an upload operation, all the properties of a FileReference object are populated by calls to the FileReference.browse() or FileReferenceList.browse() methods. During a download operation, the name property is populated when the select event is dispatched; all other properties are populated when the complete event is dispatched. The browse() method opens an operating-system dialog box that prompts the user to select a file for upload. The FileReference.browse() method lets the user select a single file; the FileReferenceList.browse() method lets the user select multiple files. After a successful call to the browse() method, call the FileReference.upload() method to upload one file at a time. The FileReference.download() method prompts the user for a location to save the file and initiates downloading from a remote URL. The FileReference and FileReferenceList classes do not let you set the default file location for the dialog box that the browse() or download() methods generate. The default location shown in the dialog box is the most recently browsed folder, if that location can be determined, or the desktop. The classes do not allow you to read from or write to the transferred file. They do not allow the SWF file that initiated the upload or download to access the uploaded or downloaded file or the file's location on the user's disk. The FileReference and FileReferenceList classes also do not provide methods for authentication. With servers that require authentication, you can download files with the Flash® Player browser plug-in, but uploading (on all players) and downloading (on the stand-alone or external player) fails. Listen for FileReference events to determine whether operations complete successfully and to handle errors. For uploading and downloading operations, a SWF file can access files only within its own domain, including any domains that a cross-domain policy file specifies. Put a policy file on the file server if the SWF initiating the upload or download doesn't come from the same domain as the file server. While calls to the FileReference.browse(), FileReferenceList.browse(), or FileReference.download() methods are executing, SWF file playback pauses on stand-alone and external players for Linux and Mac OS X 10.1 and earlier. The following sample HTTP POST request is sent from Flash Player to a server-side script if no parameters are specified: POST /handler.cfm HTTP/1.1 Accept: text/~~ Content-Type: multipart/form-data; boundary=----------Ij5ae0ae0KM7GI3KM7ei4cH2ei4gL6 User-Agent: Shockwave Flash Host: www.example.com Content-Length: 421 Connection: Keep-Alive Cache-Control: no-cache ------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7 Content-Disposition: form-data; name=&quot;Filename&quot; MyFile.jpg ------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7 Content-Disposition: form-data; name=&quot;photo&quot;; filename=&quot;MyFile.jpg&quot; Content-Type: application/octet-stream FileDataHere ------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7 Content-Disposition: form-data; name=&quot;Upload&quot; Submit Query ------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7-- Flash Player sends the following HTTP POST request if the user specifies the parameters &quot;api_sig&quot;, &quot;api_key&quot;, and &quot;auth_token&quot;: POST /handler.cfm HTTP/1.1 Accept: text/~~ Content-Type: multipart/form-data; boundary=----------Ij5ae0ae0KM7GI3KM7ei4cH2ei4gL6 User-Agent: Shockwave Flash Host: www.example.com Content-Length: 421 Connection: Keep-Alive Cache-Control: no-cache ------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7 Content-Disposition: form-data; name=&quot;Filename&quot; MyFile.jpg ------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7 Content-Disposition: form-data; name=&quot;api_sig&quot; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7 Content-Disposition: form-data; name=&quot;api_key&quot; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7 Content-Disposition: form-data; name=&quot;auth_token&quot; XXXXXXXXXXXXXXXXXXXXXX ------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7 Content-Disposition: form-data; name=&quot;photo&quot;; filename=&quot;MyFile.jpg&quot; Content-Type: application/octet-stream FileDataHere ------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7 Content-Disposition: form-data; name=&quot;Upload&quot; Submit Query ------------Ij5GI3GI3ei4GI3ei4KM7GI3KM7KM7--"/>
<page href="flash/net/FileReference.html#FileReference()" title="FileReference.FileReference()" text="FileReference Creates a new FileReference object. When populated, a FileReference object represents a file on the user's local disk."/>
<page href="flash/net/FileReference.html#browse()" title="FileReference.browse()" text="browse Displays a file-browsing dialog box that lets the user select a file to upload. The dialog box is native to the user's operating system. The user can select a file on the local computer or from other systems, for example, through a UNC path on Windows. When you call this method and the user successfully selects a file, the properties of this FileReference object are populated with the properties of that file. Each subsequent time that the FileReference.browse() method is called, the FileReference object's properties are reset to the file that the user selects in the dialog box. Only one browse() or download() session can be performed at a time (because only one dialog box can be invoked at a time). Using the typeFilter parameter, you can determine which files the dialog box displays. typeFilter An array of FileFilter instances used to filter the files that are displayed in the dialog box. If you omit this parameter, all files are displayed. For more information, see the FileFilter class. Thrown in the following situations: 1) Another FileReference or FileReferenceList browse session is in progress; only one file browsing session may be performed at a time. 2) A setting in the user's mms.cfg file prohibits this operation."/>
<page href="flash/net/FileReference.html#cancel()" title="FileReference.cancel()" text="cancel Cancels any ongoing upload or download operation on this FileReference object. Calling this method does not dispatch the cancel event; that event is dispatched only when the user cancels the operation by dismissing the file upload or download dialog box."/>
<page href="flash/net/FileReference.html#download()" title="FileReference.download()" text="download Opens a dialog box that lets the user download a file from a remote server. Although Flash Player has no restriction on the size of files you can upload or download, the player officially supports uploads or downloads of up to 100 MB. The download() method first opens an operating-system dialog box that asks the user to enter a filename and select a location on the local computer to save the file. When the user selects a location and confirms the download operation (for example, by clicking Save), the download from the remote server begins. Listeners receive events to indicate the progress, success, or failure of the download. To ascertain the status of the dialog box and the download operation after calling download(), your ActionScript code must listen for events such as cancel, open, progress, and complete. The FileReference.upload() and FileReference.download() functions are nonblocking. These functions return after they are called, before the file transmission is complete. In addition, if the FileReference object goes out of scope, any upload or download that is not yet completed on that object is canceled upon leaving the scope. Be sure that your FileReference object remains in scope for as long as the upload or download is expected to continue. When the file is downloaded successfully, the properties of the FileReference object are populated with the properties of the local file. The complete event is dispatched if the download is successful. Only one browse() or download() session can be performed at a time (because only one dialog box can be invoked at a time). This method supports downloading of any file type, with either HTTP or HTTPS. Note: If your server requires user authentication, only SWF files running in a browser — that is, using the browser plug-in or ActiveX control — can provide a dialog box to prompt the user for a user name and password for authentication, and only for downloads. For uploads using the plug-in or ActiveX control, or for uploads and downloads using the stand-alone or external player, the file transfer fails. When you use this method, consider the Flash Player security model: Loading operations are not allowed if the calling SWF file is in an untrusted local sandbox. The default behavior is to deny access between sandboxes. A website can enable access to a resource by adding a cross-domain policy file. 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. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper request defaultFileName The URLRequest object. The url property of the URLRequest object should contain the URL of the file to download to the local computer. If this parameter is null, an exception is thrown. To send POST or GET parameters to the server, set the value of URLRequest.data to your parameters, and set URLRequest.method to either URLRequestMethod.POST or URLRequestMethod.GET. On some browsers, URL strings are limited in length. Lengths greater than 256 characters may fail on some browsers or servers. The default filename displayed in the dialog box for the file to be downloaded. This string must not contain the following characters: / \ : ~~ ? &quot; &lt; &gt; | % If you omit this parameter, the filename of the remote URL is parsed and used as the default. The following example shows usage of the download event object. To run this example, change the downloadURL.url property to point to an actual domain and file, rather than the fictional http://www.[yourDomain].com/SomeFile.pdf. You might also need to compile the SWF file with Local playback security set to Access network only or to update Flash Player security settings to allow this file network access. package { import flash.display.Sprite; import flash.events.*; import flash.net.FileReference; import flash.net.URLRequest; import flash.net.FileFilter; public class FileReference_download extends Sprite { private var downloadURL:URLRequest; private var fileName:String = &quot;SomeFile.pdf&quot;; private var file:FileReference; public function FileReference_download() { downloadURL = new URLRequest(); downloadURL.url = &quot;http://www.[yourDomain].com/SomeFile.pdf&quot;; file = new FileReference(); configureListeners(file); file.download(downloadURL, fileName); } private function configureListeners(dispatcher:IEventDispatcher):void { dispatcher.addEventListener(Event.CANCEL, cancelHandler); dispatcher.addEventListener(Event.COMPLETE, completeHandler); dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); dispatcher.addEventListener(Event.OPEN, openHandler); dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler); dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); dispatcher.addEventListener(Event.SELECT, selectHandler); } private function cancelHandler(event:Event):void { trace(&quot;cancelHandler: &quot; + event); } private function completeHandler(event:Event):void { trace(&quot;completeHandler: &quot; + event); } private function ioErrorHandler(event:IOErrorEvent):void { trace(&quot;ioErrorHandler: &quot; + event); } private function openHandler(event:Event):void { trace(&quot;openHandler: &quot; + event); } private function progressHandler(event:ProgressEvent):void { var file:FileReference = FileReference(event.target); trace(&quot;progressHandler name=&quot; + file.name + &quot; bytesLoaded=&quot; + event.bytesLoaded + &quot; bytesTotal=&quot; + event.bytesTotal); } private function securityErrorHandler(event:SecurityErrorEvent):void { trace(&quot;securityErrorHandler: &quot; + event); } private function selectHandler(event:Event):void { var file:FileReference = FileReference(event.target); trace(&quot;selectHandler: name=&quot; + file.name + &quot; URL=&quot; + downloadURL.url); } } } Thrown in the following situations: 1) Another browse session is in progress; only one file browsing session can be performed at a time. 2) The value passed to request does not contain a valid path or protocol. 3) The filename to download contains prohibited characters. 4) A setting in the user's mms.cfg file prohibits this operation."/>
<page href="flash/net/FileReference.html#upload()" title="FileReference.upload()" text="upload Starts the upload of a file selected by a user to a remote server. Although Flash Player has no restriction on the size of files you can upload or download, the player officially supports uploads or downloads of up to 100 MB. You must call the FileReference.browse() or FileReferenceList.browse() method before you call this method. Listeners receive events to indicate the progress, success, or failure of the upload. Although you can use the FileReferenceList object to let users select multiple files for upload, you must upload the files one by one; to do so, iterate through the FileReferenceList.fileList array of FileReference objects. The FileReference.upload() and FileReference.download() functions are nonblocking. These functions return after they are called, before the file transmission is complete. In addition, if the FileReference object goes out of scope, any upload or download that is not yet completed on that object is canceled upon leaving the scope. Be sure that your FileReference object remains in scope for as long as the upload or download is expected to continue. The file is uploaded to the URL passed in the url parameter. The URL must be a server script configured to accept uploads. Flash Player uploads files by using the HTTP POST method. The server script that handles the upload should expect a POST request with the following elements: Content-Type of multipart/form-data Content-Disposition with a name attribute set to &quot;Filedata&quot; by default and a filename attribute set to the name of the original file The binary contents of the file For a sample POST request, see the description of the uploadDataFieldName parameter. You can send POST or GET parameters to the server with the upload() method; see the description of the request parameter. If the testUpload parameter is true, and the file to be uploaded is bigger than approximately 10 KB, Flash Player on Windows first sends a test upload POST operation with zero content before uploading the actual file, to verify that the transmission is likely to succeed. Flash Player then sends a second POST operation that contains the actual file content. For files smaller than 10 KB, Flash Player performs a single upload POST with the actual file content to be uploaded. Flash Player on Macintosh does not perform test upload POST operations. Note: If your server requires user authentication, only SWF files running in a browser — that is, using the browser plug-in or ActiveX control — can provide a dialog box to prompt the user for a username and password for authentication, and only for downloads. For uploads using the plug-in or ActiveX control, or for uploads and downloads using the stand-alone or external player, the file transfer fails. When you use this method, consider the following restrictions for the Flash Player security model: Loading operations are not allowed if the calling SWF file is in an untrusted local sandbox. The default behavior is to deny access between sandboxes. A website can enable access to a resource by adding a cross-domain policy file. 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. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper request uploadDataFieldName testUpload The URLRequest object; the url property of the URLRequest object should contain the URL of the server script configured to handle upload through HTTP POST calls. On some browsers, URL strings are limited in length. Lengths greater than 256 characters may fail on some browsers or servers. If this parameter is null, an exception is thrown. The URL can be HTTP or, for secure uploads, HTTPS. To use HTTPS, use an HTTPS url in the url parameter. If you do not specify a port number in the url parameter, Flash Player uses port 80 for HTTP and port 443 for HTTPS, by default. To send POST or GET parameters to the server, set the data property of the URLRequest object to your parameters, and set the method property to either URLRequestMethod.POST or URLRequestMethod.GET. The field name that precedes the file data in the upload POST operation. The uploadDataFieldName value must be non-null and a non-empty String. By default, the value of uploadDataFieldName is &quot;Filedata&quot;, as shown in the following sample POST request: Content-Type: multipart/form-data; boundary=AaB03x --AaB03x Content-Disposition: form-data; name=&quot;Filedata&quot;; filename=&quot;example.jpg&quot; Content-Type: application/octet-stream ... contents of example.jpg ... --AaB03x-- A setting to request a test file upload. If testUpload is true, for files larger than 10 KB, Flash Player attempts a test file upload POST with a Content-Length of 0. The test upload checks whether the actual file upload will be successful and that server authentication, if required, will succeed. A test upload is only available for Windows players. Local untrusted SWF files may not communicate with the Internet. To avoid this situation, reclassify this SWF file as local-with-networking or trusted. This exception is thrown with a message indicating the name of the local file and the URL that may not be accessed."/>
<page href="flash/net/FileReference.html#creationDate" title="FileReference.creationDate" text="creationDate The creation date of the file on the local disk. If the FileReference object was not populated, a call to get the value of this property returns null. If the FileReference.browse(), FileReferenceList.browse(), or FileReference.download() method was not called successfully, an exception is thrown with a message indicating that functions were called in the incorrect sequence or an earlier call was unsuccessful. In this case, the value of the creationDate property is null."/>
<page href="flash/net/FileReference.html#creator" title="FileReference.creator" text="creator The Macintosh creator type of the file. In Windows, this property is null. If the FileReference object was not populated, a call to get the value of this property returns null. On Macintosh, if the FileReference.browse(), FileReferenceList.browse(), or FileReference.download() method was not called successfully, an exception is thrown with a message indicating that functions were called in the incorrect sequence or an earlier call was unsuccessful. In this case, the value of the creator property is null."/>
<page href="flash/net/FileReference.html#modificationDate" title="FileReference.modificationDate" text="modificationDate The date that the file on the local disk was last modified. If the FileReference object was not populated, a call to get the value of this property returns null. If the FileReference.browse(), FileReferenceList.browse(), or FileReference.download() method was not called successfully, an exception is thrown with a message indicating that functions were called in the incorrect sequence or an earlier call was unsuccessful. In this case, the value of the modificationDate property is null."/>
<page href="flash/net/FileReference.html#name" title="FileReference.name" text="name The name of the file on the local disk. If the FileReference object was not populated, a call to get the value of this property returns null. All the properties of a FileReference object are populated by calling the browse() method. Unlike other FileReference properties, if you call the download() method, the name property is populated when the select event is dispatched. If the FileReference.browse(), FileReferenceList.browse(), or FileReference.download() method was not called successfully, an exception is thrown with a message indicating that functions were called in the incorrect sequence or an earlier call was unsuccessful. In this case, the value of the name property is null."/>
<page href="flash/net/FileReference.html#size" title="FileReference.size" text="size The size of the file on the local disk in bytes. If size is 0, an exception is thrown. If the FileReference.browse(), FileReferenceList.browse(), or FileReference.download() method was not called successfully, an exception is thrown with a message indicating that functions were called in the incorrect sequence or an earlier call was unsuccessful. In this case, the value of the size property is 0."/>
<page href="flash/net/FileReference.html#type" title="FileReference.type" text="type The file type. In Windows, this property is the file extension. On the Macintosh, this property is the four-character file type. If the FileReference object was not populated, a call to get the value of this property returns null. If the FileReference.browse(), FileReferenceList.browse(), or FileReference.download() method was not called successfully, an exception is thrown with a message indicating that functions were called in the incorrect sequence or an earlier call was unsuccessful. In this case, the value of the type property is null."/>
<page href="flash/net/FileReference.html#event:cancel" title="FileReference.cancel" text="cancel Dispatched when a file upload or download is canceled through the file-browsing dialog box by the user. Flash Player does not dispatch this event if the user cancels an upload or download through other means (closing the browser or stopping the current application). The following example shows usage of the cancel event object. To run this example, change the downloadURL.url property to point to an actual domain and file, rather than the fictional http://www.[yourDomain].com/SomeFile.pdf. You might also need to compile the SWF file with Local playback security set to Access network only or to update Flash Player security settings to allow this file network access. package { import flash.display.Sprite; import flash.events.*; import flash.net.FileReference; import flash.net.URLRequest; public class FileReference_event_cancel extends Sprite { private var downloadURL:URLRequest; private var fileName:String = &quot;SomeFile.pdf&quot;; private var file:FileReference; public function FileReference_event_cancel() { downloadURL = new URLRequest(); downloadURL.url = &quot;http://www.[yourDomain].com/SomeFile.pdf&quot;; file = new FileReference(); file.addEventListener(Event.CANCEL, cancelHandler); file.download(downloadURL, fileName); } private function cancelHandler(event:Event):void { trace(&quot;cancelHandler: &quot; + event); } } }"/>
<page href="flash/net/FileReference.html#event:complete" title="FileReference.complete" text="complete Dispatched when download is complete or when upload generates an HTTP status code of 200. For file download, this event is dispatched when Flash Player finishes downloading the entire file to disk. For file upload, this event is dispatched after the Flash Player receives an HTTP status code of 200 from the server receiving the transmission. The following example shows usage of the complete event object. To run this example, change the downloadURL.url property to point to an actual domain and file, rather than the fictional http://www.[yourDomain].com/SomeFile.pdf. You might also need to compile the SWF file with Local playback security set to Access network only or to update Flash Player security settings to allow this file network access. package { import flash.display.Sprite; import flash.events.*; import flash.net.FileReference; import flash.net.URLRequest; public class FileReference_event_complete extends Sprite { private var downloadURL:URLRequest; private var fileName:String = &quot;SomeFile.pdf&quot;; private var file:FileReference; public function FileReference_event_complete() { downloadURL = new URLRequest(); downloadURL.url = &quot;http://www.[yourDomain].com/SomeFile.pdf&quot;; file = new FileReference(); configureListeners(file); file.download(downloadURL, fileName); } private function configureListeners(dispatcher:IEventDispatcher):void { dispatcher.addEventListener(Event.CANCEL, cancelHandler); dispatcher.addEventListener(Event.COMPLETE, completeHandler); dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); dispatcher.addEventListener(Event.OPEN, openHandler); dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler); dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); dispatcher.addEventListener(Event.SELECT, selectHandler); } private function cancelHandler(event:Event):void { trace(&quot;cancelHandler: &quot; + event); } private function completeHandler(event:Event):void { trace(&quot;completeHandler: &quot; + event); } private function ioErrorHandler(event:IOErrorEvent):void { trace(&quot;ioErrorHandler: &quot; + event); } private function openHandler(event:Event):void { trace(&quot;openHandler: &quot; + event); } private function progressHandler(event:ProgressEvent):void { var file:FileReference = FileReference(event.target); trace(&quot;progressHandler name=&quot; + file.name + &quot; bytesLoaded=&quot; + event.bytesLoaded + &quot; bytesTotal=&quot; + event.bytesTotal); } private function securityErrorHandler(event:SecurityErrorEvent):void { trace(&quot;securityErrorHandler: &quot; + event); } private function selectHandler(event:Event):void { var file:FileReference = FileReference(event.target); trace(&quot;selectHandler: name=&quot; + file.name + &quot; URL=&quot; + downloadURL.url); } } }"/>
<page href="flash/net/FileReference.html#event:httpStatus" title="FileReference.httpStatus" text="httpStatus Dispatched when an upload fails and an HTTP status code is available to describe the failure. The httpStatus event is dispatched, followed by an ioError event. The httpStatus event is dispatched only for upload failures. Because of the way that Flash Player relies on the browser during file download, this event is not applicable for download failures. If a download fails because of an HTTP error, the error is reported as an I/O error."/>
<page href="flash/net/FileReference.html#event:ioError" title="FileReference.ioError" text="ioError Dispatched when the upload or download fails. A file transfer can fail for one of the following reasons: An input/output error occurs while the player is reading, writing, or transmitting the file. The SWF file tries to upload a file to a server that requires authentication (such as a user name and password). During upload, Flash Player does not provide a means for users to enter passwords. If a SWF file tries to upload a file to a server that requires authentication, the upload fails. The SWF file tries to download a file from a server that requires authentication, within the stand-alone or external player. During download, the stand-alone and external players do not provide a means for users to enter passwords. If a SWF file in these players tries to download a file from a server that requires authentication, the download fails. File download can succeed only in the ActiveX control and browser plug-in players. The value passed to the url parameter in the upload() method contains an invalid protocol. Valid protocols are HTTP and HTTPS. Important: Only Flash applications running in a browser — that is, using the browser plug-in or ActiveX control — can provide a dialog box to prompt the user to enter a user name and password for authentication, and then only for downloads. For uploads using the plug-in or ActiveX control, or for upload or download using either the stand-alone or the external player, the file transfer fails."/>
<page href="flash/net/FileReference.html#event:open" title="FileReference.open" text="open Dispatched when an upload or download operation starts. The following example shows usage of the download event object. To run this example, change the downloadURL.url property to point to an actual domain and file, rather than the fictional http://www.[yourDomain].com/SomeFile.pdf. You might also need to compile the SWF file with Local playback security set to Access network only or to update Flash Player security settings to allow this file network access. package { import flash.display.Sprite; import flash.events.*; import flash.net.FileReference; import flash.net.URLRequest; import flash.net.FileFilter; public class FileReference_download extends Sprite { private var downloadURL:URLRequest; private var fileName:String = &quot;SomeFile.pdf&quot;; private var file:FileReference; public function FileReference_download() { downloadURL = new URLRequest(); downloadURL.url = &quot;http://www.[yourDomain].com/SomeFile.pdf&quot;; file = new FileReference(); configureListeners(file); file.download(downloadURL, fileName); } private function configureListeners(dispatcher:IEventDispatcher):void { dispatcher.addEventListener(Event.CANCEL, cancelHandler); dispatcher.addEventListener(Event.COMPLETE, completeHandler); dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); dispatcher.addEventListener(Event.OPEN, openHandler); dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler); dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); dispatcher.addEventListener(Event.SELECT, selectHandler); } private function cancelHandler(event:Event):void { trace(&quot;cancelHandler: &quot; + event); } private function completeHandler(event:Event):void { trace(&quot;completeHandler: &quot; + event); } private function ioErrorHandler(event:IOErrorEvent):void { trace(&quot;ioErrorHandler: &quot; + event); } private function openHandler(event:Event):void { trace(&quot;openHandler: &quot; + event); } private function progressHandler(event:ProgressEvent):void { var file:FileReference = FileReference(event.target); trace(&quot;progressHandler name=&quot; + file.name + &quot; bytesLoaded=&quot; + event.bytesLoaded + &quot; bytesTotal=&quot; + event.bytesTotal); } private function securityErrorHandler(event:SecurityErrorEvent):void { trace(&quot;securityErrorHandler: &quot; + event); } private function selectHandler(event:Event):void { var file:FileReference = FileReference(event.target); trace(&quot;selectHandler: name=&quot; + file.name + &quot; URL=&quot; + downloadURL.url); } } }"/>
<page href="flash/net/FileReference.html#event:progress" title="FileReference.progress" text="progress Dispatched periodically during the file upload or download operation. The progress event is dispatched while Flash Player transmits bytes to a server, and it is periodically dispatched during the transmission, even if the transmission is ultimately not successful. To determine if and when the file transmission is actually successful and complete, listen for the complete event. In some cases, progress events are not received. For example, when the file being transmitted is very small or the upload or download happens very quickly a progress event might not be dispatched. File upload progress cannot be determined on Macintosh platforms earlier than OS X 10.3. The progress event is called during the upload operation, but the value of the bytesLoaded property of the progress event is -1, indicating that the progress cannot be determined. The following example shows usage of the progress event. To run this example, change the downloadURL.url property to point to an actual domain and file, rather than the fictional http://www.[yourDomain].com/SomeFile.pdf. You might also need to compile the SWF file with Local playback security set to Access network only or to update Flash Player security settings to allow this file network access. package { import flash.display.Sprite; import flash.events.*; import flash.net.FileReference; import flash.net.URLRequest; public class FileReference_event_progress extends Sprite { private var downloadURL:URLRequest; private var fileName:String = &quot;SomeFile.pdf&quot;; private var file:FileReference; public function FileReference_event_progress() { downloadURL = new URLRequest(); downloadURL.url = &quot;http://www.[yourDomain].com/SomeFile.pdf&quot;; file = new FileReference(); file.addEventListener(ProgressEvent.PROGRESS, progressHandler); file.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); file.addEventListener(Event.COMPLETE, completeHandler); file.download(downloadURL, fileName); } private function progressHandler(event:ProgressEvent):void { var file:FileReference = FileReference(event.target); trace(&quot;progressHandler: name=&quot; + file.name + &quot; bytesLoaded=&quot; + event.bytesLoaded + &quot; bytesTotal=&quot; + event.bytesTotal); } private function ioErrorHandler(event:IOErrorEvent):void { trace(&quot;ioErrorHandler: &quot; + event); } private function completeHandler(event:Event):void { trace(&quot;completeHandler: &quot; + event); } } }"/>
<page href="flash/net/FileReference.html#event:securityError" title="FileReference.securityError" text="securityError Dispatched when a call to the FileReference.upload() or FileReference.download() method tries to upload a file to a server or get a file from a server that is outside the caller's security sandbox. The value of the text property that describes the specific error that occurred is normally &quot;securitySandboxError&quot;. The calling SWF file may have tried to access a SWF file outside its domain and does not have permission to do so. You can try to remedy this error by using a cross-domain policy file."/>
<page href="flash/net/FileReference.html#event:select" title="FileReference.select" text="select Dispatched when the user selects a file for upload or download from the file-browsing dialog box. (This dialog box opens when you call the FileReference.browse(), FileReferenceList.browse(), or FileReference.download() method.) When the user selects a file and confirms the operation (for example, by clicking OK), the properties of the FileReference object are populated. The select event acts slightly differently depending on what method invokes it. When the select event is dispatched after a browse() call, Flash Player can read all the FileReference object's properties, because the file selected by the user is on the local file system. When the select event occurs after a download() call, Flash Player can read only the name property, because the file hasn't yet been downloaded to the local file system at the moment the select event is dispatched. When the file is downloaded and the complete event dispatched, Flash Player can read all other properties of the FileReference object. The following example shows usage of the select event object. To run this example, change the uploadURL.url property to point to an actual domain and file, rather than the fictional http://www.[yourDomain].com/SomeFile.pdf. You might also need to compile the SWF file with Local playback security set to Access network only or to update Flash Player security settings to allow this file network access. In order for this example to run from your desktop, your server also needs to have a crossdomain.xml file posted. If the ioErrorHandler() function is triggered, you probably need to update the provided uploadURL with a valid url that is configured to receive uploads. package { import flash.display.Sprite; import flash.events.*; import flash.net.FileReference; import flash.net.URLRequest; public class FileReference_event_select extends Sprite { private var uploadURL:URLRequest; private var file:FileReference; public function FileReference_event_select() { uploadURL = new URLRequest(); uploadURL.url = &quot;http://www.[yourDomain].com/yourUploadHandlerScript.cfm&quot;; file = new FileReference(); file.addEventListener(Event.SELECT, selectHandler); file.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); file.addEventListener(ProgressEvent.PROGRESS, progressHandler); file.addEventListener(Event.COMPLETE, completeHandler); file.browse(); } private function selectHandler(event:Event):void { var file:FileReference = FileReference(event.target); trace(&quot;selectHandler: name=&quot; + file.name + &quot; URL=&quot; + uploadURL.url); file.upload(uploadURL); } private function ioErrorHandler(event:IOErrorEvent):void { trace(&quot;ioErrorHandler: &quot; + event); } private function progressHandler(event:ProgressEvent):void { var file:FileReference = FileReference(event.target); trace(&quot;progressHandler: name=&quot; + file.name + &quot; bytesLoaded=&quot; + event.bytesLoaded + &quot; bytesTotal=&quot; + event.bytesTotal); } private function completeHandler(event:Event):void { trace(&quot;completeHandler: &quot; + event); } } }"/>
<page href="flash/net/FileReference.html#event:uploadCompleteData" title="FileReference.uploadCompleteData" text="uploadCompleteData Dispatched after data is received from the server after a successful upload. This event is not dispatched if data is not returned from the server."/>
<page href="flash/net/NetConnection.html" title="NetConnection class" text="NetConnection The NetConnection class creates a bidirectional connection between Flash Player and a Flash Media Server application or between Flash Player and an application server running Flash Remoting. A NetConnection object is like a pipe between the client and the server. Use NetStream objects to send streams through the pipe. Without Flash Media Server, you can use the NetConnection class to play video and MP3 files from a local file system or from a web server. For information about supported codecs and file formats, see http://www.adobe.com/go/hardware_scaling_en and the Flash Media Server documentation. When you use the NetConnection class, consider the Flash Player security model: Loading and playing an audio or video file is not allowed if the calling SWF file is in a network sandbox and the file to be loaded is local. By default, loading and playing an audio or video file is not allowed if the calling SWF is local and tries to load and play a remote file. A user must grant explicit permission to allow this. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper Note: This class was dynamic in ActionScript 2.0 but is now sealed. To write callback methods for this class, you can either extend the class and define the callback methods in your subclass, or you can use the client property to refer to an object and define the callback methods on that object."/>
<page href="flash/net/NetConnection.html#NetConnection()" title="NetConnection.NetConnection()" text="NetConnection Creates a NetConnection object. Call connect() to make a connection. If a SWF file needs to communicate with servers released prior to Flash Player 9, you might need to set the NetConnection object's objectEncoding property."/>
<page href="flash/net/NetConnection.html#addHeader()" title="NetConnection.addHeader()" text="addHeader Adds a context header to the Action Message Format (AMF) packet structure. This header is sent with every future AMF packet. If you call NetConnection.addHeader() using the same name, the new header replaces the existing header, and the new header persists for the duration of the NetConnection object. You can remove a header by calling NetConnection.addHeader() with the name of the header to remove an undefined object. operation mustUnderstand param Identifies the header and the ActionScript object data associated with it. A value of true indicates that the server must understand and process this header before it handles any of the following headers or messages. Any ActionScript object."/>
<page href="flash/net/NetConnection.html#call()" title="NetConnection.call()" text="call Invokes a command or method on Flash Media Server or on an application server running Flash Remoting. Before calling NetConnection.call() you must call NetConnection.connect() to connect to the server. You must create a server-side function to pass to this method. command responder arguments A method specified in the form [objectPath/]method. For example, the someObject/doSomething command tells the remote server to invoke the clientObject.someObject.doSomething() method, with all the optional ... arguments parameters. If the object path is missing, clientObject.doSomething() is invoked on the remote server. With Flash Media Server, command is the name of a function defined in an application's server-side script. You do not need to use an object path before command if the server-side script is placed at the root level of the application directory. An optional object that is used to handle return values from the server. The Responder object can have two defined methods to handle the returned result: result and status. If an error is returned as the result, status is invoked; otherwise, result is invoked. The Responder object can process errors related to specific operations, while the NetConnection object responds to errors related to the connection status. Optional arguments that can be of any ActionScript type, including a reference to another ActionScript object. These arguments are passed to the method specified in the command parameter when the method is executed on the remote application server."/>
<page href="flash/net/NetConnection.html#close()" title="NetConnection.close()" text="close Closes the connection that was opened locally or to the server and dispatches a netStatus event with a code property of NetConnection.Connect.Closed. This method disconnects all NetStream objects running over the connection. Any queued data that has not been sent is discarded. (To terminate local or server streams without closing the connection, use NetStream.close().) If you close the connection and then want to create a new one, you must create a new NetConnection object and call the connect() method again. The close() method also disconnects all remote shared objects running over this connection. However, you don't need to recreate the shared object to reconnect. Instead, you can just call SharedObject.connect() to reestablish the connection to the shared object. Also, any data in the shared object that was queued when you issued NetConnection.close() will be sent after you reestablish a connection to the shared object. With Flash Media Server, the best development practice is to call close() when the client no longer needs the connection to the server. Calling close() is the fastest way to clean up unused connections. You can configure the server to close idle connections automatically as a back-up measure. For more information, see the Flash Media Server Configuration and Administration Guide."/>
<page href="flash/net/NetConnection.html#connect()" title="NetConnection.connect()" text="connect Creates a bidirectional connection between Flash Player and a Flash Media Server application. A NetConnection object is like a pipe between the client and the server. Use NetStream objects to send streams through the pipe. For information about codecs and file formats supported by Flash Media Server, see the Flash Media Server documentation. Without Flash Media Server, call NetConnection.connect() to play video and MP3 files from a local file system or from a web server. For information about supported codecs and file formats, see http://www.adobe.com/go/hardware_scaling_en. Creates a bidirectional connection between Flash Player and an application server running the Flash Remoting service. Use the NetServices class to call functions on and return results from application servers over a NetConnection object. For more information, see the Flash Remoting documentation. When using this method, consider the Flash Player security model and the following security considerations: By default, Flash Player denies access between sandboxes. A website can enable access to a resource by using a cross-domain policy file. Your application can deny access to a resource on the server. In a Flash Media Server application, you need to add server-side code to deny access. See the Flash Media Server documentation for details. You cannot use NetConnection.connect() 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. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper command arguments Set this parameter to null if you are connecting to a video file on the local computer. If you are connecting to a server, set this parameter to the URI of the application that contains the video file on the server. Use the following syntax (items in brackets are optional): protocol:[//host][:port]/appname[/instanceName] To connect to Flash Media Server, use rtmp, rtmpe, rtmps, rtmpt, or rtmpte as the protocol. If the connection is successful, a netStatus event with a code property of NetConnection.Connect.Success is returned. See the NetStatusEvent.info property for a list of all event codes returned in response to calling connect(). If the SWF file is served from the same host where the server is installed, you can omit the host parameter. If you omit the instanceName parameter, Flash Player connects to the application's default instance. Optional parameters of any type to be passed to the application specified in command. With Flash Media Server, the additional arguments are passed to the application.onConnect() event handler in the application's server-side code. You must define and handle the arguments in onConnect(). The URI passed to the command parameter is improperly formatted."/>
<page href="flash/net/NetConnection.html#client" title="NetConnection.client" text="client Indicates the object on which callback methods should be invoked. The default is this NetConnection instance. If you set the client property to another object, callback methods will be invoked on that object. The client property must be set to a non-null object."/>
<page href="flash/net/NetConnection.html#connected" title="NetConnection.connected" text="connected Indicates whether Flash Player is connected to a server through a persistent RTMP connection (true) or not (false). When connected through HTTP, this property is false, except when connected to Flash Remoting services on an application server, in which case it is true."/>
<page href="flash/net/NetConnection.html#connectedProxyType" title="NetConnection.connectedProxyType" text="connectedProxyType The proxy type used to make a successful NetConnection.connect() call to Flash Media Server: &quot;none&quot;, &quot;HTTP&quot;, &quot;HTTPS&quot;, or &quot;CONNECT&quot;. The value is &quot;none&quot; if the connection is not tunneled, &quot;HTTP&quot; if the connection is tunneled over HTTP, &quot;HTTPS&quot; if the connection is tunneled over HTTPS, and &quot;CONNECT&quot; if the connection is tunneled using the HTTP CONNECT method. An attempt was made to access this property when the NetConnection instance was not connected."/>
<page href="flash/net/NetConnection.html#defaultObjectEncoding" title="NetConnection.defaultObjectEncoding" text="defaultObjectEncoding The default object encoding for NetConnection objects created in the SWF file. When an object is written to or read from binary data, the defaultObjectEncoding property indicates which Action Message Format (AMF) version is used to serialize the data: the ActionScript 3.0 format (ObjectEncoding.AMF3) or the ActionScript 1.0 and ActionScript 2.0 format (ObjectEncoding.AMF0). The default value is ObjectEncoding.AMF3. Changing NetConnection.defaultObjectEncoding does not affect existing NetConnection instances; it affects only instances that are created subsequently. To set an object's encoding separately (rather than setting object encoding for the entire SWF file), set the objectEncoding property of the NetConnection object instead. For more detailed information, see the description of the objectEncoding property."/>
<page href="flash/net/NetConnection.html#objectEncoding" title="NetConnection.objectEncoding" text="objectEncoding The object encoding for this NetConnection instance. When an object is written to or read from binary data, the defaultObjectEncoding property indicates which Action Message Format (AMF) version should be used to serialize the data: the ActionScript 3.0 format (ObjectEncoding.AMF3) or the ActionScript 1.0 and ActionScript 2.0 format (ObjectEncoding.AMF0). Set the objectEncoding property to set an AMF version for a NetConnection instance. It's important to understand this property if your ActionScript 3.0 SWF file needs to communicate with servers released prior to Flash Player 9. The following three scenarios are possible: Connecting to a server that supports AMF3 (for example, Flex Data Services 2 or Flash Media Server 3). The default value of defaultObjectEncoding is ObjectEncoding.AMF3. All NetConnection instances created in this SWF file use AMF3 serialization, so you don't need to tell Flash Player which AMF encoding to use. Connecting to a server that doesn't support AMF3 (for example, Flash Media Server 2). In this scenario, set the static NetConnection.defaultObjectEncoding property to ObjectEncoding.AMF0. All NetConnection instances created in this SWF file use AMF0 serialization. You don't need to set the objectEncoding property. Connecting to multiple servers that use different encoding versions. Instead of using defaultObjectEncoding, set the object encoding on a per-connection basis using the objectEncoding property for each connection. Set it to ObjectEncoding.AMF0 to connect to servers that use AMF0 encoding, such as Flash Media Server 2, and set it to ObjectEncoding.AMF3 to connect to servers that use AMF3 encoding, such as Flex Data Services 2. Once a NetConnection instance is connected, its objectEncoding property is read-only. If you use the wrong encoding to connect to a server, Flash Player dispatches the netStatus event. The NetStatusEvent.info property contains an information object with a code property value of NetConnection.Connect.Failed, and a description explaining that the object encoding is incorrect. An attempt was made to set the value of the objectEncoding property while the NetConnection instance was connected."/>
<page href="flash/net/NetConnection.html#proxyType" title="NetConnection.proxyType" text="proxyType Determines which fallback methods are tried if an initial connection attempt to the server fails. You must set the proxyType property before calling the NetConnection.connect() method. Acceptable values are &quot;none&quot;, &quot;HTTP&quot;, &quot;CONNECT&quot;, and &quot;best&quot;. In Flash Player 9, the default value for this property is &quot;none&quot;; if you do not change this value, Flash Player uses HTTPS tunneling for RTMPS. If the property is set to &quot;best&quot;, the client attempts to connect using native SSL. If the connection fails, other connection methods are attempted. If the property is set to &quot;HTTP&quot; and a direct connection fails, HTTP tunneling is used. If the property is set to &quot;CONNECT&quot; and a direct connection fails, the CONNECT method of tunneling is used. If that fails, the connection will not fall back to HTTP tunneling. Note:In Flash Player 9, this property is applicable only when using RTMP, RTMPS, or RTMPT. The CONNECT method is applicable only to users who are connected to the network by a proxy server."/>
<page href="flash/net/NetConnection.html#uri" title="NetConnection.uri" text="uri The URI passed to the NetConnection.connect() method. If NetConnection.connect() hasn't been called or if no URI was passed, this property is undefined."/>
<page href="flash/net/NetConnection.html#usingTLS" title="NetConnection.usingTLS" text="usingTLS Indicates whether a secure connection was made using native Transport Layer Security (TLS) rather than HTTPS. This property is valid only when a NetConnection object is connected. An attempt was made to access this property when the NetConnection instance was not connected."/>
<page href="flash/net/NetConnection.html#event:asyncError" title="NetConnection.asyncError" text="asyncError Dispatched when an exception is thrown asynchronously — that is, from native asynchronous code."/>
<page href="flash/net/NetConnection.html#event:ioError" title="NetConnection.ioError" text="ioError Dispatched when an input or output error occurs that causes a network operation to fail."/>
<page href="flash/net/NetConnection.html#event:netStatus" title="NetConnection.netStatus" text="netStatus Dispatched when a NetConnection object is reporting its status or error condition. The netStatus event contains an info property, which is an information object that contains specific information about the event, such as whether a connection attempt succeeded or failed."/>
<page href="flash/net/NetConnection.html#event:securityError" title="NetConnection.securityError" text="securityError Dispatched if a call to NetConnection.call() attempts to connect to a server outside the caller's security sandbox."/>
<page href="flash/net/IDynamicPropertyWriter.html" title="IDynamicPropertyWriter interface" text="IDynamicPropertyWriter This interface is used with the IDynamicPropertyOutput interface to control the serialization of dynamic properties of dynamic objects. To use this interface, assign an object that implements the IDynamicPropertyWriter interface to the ObjectEncoding.dynamicPropertyWriter property."/>
<page href="flash/net/IDynamicPropertyWriter.html#writeDynamicProperties()" title="IDynamicPropertyWriter.writeDynamicProperties()" text="writeDynamicProperties Writes the name and value of an IDynamicPropertyOutput object to an object with dynamic properties. If ObjectEncoding.dynamicPropertyWriter is set, this method is invoked for each object with dynamic properties. obj output The object to write to. The IDynamicPropertyOutput object that contains the name and value to dynamically write to the object."/>
<page href="flash/net/ObjectEncoding.html" title="ObjectEncoding class" text="ObjectEncoding The ObjectEncoding class allows classes that serialize objects (such as NetStream, NetConnection, SharedObject, and ByteArray) to work with prior versions of ActionScript. Object encoding controls how objects are represented in Action Message Format (AMF). Flash Player uses AMF to enable efficient communication between a Flash application and a remote server. AMF encodes remote procedure calls into a compact binary representation that can be transferred over HTTP/HTTPS or the RTMP/RTMPS protocol used by Flash Media Server. ActionScript objects and data values are serialized into this binary format, which is generally more compact than other representations, such as XML. Flash Player 9 can serialize in two different formats, AMF3 and AMF0. AMF3, the default serialization used for ActionScript 3.0, provides various advantages over AMF0, which is used for ActionScript 1.0 and 2.0. AMF3 sends data over the network more efficiently than AMF0. AMF3 supports sending int and uint objects as integers and supports data types that are available only in ActionScript 3.0, such as ByteArray, XML, and IExternalizable. It is available only in ActionScript 3.0 and with servers that use AMF3 encoding, such as Flex 2. The ByteArray, NetConnection, NetStream, SharedObject, Socket, and URLStream classes contain an objectEncoding property that is assigned a constant from the ObjectEncoding class. The behavior of the objectEncoding property differs depending on the object; each class's objectEncoding property description explains the behavior more thoroughly."/>
<page href="flash/net/ObjectEncoding.html#AMF0" title="ObjectEncoding.AMF0" text="AMF0 Specifies that objects are serialized using the Action Message Format for ActionScript 1.0 and 2.0."/>
<page href="flash/net/ObjectEncoding.html#AMF3" title="ObjectEncoding.AMF3" text="AMF3 Specifies that objects are serialized using the Action Message Format for ActionScript 3.0."/>
<page href="flash/net/ObjectEncoding.html#DEFAULT" title="ObjectEncoding.DEFAULT" text="DEFAULT Specifies the default (latest) format for the current player. Because object encoding control is only available in Flash® Player 9 and later, the earliest format used will be the Action Message Format for ActionScript 3.0. For example, if an object has the objectEncoding property set to flash.net.ObjectEncoding.DEFAULT, Flash Player uses AMF3 encoding. If, in the future, a later version of Flash Player introduces a new AMF version and you republish your content, the player will use that new AMF version. You can use this constant only if you're not concerned at all about interoperability with previous versions of Flash Player."/>
<page href="flash/net/ObjectEncoding.html#dynamicPropertyWriter" title="ObjectEncoding.dynamicPropertyWriter" text="dynamicPropertyWriter Allows greater control over the serialization of dynamic properties of dynamic objects. When this property is set to null, the default value, dynamic properties are serialized using native code, which writes all dynamic properties excluding those whose value is a function. This value is called only for properties of a dynamic object (objects declared within a dynamic class) or for objects declared using the new operator. You can use this property to exclude properties of dynamic objects from serialization; to write values to properties of dynamic objects; or to create new properties for dynamic objects. To do so, set this property to an object that implements the IDynamicPropertyWriter interface. For more information, see the IDynamicPropertyWriter interface."/>
<page href="flash/net/NetStream.html" title="NetStream class" text="NetStream The NetStream class opens a one-way streaming connection between Flash Player and Flash Media Server, or between Flash Player and the local file system. A NetStream object is a channel within a NetConnection object. This channel can either publish a stream, using NetStream.publish(), or subscribe to a published stream and receive data, using NetStream.play(). You can publish or play live (real-time) data and previously recorded data. You can also use NetStream objects to send text messages to all subscribed clients (see the NetStream.send() method). Playing external video files provides several advantages over embedding video in a Flash document, such as better performance and memory management, and independent video and Flash frame rates. For information about supported codecs and file formats, see http://www.adobe.com/go/hardware_scaling_en and the Flash Media Server documentation. The NetStream class provides several methods and properties you can use to track the progress of the file as it loads and plays, and to give the user control over playback (stopping, pausing, and so on). General workflow for streaming audio or video. The following steps summarize the workflow for publishing real-time audio and video: Create a NetConnection object. Use the NetConnection.connect() method to connect to the application instance on the server. Create a NetStream object to create a data stream within the connection. Use the NetStream.attachAudio()method to capture and send audio over the stream and the NetStream.attachCamera() method to capture and send video. Use the NetStream.publish() method to give the stream a unique name and send data over the stream to the server so that others can receive it. You can also record the data as you publish it, so that users can play it back later. SWF files that subscribe to the stream will use the name passed to publish() in their call to play() and will call the same NetConnection.connect() method as the publisher. They will have to call the Video.attachNetStream() method to stream the video and the NetStream.play() method to play it. Using data keyframes with Flash Media Server. After creating the NetConnection and NetStream objects, you can use NetStream.send() to add metadata to live audio or video as you stream it to the server. Metadata can be information such as the height or width of a video, its duration, the name of its creator, and so on. To define the metadata, use the special handler name @setDataFrame as the first argument to NetStream.send(). The client that receives the live stream also needs to define an onMetaData event handler to retrieve the metadata from the stream; see the NetStream.send() method for details."/>
<page href="flash/net/NetStream.html#NetStream()" title="NetStream.NetStream()" text="NetStream Creates a stream that can be used for playing video files through the specified NetConnection object. For information about supported codecs and file formats, see http://www.adobe.com/go/hardware_scaling_en and the Flash Media Server documentation. connection A NetConnection object. The NetConnection instance is not connected."/>
<page href="flash/net/NetStream.html#attachAudio()" title="NetStream.attachAudio()" text="attachAudio Specifies an audio stream sent over the NetStream object, from a Microphone object passed as the source. This method is available only to the publisher of the specified stream. The attachAudio method is intended for use with Flash Media Server. This method is often called by a user sending live audio (or live video with audio) from a client computer to the server. You can call this method before or after you call the publish() method and actually begin transmitting. Subscribers who want to hear the audio must call the NetStream.play() method. You can control the sound properties of this audio stream through the soundTransform property of the specified Microphone object. microphone The source of the audio stream to be transmitted."/>
<page href="flash/net/NetStream.html#attachCamera()" title="NetStream.attachCamera()" text="attachCamera Starts capturing video from a camera, or stops capturing if theCamera is set to null. This method is available only to the publisher of the specified stream. This method is intended for use with Flash Media Server; for more information, see the class description. After attaching the video source, you must call NetStream.publish() to begin transmitting. Subscribers who want to display the video must call the NetStream.play() and Video.attachCamera() methods to display the video on the Stage. You can use snapshotMilliseconds to send a single snapshot (by providing a value of 0) or a series of snapshots — in effect, time-lapse footage — by providing a positive number that adds a trailer of the specified number of milliseconds to the video feed. The trailer extends the display time of time the video message is displayed. By repeatedly calling attachCamera() with a positive value for snapshotMilliseconds, the sequence of alternating snapshots and trailers create time-lapse footage. For example, you could capture one frame per day and append it to a video file. When a subscriber plays the file, each frame remains onscreen for the specified number of milliseconds and then the next frame is displayed. The purpose of the snapshotMilliseconds parameter is different from the fps parameter you can set with Camera.setMode(). When you specify snapshotMilliseconds, you control how much time elapses between recorded frames. When you specify fps using Camera.setMode(), you are controlling how much time elapses during recording and playback. For example, suppose you want to take a snapshot every 5 minutes for a total of 100 snapshots. You can do this in two ways: You can issue a NetStream.attachCamera(myCamera, 500) command 100 times, once every 5 minutes. This takes 500 minutes to record, but the resulting file will play back in 50 seconds (100 frames with 500 milliseconds between frames). You can issue a Camera.setMode() command with an fps value of 1/300 (one per 300 seconds, or one every 5 minutes), and then issue a NetStream.attachCamera(source) command, letting the camera capture continuously for 500 minutes. The resulting file will play back in 500 minutes — the same length of time that it took to record — with each frame being displayed for 5 minutes. Both techniques capture the same 500 frames, and both approaches are useful; the approach to use depends primarily on your playback requirements. For example, in the second case, you could be recording audio the entire time. Also, both files would be approximately the same size. theCamera snapshotMilliseconds The source of the video transmission. Valid values are a Camera object (which starts capturing video) and null. If you pass null, Flash Player stops capturing video, and any additional parameters you send are ignored. Specifies whether the video stream is continuous, a single frame, or a series of single frames used to create time-lapse photography. If you omit this parameter, Flash Player captures all video until you pass a value of null to attachCamera. If you pass 0, Flash Player captures only a single video frame. Use this value to transmit &quot;snapshots&quot; within a preexisting stream. Flash interprets invalid, negative, or nonnumeric arguments as 0. If you pass a positive number, Flash captures a single video frame and then appends a pause of the specified length as a trailer on the snapshot. Use this value to create time-lapse photography effects."/>
<page href="flash/net/NetStream.html#close()" title="NetStream.close()" text="close Stops playing all data on the stream, sets the time property to 0, and makes the stream available for another use. This method also deletes the local copy of a video file that was downloaded through HTTP. Although Flash Player deletes the local copy of the file that it creates, a copy might persist in the browser's cache directory. If you must completely prevent caching or local storage of the video file, use Flash Media Server. When using Flash Media Server, this method is invoked implicitly when you call NetStream.play() from a publishing stream or NetStream.publish() from a subcribing stream. Please note that: If close() is called from a publishing stream, the stream stops publishing and the publisher can now use the stream for another purpose. Subscribers no longer receive anything that was being published on the stream, because the stream has stopped publishing. If close() is called from a subscribing stream, the stream stops playing for the subscriber, and the subscriber can use the stream for another purpose. Other subscribers are not affected. You can stop a subscribing stream from playing, without closing the stream or changing the stream type by using flash.net.NetStream.play(false)."/>
<page href="flash/net/NetStream.html#pause()" title="NetStream.pause()" text="pause Pauses playback of a video stream. Calling this method does nothing if the video is already paused. To resume play after pausing a video, call resume(). To toggle between pause and play (first pausing the video, then resuming), call togglePause()."/>
<page href="flash/net/NetStream.html#play()" title="NetStream.play()" text="play Begins playback of video files. For information about supported codecs and file formats, see http://www.adobe.com/go/hardware_scaling_en and the Flash Media Server documentation. To view video data, you must create a Video object and call the Video.attachNetStream() method; audio being streamed with the video, or a file that contains only audio, is played automatically. To stream audio from a microphone, use the NetStream.attachAudio() method and control some aspects of the audio through the Microphone object. To control the audio associated with a video file, you can use the DisplayObjectContainer.addChild() method to route the audio to an object on the display list; you can then create a Sound object to control some aspects of the audio. For more information, see the DisplayObjectContainer.addChild() method. If the video file can't be found, the netStatus event is dispatched. To stop a stream that is currently playing, use the close() method. When you use this method without Flash Media Server, consider the Flash Player security model. A SWF file in the local-trusted or local-with-networking sandbox can load and play a video file from the remote sandbox, but cannot access the remote file's data without explicit permission in the form of a cross-domain policy file. Also, 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. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper The Netstream.checkPolicyFile property. arguments The location of the video file to play, as a URLRequest object or a string. You can play local video files that are stored in the same directory as the SWF file or in a subdirectory; however, you can't navigate to a higher-level directory. Flash Media Server To play video files on Flash Media Server, specify the name of the stream without a file extension (for example, bolero). To play MP3 files, use mp3: before the stream name. To play the ID3 tags of MP3 files, use id3: before the stream name. With Flash Media Server, play() takes the following arguments: Name Required Description name:Object Required The name of a recorded file without a file extension, an identifier for live data published by NetStream.publish(), or false. To play MP3 files, use mp3 before the name. To play the ID3 tag of an MP3 file, use id3: before the name. If false, the stream stops playing and any additional parameters are ignored. start:Number Optional The start time, in seconds. Allowed values are -2, -1, 0, or a positive number. The default value is -2, which looks for a live stream, then a recorded stream, and if it finds neither, opens a live stream. If -1, plays only a live stream. If 0 or a positive number, plays a recorded stream, beginning start seconds in. len:Number Optional if start is specified. The duration of the playback, in seconds. Allowed values are -1, 0, or a positive number. The default value is -1, which plays a live or recorded stream until it ends. If 0, plays a single frame that is start seconds from the beginning of a recorded stream. If a positive number, plays a live or recorded stream for len seconds. reset:Object Optional if len is specified. Whether to clear a playlist. The default value is 1 or true, which clears any previous play calls and plays name immediately. If 0 or false, adds the stream to a playlist. If 2, maintains the playlist and returns all stream messages at once, rather than at intervals. If 3, clears the playlist and returns all stream messages at once. Flash Media Server This example plays a recorded stream, starting at the beginning, for up to 100 seconds: ns.play(&quot;record1&quot;, 0, 100, true); Flash Media Server This example plays a live stream published by a client, from beginning to end, starting immediately and clearing any previous streams: ns.play(&quot;stephen&quot;); Local untrusted SWF files cannot communicate with the Internet. You can work around this restriction by reclassifying this SWF file as local-with-networking or trusted."/>
<page href="flash/net/NetStream.html#publish()" title="NetStream.publish()" text="publish Sends streaming audio, video, and text messages from a client to Flash Media Server, optionally recording the stream during transmission. This method is available only to the publisher of the specified stream. Don't use this method to let a client play a stream that has already been published and recorded. Instead, create a NetStream instance for that client and call the play() method: var subscribeNS:NetStream = new NetStream(myNetConnection); subscribeNS.play(&quot;streamToPlay&quot;); When you record a stream using Flash Media Server, the server creates a file and stores it in a subdirectory in the application's directory on the server. Each stream is stored in a directory whose name matches the application instance name passed to NetConnection.connect(). The server creates these directories automatically; you don't have to create one for each application instance. For example, the following code shows how you would connect to a specific instance of an application stored in a directory named lectureSeries in your applications directory. A file named lecture.flv is stored in a subdirectory named /yourAppsFolder/lectureSeries/streams/Monday: var myNC:NetConnection = new NetConnection(); myNC.connect(&quot;rtmp://server.domain.com/lectureSeries/Monday&quot;); var myNS:NetStream = new NetStream(myNC); myNS.publish(&quot;lecture&quot;, &quot;record&quot;); The following example shows how to connect to a different instance of the same application but issue an identical publish command. A file named lecture.flv is stored in a subdirectory named /yourAppsFolder/lectureSeries/streams/Tuesday. var myNC:NetConnection = new NetConnection(); myNC.connect(&quot;rtmp://server.domain.com/lectureSeries/Tuesday&quot;); var myNS:NetStream = new NetStream(my_nc); myNS.publish(&quot;lecture&quot;, &quot;record&quot;); If you don't pass a value for the instance name, that matches the value passed to the name property is stored in a subdirectory named /yourAppsFolder/appName/streams/_definst_ (for &quot;default instance&quot;). For more information on using instance names, see the NetConnection.connect() method. For information on playing back video files, see the NetStream.play() method. When a Flash Media Server application client calls publish(), the application receives an onPublish event. The application must handle the event in a server-side script. When the client stops publishing, the application receives an onUnpublish event. For more information, see the Flash Media Server Server-Side ActionScript Language Reference. This method can dispatch a netStatus event with several different information objects. For example, if someone is already publishing on a stream with the specified name, the netStatus event is dispatched with a code property of NetStream.Publish.BadName. For more information, see the netStatus event. name type A string that identifies the stream. If you pass false, the publish operation stops. Clients that subscribe to this stream must pass this same name when they call NetStream.play(). You don't need to include a file extension for the stream name. Don't follow the stream name with a &quot;/&quot;. For example, don't use the stream name &quot;bolero/&quot;. A string that specifies how to publish the stream. Valid values are &quot;record&quot;, &quot;append&quot;, and &quot;live&quot;. The default value is &quot;live&quot;. If you pass &quot;record&quot;, Flash Player publishes and records live data, saving the recorded data to a new file with a name matching the value passed to the name parameter. The file is stored on the server in a subdirectory within the directory that contains the server application. If the file already exists, it is overwritten. If you pass &quot;append&quot;, Flash Player publishes and records live data, appending the recorded data to a file with a name that matches the value passed to the name parameter, stored on the server in a subdirectory within the directory that contains the server application. If no file with a matching name the name parameter is found, it is created. If you omit this parameter or pass &quot;live&quot;, Flash Player publishes live data without recording it. If a file with a name that matches the value passed to the name parameter exists, it is deleted."/>
<page href="flash/net/NetStream.html#receiveAudio()" title="NetStream.receiveAudio()" text="receiveAudio Specifies whether incoming audio plays on the stream. This method is available only to clients subscribed to the specified stream, not to the stream's publisher. This method is intended primarily for use with Flash Media Server; for more information, see the class description. You can call this method before or after you call the NetStream.play() method and actually begin receiving the stream. For example, you can attach these methods to a button the user clicks to mute and unmute the incoming audio stream. If the specified stream contains only audio data, passing a value of false to this method stops NetStream.time from further incrementing. flag Specifies whether incoming audio plays on the stream (true) or not (false). The default value is true."/>
<page href="flash/net/NetStream.html#receiveVideo()" title="NetStream.receiveVideo()" text="receiveVideo Specifies whether incoming video will play on the stream. This method is available only to clients subscribed to the specified stream, not to the stream's publisher. This method is intended primarily for use with Flash Media Server; for more information, see the class description. You can call this method before or after you call the NetStream.play() method and actually begin receiving the stream. For example, you can attach these methods to a button the user presses to show or hide the incoming video stream. If the specified stream contains only video data, passing a value of false to this method stops NetStream.time from further incrementing. flagOrFPS Specifies whether incoming video plays on this stream (true) or not (false). The default value is true. You can also use an integer to specify the frame rate per second of the incoming video. If you do not specify a frame rate, the frame rate defaults to that of the recorded or live video being played."/>
<page href="flash/net/NetStream.html#resume()" title="NetStream.resume()" text="resume Resumes playback of a video stream that is paused. If the video is already playing, calling this method does nothing."/>
<page href="flash/net/NetStream.html#seek()" title="NetStream.seek()" text="seek Seeks the keyframe (also called an I-frame in the video industry) closest to the specified location. The keyframe is placed at an offset, in seconds, from the beginning of the stream. Video streams are usually encoded with two types of frames, keyframes (or I-frames) and P-frames. A keyframe contains an entire image, while a P-frame is an interim frame that provides additional video information between keyframes. A video stream typically has a keyframe every 10 to 50 frames. On Flash Media Server, the behavior of seek() is controlled by the value of the EnhancedSeek element in the Application.xml configuration file. If EnhancedSeek is false, the server uses normal seek mode. In normal seek mode, the server starts streaming from the nearest keyframe. For example, if a video has keyframes at 0 and 10 seconds, a seek to 4 seconds causes playback to start at 4 seconds using the keyframe at 0 seconds. The video stays frozen until it reaches the next keyframe at 10 seconds. To get a better seeking experience, you need to reduce the keyframe interval. In normal seek mode, you cannot start the video at a point between the keyframes. If EnhancedSeek is true, the default value, the server generates a new keyframe at offset based on the previous keyframe and any intervening P-frames. However, this creates a high processing load on the server, and distortion might occur in the generated keyframe. If the video codec is On2, the keyframe before the seek point and any P-frames between the keyframe and the seek point are sent to the client. offset The approximate time value, in seconds, to move to in a video file. With Flash Media Server, if &lt;EnhancedSeek&gt; is set to true in the Application.xml configuration file (which it is by default), the server generates a keyframe at offset. To return to the beginning of the stream, pass 0 for offset. To seek forward from the beginning of the stream, pass the number of seconds to advance. For example, to position the playhead at 15 seconds from the beginning (or the keyframe before 15 seconds), use myStream.seek(15). To seek relative to the current position, pass NetStream.time + n or NetStream.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 NetStream.seek(NetStream.time - 20)."/>
<page href="flash/net/NetStream.html#send()" title="NetStream.send()" text="send Sends a message on a published stream to all subscribing clients. This method is available only to the publisher of the specified stream, and is intended for use with Flash Media Server. To process and respond to this message, create a handler on the NetStream object, for example, ns.HandlerName. Flash Player does not serialize methods or their data, object prototype variables, or non-enumerable variables. For display objects, Flash Player serializes the path but none of the data. You can call the send() method to add data keyframes to a live stream sent to Flash Media Server. A data keyframe is a message a publisher adds to a live stream. Data keyframes are typically used to add metadata to a live stream before data is captured for the stream from camera and microphone. A publisher can add a data keyframe at any time while the live stream is being published. The data keyframe is saved in the server's memory as long as the publisher is connected to the server. Clients who are subscribed to the live stream before a data keyframe is added receive the keyframe as soon as it is added. Clients who subscribe to the live stream after the data keyframe is added receive the keyframe when they subscribe. To add a keyframe of metadata to a live stream sent to Flash Media Server, use @setDataFrame as the handler name, followed by two additional arguments, for example: var ns:NetStream = new NetStream(nc); ns.send(&quot;@setDataFrame&quot;, &quot;onMetaData&quot;, metaData); The @setDataFrame argument refers to a special handler built in to Flash Media Server. The onMetaData argument is the name of a callback function in your client application that listens for the onMetaData event and retrieves the metadata. The third item, metaData, is an instance of Object or Array with properties that define the metadata values. Publishers should set property names that subscribers can easily understand; see the Flash Media Server documentation for a list of suggested property names. Use @clearDataFrame to clear a keyframe of metadata that has already been set in the stream: ns.send(&quot;@clearDataFrame&quot;, &quot;onMetaData&quot;); handlerName arguments The message to be sent; also the name of the ActionScript handler to receive the message. The handler name can be only one level deep (that is, it can't be of the form parent/child) and is relative to the stream object. Do not use a reserved term for a handler name. For example, using &quot;close&quot; as a handler name will cause the method to fail. With Flash Media Server, use @setDataFrame to add a keyframe of metadata to a live stream or @clearDataFrame to remove a keyframe. Optional arguments that can be of any type. They are serialized and sent over the connection, and the receiving handler receives them in the same order. If a parameter is a circular object (for example, a linked list that is circular), the serializer handles the references correctly. With Flash Media Server, if @setDataFrame is the first argument, use onMetaData as the second argument; for the third argument, pass an instance of Object or Array that has the metadata set as properties. See the Flash Media Server documentation for a list of suggested property names. With @clearDataFrame as the first argument, use onMetaData as the second argument and no third argument. Flash Media Server The following example creates two NetStream objects. One is used to publish a live stream to the server, while the other subscribes to the stream. package { import flash.display.Sprite; import flash.net.NetConnection; import flash.net.NetStream; import flash.events.NetStatusEvent; import flash.media.Video; import flash.utils.setTimeout; public class TestExample extends Sprite { var nc:NetConnection = new NetConnection(); var ns1:NetStream; var ns2:NetStream; var vid:Video = new Video(300,300); var obj:Object = new Object(); public function TestExample() { nc.objectEncoding = 0; nc.addEventListener(&quot;netStatus&quot;, onNCStatus); nc.connect(&quot;rtmp://localhost/FlashVideoApp&quot;); addChild(vid); } function onNCStatus(event:NetStatusEvent):void { switch (event.info.code) { case &quot;NetConnection.Connect.Success&quot;: trace(&quot;You've connected successfully&quot;); ns1 = new NetStream(nc); ns2 = new NetStream(nc); ns1.client = new CustomClient(); ns1.publish(&quot;dummy&quot;, &quot;live&quot;); ns2.play(&quot;dummy&quot;); ns2.client = new CustomClient(); vid.attachNetStream(ns2); setTimeout(sendHello, 3000); break; case &quot;NetStream.Publish.BadName&quot;: trace(&quot;Please check the name of the publishing stream&quot; ); break; } } function sendHello():void { ns1.send(&quot;myFunction&quot;, &quot;hello&quot;); } } } class CustomClient { public function myFunction(event:String):void { trace(event); } } Flash Media Server The following example creates metadata and adds it to a live stream: private function netStatusHandler(event:NetStatusEvent):void { switch (event.info.code) { case &quot;NetStream.Publish.Start&quot;: var metaData:Object = new Object(); metaData.title = &quot;myStream&quot;; metaData.width = 400; metaData.height = 200; ns.send(&quot;@setDataFrame&quot;, &quot;onMetaData&quot;, metaData); ns.attachCamera( Camera.getCamera() ); ns.attachAudio( Microphone.getMicrophone() ); } } Flash Media Server To respond to a data keyframe added to a video, the client needs to define an onMetaData event handler. The onMetaData event handler is not registered with addEventListener(), but instead is a callback function with the name onMetaData, for example: public function onMetaData(info:Object):void { trace(&quot;width: &quot; + info.width); trace(&quot;height: &quot; + info.height); } Flash Media Server This example shows how to create a playlist on the server: // Create a NetStream for playing var my_ns:NetStream = new NetStream(my_nc); my_video.attachNetStream(my_ns); // Play the stream record1 my_ns.play(&quot;record1&quot;, 0, -1, true); // Switch to the stream live1 and play for 5 seconds. // Since reset is false, live1 will start to play after record1 is done. my_ns.play(&quot;live1&quot;, -1 , 5, false); Flash Media Server If the recorded video file contains only data messages, you can either play the video file at the speed at which it was originally recorded, or you can get the data messages all at once. //To play at normal speed var my_ns:NetStream = new NetStream(my_nc); my_ns.play(&quot;log&quot;, 0, -1); //To get the data messages all at once my_ns.play(&quot;log&quot;, 0, -1, 3);"/>
<page href="flash/net/NetStream.html#togglePause()" title="NetStream.togglePause()" text="togglePause Pauses or resumes playback of a stream. The first time you call this method, it pauses play; the next time, it resumes play. You could use this method to let users pause or resume playback by pressing a single button."/>
<page href="flash/net/NetStream.html#bufferLength" title="NetStream.bufferLength" text="bufferLength The number of seconds of data currently in the buffer. You can use this property with the bufferTime property 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."/>
<page href="flash/net/NetStream.html#bufferTime" title="NetStream.bufferTime" text="bufferTime Specifies how long to buffer messages before starting to display the stream. For example, to make sure that the first 15 seconds of the stream play without interruption, set bufferTime to 15; Flash Player begins playing the stream only after 15 seconds of data are buffered. The default value is 0.1 (one-tenth of a second). To determine the number of seconds currently in the buffer, use the bufferLength property. Note: To avoid distortion when streaming pre-recorded (not live) content, do not set the value of Netstream.bufferTime to 0. By default, Flash Player uses an input buffer for pre-recorded content that queues the media data and plays the media properly. For pre-recorded content use the default setting or increase the buffer time. Flash Media Server. The buffer behavior depends on whether the buffer time is set on a publishing stream or a subscribing stream. For a publishing stream, bufferTime specifies how long the outgoing buffer can grow before Flash starts dropping frames. On a high-speed connection, buffer time should not be a concern; data will be sent almost as quickly as Flash can buffer it. On a slow connection, however, there might be a significant difference between how fast Flash buffers the data and how fast it can be sent to the client. For a subscribing stream, bufferTime specifies how long to buffer incoming data 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 will begin playing the stream only after 15 seconds of data have been buffered. When a recorded stream is played, if bufferTime is zero, Flash sets it to a small value (approximately 10 milliseconds). If live streams are later played (for example, from a playlist), this buffer time persists. That is, bufferTime remains nonzero for the stream."/>
<page href="flash/net/NetStream.html#bytesLoaded" title="NetStream.bytesLoaded" text="bytesLoaded The number of bytes of data that have been loaded into Flash Player. You can use this property with the bytesTotal property 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."/>
<page href="flash/net/NetStream.html#bytesTotal" title="NetStream.bytesTotal" text="bytesTotal The total size in bytes of the file being loaded into Flash Player."/>
<page href="flash/net/NetStream.html#checkPolicyFile" title="NetStream.checkPolicyFile" text="checkPolicyFile Specifies whether Flash Player should try to download a cross-domain policy file from the loaded video file's server before beginning to load the video file. This property applies when you are using a NetStream object for progressive video download (standalone files), or when you are loading files that are outside the calling SWF file's own domain. This property is ignored when you are using a NetStream object to get an RTMP asset. Set this property to true when you are loading an video file from outside the calling SWF file's domain and you need to use the BitmapData.draw() method for pixel-level access to the video. If you call BitmapData.draw() without setting the checkPolicyFile property to true at loading time, you may get a SecurityError exception because the required policy file was not downloaded. If you don't need pixel-level access to the video you are loading, avoid setting checkPolicyFile to true. Checking for a policy file consumes network bandwidth and may delay the start of your download. When you call the NetStream.play() method with checkPolicyFile set to true, Flash Player must either successfully download a relevant cross-domain policy file or determine that no such policy file exists before it begins downloading the object specified in your call to NetStream.play(). To verify the existence of a policy file, Flash Player performs the following actions, in this order: Flash Player considers policy files that have already been downloaded. Flash Player tries to download any pending policy files specified in calls to the Security.loadPolicyFile() method. Flash Player tries to download a policy file from the default location that corresponds to the URL you passed to NetStream.play(), which is /crossdomain.xml on the same server as that URL. In all cases, Flash Player requires that an appropriate policy file exist on the video's server, that it provide access to the object at the URL you passed to play() based on the policy file's location, and that it allow the domain of the calling SWF to access the video, through one or more &lt;allow-access-from&gt; tags. If you set checkPolicyFile to true, Flash Player waits until the policy file is verified before downloading the video. Wait to perform any pixel-level operations on the video data, such as calling BitmapData.draw(), until you receive onMetaData or NetStatus events from your NetStream object. If you set checkPolicyFile to true but no relevant policy file is found, you won't receive an error until you perform an operation that requires a policy file, and then Flash Player throws a SecurityError exception. Be careful with checkPolicyFile if you are downloading a file from a URL that uses server-side HTTP redirects. Flash Player tries to retrieve policy files that correspond to the initial URL that you specify in NetStream.play(). If the final file comes from a different URL because of HTTP redirects, the initially downloaded policy files might not be applicable to the file's final URL, which is the URL that matters in security decisions. For more information on policy files, see the &quot;Flash Player Security&quot; chapter of Programming ActionScript 3.0."/>
<page href="flash/net/NetStream.html#client" title="NetStream.client" text="client Specifies the object on which callback methods are invoked. The default object is this, the NetStream object being created. If you set the client property to another object, callback methods will be invoked on that other object. The client property must be set to a non-null object."/>
<page href="flash/net/NetStream.html#currentFPS" title="NetStream.currentFPS" text="currentFPS The number of frames per second being displayed. If you are exporting video files to be played back on a number of systems, you can check this value during testing to help you determine how much compression to apply when exporting the file."/>
<page href="flash/net/NetStream.html#liveDelay" title="NetStream.liveDelay" text="liveDelay The number of seconds of data in the subscribing stream's buffer in live (unbuffered) mode. This property specifies the current network transmission delay (lag time). This property is intended primarily for use with a server such as Flash Media Server; for more information, see the class description. You can get the value of this property to roughly gauge the transmission quality of the stream and communicate it to the user."/>
<page href="flash/net/NetStream.html#objectEncoding" title="NetStream.objectEncoding" text="objectEncoding The object encoding (AMF version) for this NetStream object. The NetStream object inherits its objectEncoding value from the associated NetConnection object. It's important to understand this property if your ActionScript 3.0 SWF file needs to communicate with servers released prior to Flash Player 9. For more information, see the objectEncoding property description in the NetConnection class. The value of this property depends on whether the stream is local or remote. Local streams, where null was passed to the NetConnection.connect() method, return the value of NetConnection.defaultObjectEncoding. Remote streams, where you are connecting to a server, return the object encoding of the connection to the server. If you try to read this property when not connected, or if you try to change this property, Flash Player throws an exception."/>
<page href="flash/net/NetStream.html#soundTransform" title="NetStream.soundTransform" text="soundTransform Controls sound in this NetStream object. For more information, see the SoundTransform class."/>
<page href="flash/net/NetStream.html#time" title="NetStream.time" text="time The position of the playhead, in seconds. Flash Media Server For a subscribing stream, the number of seconds the stream has been playing. For a publishing stream, the number of seconds the stream has been publishing. This number is accurate to the thousandths decimal place; multiply by 1000 to get the number of milliseconds the stream has been playing. For a subscribing stream, if the server stops sending data but the stream remains open, the value of time stops incrementing. When the server begins sending data again, the value continues incrementing from where it left off plus the time that elapsed while no data was sent. The value of time continues to increment when the stream switches from one playlist element to another. This property is set to 0 when NetStream.play() is called with reset set to 1 or true, or when NetStream.close() is called."/>
<page href="flash/net/NetStream.html#event:asyncError" title="NetStream.asyncError" text="asyncError Dispatched when an exception is thrown asynchronously — that is, from native asynchronous code. This event is dispatched when a server calls a method on the client that is not defined."/>
<page href="flash/net/NetStream.html#event:ioError" title="NetStream.ioError" text="ioError Dispatched when an input or output error occurs that causes a network operation to fail."/>
<page href="flash/net/NetStream.html#event:netStatus" title="NetStream.netStatus" text="netStatus Dispatched when a NetStream object is reporting its status or error condition. The netStatus event contains an info property, which is an information object that contains specific information about the event, such as if a connection attempt succeeded or failed."/>
<page href="flash/net/NetStream.html#event:onCuePoint" title="NetStream.onCuePoint" text="onCuePoint Invoked when an embedded cue point is reached while playing a video file. You can use this handler to trigger actions in your code when the video reaches a specific cue point, which lets you synchronize other actions in your application with video playback events. For information about video file formats supported by Flash Media Server, see the Flash Media Server documentation. This event is intended for use with Flash Media Server. It is not part of the Flash Player API, but is included in this language reference for your convenience. You cannot use the addEventListener() method, or any other EventDispatcher methods, to listen for or process this event. Rather, you must define a single callback function and attach it directly to one of the following objects: The object referenced by the client property of a NetStream instance. An instance of a NetStream subclass. NetStream is a sealed class, which means that properties or methods cannot be added to a NetStream object at runtime. However, you can create a subclass of NetStream and define your event handler in the subclass or make the subclass dynamic and add the event handler function to an instance of the subclass. The following types of cue points can be embedded in a video file: A navigation cue point specifies a keyframe within the video file and the cue point'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 event 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 object has the following properties: Property Description name The name given to the cue point when it was embedded in the video file. parameters A associative array of name/value pair strings specified for this cue point. Any valid string can be used for the parameter name or value. time The time in seconds at which the cue point occurred in the video file during playback. type The type of cue point that was reached, either navigation or event. You can define cue points in a video 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 also retrieves information about the cue points in a video file. However the onMetaData event gets information about all of the cue points before the video begins playing. The onCuePoint event receives information about a single cue point at the time specified for that cue point during playback. Generally, to have your code respond to a specific cue point at the time it occurs, use the onCuePoint event to trigger some action in your code. You can use the list of cue points provided to the onMetaData event to let the user start playing the video at predefined points along the video stream. Pass the value of the cue point's time property to the NetStream.seek() method to play the video from that cue point."/>
<page href="flash/net/NetStream.html#event:onMetaData" title="NetStream.onMetaData" text="onMetaData Dispatched when Flash Player receives descriptive information embedded in the video being played. For information about video file formats supported by Flash Media Server, see the Flash Media Server documentation. This special event is intended for use with Flash Media Server; for more information, see the class description. It is not technically part of the Flash Player API, but is included in this language reference for your convenience. You cannot use the addEventListener() method, or any other EventDispatcher methods, to listen for or process this event. Rather, you must define a single callback function and attach it directly to one of the following objects: The object that the client property of a NetStream instance references. An instance of a NetStream subclass. NetStream is a sealed class, which means that properties or methods cannot be added to a NetStream object at runtime. However, you can create a subclass of NetStream and define your event handler in the subclass or make the subclass dynamic and add the event handler function to an instance of the subclass. The Flash Video Exporter utility (version 1.1 or later) embeds a video's duration, creation date, data rates, and other information into the video file itself. Different video encoders embed different sets of meta data. This event 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 stream metadata approximates the actual duration but is not exact. In other words, it does not always match the value of the NetStream.time property when the playhead is at the end of the video stream."/>
<page href="flash/net/NetStream.html#event:onPlayStatus" title="NetStream.onPlayStatus" text="onPlayStatus Dispatched when a NetStream object has completely played a stream. This handler returns information objects that provide information in addition to what's returned by the netStatus event. You can use this handler to trigger actions in your code when a NetStream object has switched from one stream to another stream in a playlist (as indicated by the information object NetStream.Play.Switch) or when a NetStream object has played to the end (as indicated by the information object NetStream.Play.Complete). To respond to this event, you must create a function to process the information object sent by the server. This event is intended for use with Flash Media Server; for more information, see the class description. It is not part of the Flash Player API, but is included in this language reference for your convenience. You cannot use the addEventListener() method, or any other EventDispatcher methods, to listen for or process this event. Rather, you must define a single callback function and attach it directly to one of the following objects: The object that the client property of a NetStream instance references. An instance of a NetStream subclass. NetStream is a sealed class, which means that properties or methods cannot be added to a NetStream object at runtime. However, you can create a subclass of NetStream and define your event handler in the subclass or make the subclass dynamic and add the event handler function to an instance of the subclass. This event can return an information object with the following properties: Code property Level property Meaning NetStream.Play.Switch &quot;status&quot; The subscriber is switching from one stream to another in a playlist. NetStream.Play.Complete &quot;status&quot; Playback has completed."/>
<page href="flash/net/URLStream.html" title="URLStream class" text="URLStream The URLStream class provides low-level access to downloading URLs. Data is made available to ActionScript immediately as it is downloaded, instead of waiting until the entire file is complete as with URLLoader. The URLStream class also lets you close a stream before it finishes downloading. The contents of the downloaded file are made available as raw binary data. The read operations in URLStream are nonblocking. This means that you must use the bytesAvailable property to determine whether sufficient data is available before reading it. An EOFError exception is thrown if insufficient data is available. All binary data is encoded by default in big-endian format, with the most significant byte first. The security rules that apply to URL downloading with the URLStream class are identical to the rules applied to URLLoader objects. Policy files may be downloaded as needed. Local file security rules are enforced, and security warnings are raised as needed."/>
<page href="flash/net/URLStream.html#close()" title="URLStream.close()" text="close Immediately closes the stream and cancels the download operation. No data can be read from the stream after the close() method is called. The stream could not be closed, or the stream was not open."/>
<page href="flash/net/URLStream.html#load()" title="URLStream.load()" text="load Begins downloading the URL specified in the request parameter. Note: If a file being loaded contains non-ASCII characters (as found in many non-English languages), it is recommended that you save the file with UTF-8 or UTF-16 encoding, as opposed to a non-Unicode format like ASCII. If the loading operation fails immediately, an IOError or SecurityError (including the local file security error) exception is thrown describing the failure. Otherwise, an open event is dispatched if the URL download starts downloading successfully, or an error event is dispatched if an error occurs. When using this method, consider the Adobe® Flash® Player security model: Data loading is not allowed if the calling SWF file is in the local-with-file-system sandbox and the target resource is from a network sandbox. Data loading is also not allowed if the calling SWF file is from a network sandbox and the target resource is local. By default, the URL you load must be in exactly the same domain as the calling SWF file. For example, a SWF file at www.adobe.com can load data only from sources that are also at www.adobe.com. To load data from a different domain, put a cross-domain policy file on the server hosting the data. 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. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper request A URLRequest object specifying the URL to download. If the value of this parameter or the URLRequest.url property of the URLRequest object passed are null, Flash Player throws a null pointer error. URLRequest.requestHeader objects may not contain certain prohibited HTTP request headers. For more information, see the URLRequestHeader class description."/>
<page href="flash/net/URLStream.html#readBoolean()" title="URLStream.readBoolean()" text="readBoolean Reads a Boolean value from the stream. A single byte is read, and true is returned if the byte is nonzero, false otherwise. There is insufficient data available to read. If a local SWF file triggers a security warning, Flash Player prevents the URLStream data from being available to ActionScript. When this happens, the bytesAvailable property returns 0 even if data has been received, and any of the read methods throws an EOFError exception."/>
<page href="flash/net/URLStream.html#readByte()" title="URLStream.readByte()" text="readByte Reads a signed byte from the stream. The returned value is in the range -128...127. There is insufficient data available to read. If a local SWF file triggers a security warning, Flash Player prevents the URLStream data from being available to ActionScript. When this happens, the bytesAvailable property returns 0 even if data has been received, and any of the read methods throws an EOFError exception."/>
<page href="flash/net/URLStream.html#readBytes()" title="URLStream.readBytes()" text="readBytes Reads length bytes of data from the stream. The bytes are read into the ByteArray object specified by bytes, starting offset bytes into the ByteArray object. bytes offset length The ByteArray object to read data into. The offset into bytes at which data read should begin. Defaults to 0. The number of bytes to read. The default value of 0 will cause all available data to be read. There is insufficient data available to read. If a local SWF file triggers a security warning, Flash Player prevents the URLStream data from being available to ActionScript. When this happens, the bytesAvailable property returns 0 even if data has been received, and any of the read methods throws an EOFError exception."/>
<page href="flash/net/URLStream.html#readDouble()" title="URLStream.readDouble()" text="readDouble Reads an IEEE 754 double-precision floating-point number from the stream. There is insufficient data available to read. If a local SWF file triggers a security warning, Flash Player prevents the URLStream data from being available to ActionScript. When this happens, the bytesAvailable property returns 0 even if data has been received, and any of the read methods throws an EOFError exception."/>
<page href="flash/net/URLStream.html#readFloat()" title="URLStream.readFloat()" text="readFloat Reads an IEEE 754 single-precision floating-point number from the stream. There is insufficient data available to read. If a local SWF file triggers a security warning, Flash Player prevents the URLStream data from being available to ActionScript. When this happens, the bytesAvailable property returns 0 even if data has been received, and any of the read methods throws an EOFError exception."/>
<page href="flash/net/URLStream.html#readInt()" title="URLStream.readInt()" text="readInt Reads a signed 32-bit integer from the stream. The returned value is in the range -2147483648...2147483647. There is insufficient data available to read. If a local SWF file triggers a security warning, Flash Player prevents the URLStream data from being available to ActionScript. When this happens, the bytesAvailable property returns 0 even if data has been received, and any of the read methods throws an EOFError exception."/>
<page href="flash/net/URLStream.html#readMultiByte()" title="URLStream.readMultiByte()" text="readMultiByte Reads a multibyte string of specified length from the byte stream using the specified character set. length charSet The number of bytes from the byte stream to read. The string denoting the character set to use to interpret the bytes. Possible character set strings include &quot;shift_jis&quot;, &quot;CN-GB&quot;, &quot;iso-8859-1&quot;, and others. For a complete list, see Supported Character Sets. Note: If the value for the charSet parameter is not recognized by the current system, then Flash Player uses the system's default code page as the character set. For example, a value for the charSet parameter, as in myTest.readMultiByte(22, &quot;iso-8859-01&quot;) that uses 01 instead of 1 might work on your development machine, but not on another machine. On the other machine, Flash Player will use the system's default code page. There is insufficient data available to read."/>
<page href="flash/net/URLStream.html#readObject()" title="URLStream.readObject()" text="readObject Reads an object from the socket, encoded in Action Message Format (AMF). There is insufficient data available to read. If a local SWF file triggers a security warning, Flash Player prevents the URLStream data from being available to ActionScript. When this happens, the bytesAvailable property returns 0 even if data has been received, and any of the read methods throws an EOFError exception."/>
<page href="flash/net/URLStream.html#readShort()" title="URLStream.readShort()" text="readShort Reads a signed 16-bit integer from the stream. The returned value is in the range -32768...32767. There is insufficient data available to read. If a local SWF file triggers a security warning, Flash Player prevents the URLStream data from being available to ActionScript. When this happens, the bytesAvailable property returns 0 even if data has been received, and any of the read methods throws an EOFError exception."/>
<page href="flash/net/URLStream.html#readUnsignedByte()" title="URLStream.readUnsignedByte()" text="readUnsignedByte Reads an unsigned byte from the stream. The returned value is in the range 0...255. There is insufficient data available to read. If a local SWF file triggers a security warning, Flash Player prevents the URLStream data from being available to ActionScript. When this happens, the bytesAvailable property returns 0 even if data has been received, and any of the read methods throws an EOFError exception."/>
<page href="flash/net/URLStream.html#readUnsignedInt()" title="URLStream.readUnsignedInt()" text="readUnsignedInt Reads an unsigned 32-bit integer from the stream. The returned value is in the range 0...4294967295. There is insufficient data available to read. If a local SWF file triggers a security warning, Flash Player prevents the URLStream data from being available to ActionScript. When this happens, the bytesAvailable property returns 0 even if data has been received, and any of the read methods throws an EOFError exception."/>
<page href="flash/net/URLStream.html#readUnsignedShort()" title="URLStream.readUnsignedShort()" text="readUnsignedShort Reads an unsigned 16-bit integer from the stream. The returned value is in the range 0...65535. There is insufficient data available to read. If a local SWF file triggers a security warning, Flash Player prevents the URLStream data from being available to ActionScript. When this happens, the bytesAvailable property returns 0 even if data has been received, and any of the read methods throws an EOFError exception."/>
<page href="flash/net/URLStream.html#readUTF()" title="URLStream.readUTF()" text="readUTF Reads a UTF-8 string from the stream. The string is assumed to be prefixed with an unsigned short indicating the length in bytes. There is insufficient data available to read. If a local SWF file triggers a security warning, Flash Player prevents the URLStream data from being available to ActionScript. When this happens, the bytesAvailable property returns 0 even if data has been received, and any of the read methods throws an EOFError exception."/>
<page href="flash/net/URLStream.html#readUTFBytes()" title="URLStream.readUTFBytes()" text="readUTFBytes Reads a sequence of length UTF-8 bytes from the stream, and returns a string. length A sequence of UTF-8 bytes. There is insufficient data available to read. If a local SWF file triggers a security warning, Flash Player prevents the URLStream data from being available to ActionScript. When this happens, the bytesAvailable property returns 0 even if data has been received, and any of the read methods throws an EOFError exception."/>
<page href="flash/net/URLStream.html#bytesAvailable" title="URLStream.bytesAvailable" text="bytesAvailable Returns the number of bytes of data available for reading in the input buffer. Your code must call the bytesAvailable property to ensure that sufficient data is available before you try to read it with one of the read methods."/>
<page href="flash/net/URLStream.html#connected" title="URLStream.connected" text="connected Indicates whether this URLStream object is currently connected. A call to this property returns a value of true if the URLStream object is connected, or false otherwise."/>
<page href="flash/net/URLStream.html#endian" title="URLStream.endian" text="endian Indicates the byte order for the data; possible values are BIG_ENDIAN or LITTLE_ENDIAN."/>
<page href="flash/net/URLStream.html#objectEncoding" title="URLStream.objectEncoding" text="objectEncoding Controls the version of Action Message Format (AMF) used when writing or reading an object."/>
<page href="flash/net/URLStream.html#event:complete" title="URLStream.complete" text="complete Dispatched when data has loaded successfully."/>
<page href="flash/net/URLStream.html#event:httpStatus" title="URLStream.httpStatus" text="httpStatus Dispatched if a call to URLStream.load() attempts to access data over HTTP, and the current Flash Player is able to detect and return the status code for the request. (Some browser environments may not be able to provide this information.) Note that the httpStatus (if any) will be sent before (and in addition to) any complete or error event."/>
<page href="flash/net/URLStream.html#event:ioError" title="URLStream.ioError" text="ioError Dispatched when an input/output error occurs that causes a load operation to fail."/>
<page href="flash/net/URLStream.html#event:open" title="URLStream.open" text="open Dispatched when a load operation starts."/>
<page href="flash/net/URLStream.html#event:progress" title="URLStream.progress" text="progress Dispatched when data is received as the download operation progresses. Data that has been received can be read immediately using the methods of the URLStream class."/>
<page href="flash/net/URLStream.html#event:securityError" title="URLStream.securityError" text="securityError Dispatched if a call to URLStream.load() attempts to load data from a server outside the security sandbox."/>
<page href="flash/net/SharedObjectFlushStatus.html" title="SharedObjectFlushStatus class" text="SharedObjectFlushStatus The SharedObjectFlushStatus class provides values for the code returned from a call to the SharedObject.flush() method."/>
<page href="flash/net/SharedObjectFlushStatus.html#FLUSHED" title="SharedObjectFlushStatus.FLUSHED" text="FLUSHED Indicates that the flush completed successfully."/>
<page href="flash/net/SharedObjectFlushStatus.html#PENDING" title="SharedObjectFlushStatus.PENDING" text="PENDING Indicates that the user is being prompted to increase disk space for the shared object before the flush can occur."/>
<page href="flash/net/URLRequest.html" title="URLRequest class" text="URLRequest The URLRequest class captures all of the information in a single HTTP request. URLRequest objects are passed to the load() methods of URLStream, URLLoader, Loader and other loading operations to initiate URL downloads, as well as to the upload() and download() methods of the FileReference class. By default, the URL that you pass to the url parameter must be in exactly the same domain as the calling SWF file, including subdomains. For example, www.adobe.com and store.adobe.com are different domains. To load data from a different domain, place a cross-domain policy file on the server that is hosting the data. When you use this class, consider the Adobe® Flash® Player security model: Data loading is not allowed if the calling SWF file is in the local-with-file-system sandbox and the target resource is from a network sandbox. Data loading is also not allowed if the calling SWF file is from a network sandbox and the target resource is local. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper"/>
<page href="flash/net/URLRequest.html#URLRequest()" title="URLRequest.URLRequest()" text="URLRequest Creates a URLRequest object. If System.useCodePage is true, the request is encoded using the system code page, rather than Unicode. If System.useCodePage is false, the request is encoded using Unicode, rather than the system code page. url The URL to be requested. You can set the URL later by using the url property."/>
<page href="flash/net/URLRequest.html#contentType" title="URLRequest.contentType" text="contentType The MIME content type of any POST data. Note:The FileReference.upload() and FileReference.download() methods do not support the URLRequest.contentType parameter."/>
<page href="flash/net/URLRequest.html#data" title="URLRequest.data" text="data An object containing data to be transmitted with the URL request. This property is used with the method property. If the value of URLRequest.method is POST, the data is transmitted with the URLRequest object with the HTTP POST method. If the value of URLRequest.method is GET, the data defines variables to be sent with the URLRequest object with the HTTP GET method. The URLRequest API offers binary POST support and support for URL-encoded variables, as well as support for strings. The data object can be of ByteArray, URLVariables, or String type. The way in which the data is used depends on the type of object used: If the object is a ByteArray object, the binary data of the ByteArray object is used as POST data. For GET, data of ByteArray type is not supported. Also, data of ByteArray type is not supported for FileReference.upload() and FileReference.download(). If the object is a URLVariables object and the method is POST, the variables are encoded using x-www-form-urlencoded format and the resulting string is used as POST data. An exception is a call to FileReference.upload(), in which the variables are sent as separate fields in a multipart/form-data post. If the object is a URLVariables object and the method is GET, the URLVariables object defines variables to be sent with the URLRequest object. Otherwise, the object is converted to a string, and the string is used as the POST or GET data. This data is not sent until a method, such as navigateToURL() or FileReference.upload(), uses the URLRequest object. The following example opens the remote application hosted at http://www.[yourDomain].com/application.jsp in a new browser window and passes data about a user session, captured in a URLVariables object, to the application. Highlights of the example follow: The constructor function creates a URLRequest instance named request, taking the URL of the remote application as a parameter. A URLVariables object is created and two of its properties are assigned values. The URLVariables object is assigned to the data property of the URLRequest object. The example calls navigateToURL, which opens a new browser window to the remote application's URL. Note: To run the example, the remote application URL in the example must be replaced with a working URL. Additionally, you would need server code to process the information captured by Flash Player in the URLVariables object. package { import flash.display.Sprite; import flash.net.navigateToURL; import flash.net.URLRequest; import flash.net.URLVariables; public class URLVariablesExample extends Sprite { public function URLVariablesExample() { var url:String = &quot;http://www.[yourDomain].com/application.jsp&quot;; var request:URLRequest = new URLRequest(url); var variables:URLVariables = new URLVariables(); variables.exampleSessionId = new Date().getTime(); variables.exampleUserLabel = &quot;guest&quot;; request.data = variables; navigateToURL(request); } } }"/>
<page href="flash/net/URLRequest.html#method" title="URLRequest.method" text="method Controls whether the HTTP form submission method is a GET or POST operation. Valid values are URLRequestMethod.GET or URLRequestMethod.POST. The following example opens the remote application hosted at http://www.[yourDomain].com/application.jsp in a new browser window and passes data about a user session, captured in a URLVariables object, to the application. It explicitly sets the value of the URLRequest.method property to URLRequestMethod.POST. Highlights of the example follow: The constructor function creates a URLRequest instance named request, taking the URL of the remote application as a parameter. A URLVariables object is created and two of its properties are assigned values. The URLVariables object is assigned to the data property of the URLRequest object. The value of the URLRequest.method property is set to URLRequestMethod.POST. The example calls navigateToURL, which opens a new browser window to the remote application's URL. Note: To run the example, the remote application URL in the example must be replaced with a working URL. Additionally, you would need server code to process the information captured by Flash Player in the URLVariables object. package { import flash.display.Sprite; import flash.net.navigateToURL; import flash.net.URLRequest; import flash.net.URLRequestMethod; import flash.net.URLVariables; public class URLRequest_method extends Sprite { public function URLRequest_method() { var url:String = &quot;http://www.[yourDomain].com/application.jsp&quot;; var request:URLRequest = new URLRequest(url); var variables:URLVariables = new URLVariables(); variables.exampleSessionId = new Date().getTime(); variables.exampleUserLabel = &quot;guest&quot;; request.data = variables; request.method = URLRequestMethod.POST; navigateToURL(request); } } } If the value parameter is not URLRequestMethod.GET or URLRequestMethod.POST."/>
<page href="flash/net/URLRequest.html#requestHeaders" title="URLRequest.requestHeaders" text="requestHeaders The array of HTTP request headers to be appended to the HTTP request. The array is composed of URLRequestHeader objects. Each object in the array must be a URLRequestHeader object that contains a name string and a value string, as follows: var rhArray:Array = new Array(new URLRequestHeader(&quot;Content-Type&quot;, &quot;text/html&quot;)); Flash Player imposes certain restrictions on request headers; for more information, see the URLRequestHeader class description. The FileReference.upload() and FileReference.download() methods do not support the URLRequest.requestHeaders parameter."/>
<page href="flash/net/URLRequest.html#url" title="URLRequest.url" text="url The URL to be requested. By default, the URL must be in exactly the same domain as the calling SWF file, including subdomains. For example, SWF files at www.adobe.com and store.adobe.com are in different domains. To load data from a different domain, put a cross-domain policy file on the server that is hosting the data. For more information, see the security documentation described in the URLRequest class description. Note: Flash Player Update 3 and later versions supports IPv6 (Internet Protocol version 6). IPv6 is a version of Internet Protocol that supports 128-bit addresses (an improvement on the earlier IPv4 protocol that supports 32-bit addresses). You might need to activate IPv6 on your networking interfaces. For more information, see the Help for the operating system hosting the data. If IPv6 is supported on the hosting system, you can specify numeric IPv6 literal addresses in URLs enclosed in brackets ([]), as in the following: rtmp://[2001:db8:ccc3:ffff:0:444d:555e:666f]:1935/test"/>
<page href="flash/net/URLLoaderDataFormat.html" title="URLLoaderDataFormat class" text="URLLoaderDataFormat The URLLoaderDataFormat class provides values that specify how downloaded data is received."/>
<page href="flash/net/URLLoaderDataFormat.html#BINARY" title="URLLoaderDataFormat.BINARY" text="BINARY Specifies that downloaded data is received as raw binary data."/>
<page href="flash/net/URLLoaderDataFormat.html#TEXT" title="URLLoaderDataFormat.TEXT" text="TEXT Specifies that downloaded data is received as text."/>
<page href="flash/net/URLLoaderDataFormat.html#VARIABLES" title="URLLoaderDataFormat.VARIABLES" text="VARIABLES Specifies that downloaded data is received as URL-encoded variables."/>
<page href="flash/net/XMLSocket.html" title="XMLSocket class" text="XMLSocket The XMLSocket class implements client sockets that let the computer that is running Flash Player communicate with a server computer identified by an IP address or domain name. The XMLSocket class is useful for client-server applications that require low latency, such as real-time chat systems. A traditional HTTP-based chat solution frequently polls the server and downloads new messages 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 that understands the protocol used by the XMLSocket class. The protocol is described in the following list: 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 XMLSocket.connect() method can connect only to TCP port numbers greater than or equal to 1024. One consequence of this restriction is that the server daemons that communicate with the XMLSocket object must also be assigned to port numbers greater than or equal to 1024. Port numbers below 1024 are often used by system services such as FTP, Telnet, and HTTP, so XMLSocket objects are barred from these ports for security reasons. The port number restriction limits the possibility that these resources will be inappropriately accessed and abused. Setting up a server to communicate with the XMLSocket object can be challenging. If your application does not require real-time interactivity, use the URLLoader class instead of the XMLSocket class. To use the methods of the XMLSocket class, you must first use the constructor, new XMLSocket, to create an XMLSocket object. When you use this class, consider the Flash Player security model: Sending or receiving data is not allowed if the calling SWF file is in the local-with-file-system sandbox and the target resource is from a network sandbox. Sending or receiving data is also not allowed if the calling SWF file is from a network sandbox and the target resource is local. The calling SWF file and the network resource being accessed must be in exactly the same domain. For example, a SWF file at www.adobe.com can send or receive data only from sources that are also at www.adobe.com. Websites can permit cross-domain access to a resource through a cross-domain policy file. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper"/>
<page href="flash/net/XMLSocket.html#XMLSocket()" title="XMLSocket.XMLSocket()" text="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. host port 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, host must be in the same domain as the SWF file. The TCP port number on the host used to establish a connection. The port number must be 1024 or greater, unless a policy file is being used."/>
<page href="flash/net/XMLSocket.html#close()" title="XMLSocket.close()" text="close Closes the connection specified by the XMLSocket object. The close event is dispatched only when the server closes the connection; it is not dispatched when you call the close() method."/>
<page href="flash/net/XMLSocket.html#connect()" title="XMLSocket.connect()" text="connect Establishes a connection to the specified Internet host using the specified TCP port. By default you can only connect to port 1024 or higher, unless you are using a policy file. 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.adobe.com, specifying null for the host parameter is the same as entering the IP address for www.adobe.com. In SWF files running in a version of the player earlier than Flash Player 7, host must be in the same superdomain as the SWF file that is issuing this call. For example, a SWF file at www.adobe.com can send or receive variables from a SWF file at store.adobe.com because both files are in the same superdomain of adobe.com. In SWF files of any version running in Flash Player 7 or later, host must be in exactly the same domain. For example, a SWF file at www.adobe.com that is published for Flash Player 5, but is running in Flash Player 7 or later can send or receive variables only from SWF files that are also at www.adobe.com. If you want to send or receive variables from a different domain, you can place a cross-domain policy file on the server hosting the SWF file that is being accessed. 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. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper host port 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, host must be in the same domain as the SWF file. The TCP port number on the host used to establish a connection. The port number must be 1024 or greater, unless a policy file is being used. Local untrusted SWF files may not communicate with the Internet. This may be worked around by reclassifying this SWF file as local-with-networking or trusted."/>
<page href="flash/net/XMLSocket.html#send()" title="XMLSocket.send()" text="send Converts 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 XML textual representation of the XML object. The send operation is asynchronous; it returns immediately, but the data may be transmitted at a later time. The XMLSocket.send() method does not return a value indicating whether the data was successfully transmitted. If you do not connect the XMLSocket object to the server using XMLSocket.connect()), the XMLSocket.send() operation fails. object An XML object or other data to transmit to the server. The XMLSocket object is not connected to the server."/>
<page href="flash/net/XMLSocket.html#connected" title="XMLSocket.connected" text="connected Indicates whether this XMLSocket object is currently connected. You can also check whether the connection succeeded by registering for the connect event and ioError event."/>
<page href="flash/net/XMLSocket.html#event:close" title="XMLSocket.close" text="close Dispatched when the server closes the socket connection. The close event is dispatched only when the server closes the connection; it is not dispatched when you call the XMLSocket.close() method."/>
<page href="flash/net/XMLSocket.html#event:connect" title="XMLSocket.connect" text="connect Dispatched after a successful call to the XMLSocket.connect() method."/>
<page href="flash/net/XMLSocket.html#event:data" title="XMLSocket.data" text="data Dispatched after raw data is sent or received."/>
<page href="flash/net/XMLSocket.html#event:ioError" title="XMLSocket.ioError" text="ioError Dispatched when an input/output error occurs that causes a send or receive operation to fail."/>
<page href="flash/net/XMLSocket.html#event:securityError" title="XMLSocket.securityError" text="securityError Dispatched if a call to the XMLSocket.connect() method attempts to connect either to a server outside the caller's security sandbox or to a port lower than 1024."/>
<page href="flash/net/URLLoader.html" title="URLLoader class" text="URLLoader The URLLoader class downloads data from a URL as text, binary data, or URL-encoded variables. It is useful for downloading text files, XML, or other information to be used in a dynamic, data-driven application. A URLLoader object downloads all of the data from a URL before making it available to ActionScript. It sends out notifications about the progress of the download, which you can monitor through the bytesLoaded and bytesTotal properties, as well as through dispatched events. When using this method, consider the Adobe® Flash® Player security model: For Flash Player 8 and later: Data loading is not allowed if the calling SWF file is in the local-with-file-system sandbox and the target resource is from a network sandbox. Data loading is also not allowed if the calling SWF file is from a network sandbox and the target resource is local. For Flash Player 7 and later: Websites can permit cross-domain access to a resource through a cross-domain policy file. In SWF files of any version running in Flash Player 7 and later, url must be in exactly the same domain. For example, a SWF file at www.adobe.com can load data only from sources that are also at www.adobe.com. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper In SWF files that are 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's URL. For example, a SWF file at www.adobe.com can load data from sources at store.adobe.com because both files are in the same superdomain named adobe.com."/>
<page href="flash/net/URLLoader.html#URLLoader()" title="URLLoader.URLLoader()" text="URLLoader Creates a URLLoader object. request A URLRequest object specifying the URL to download. If this parameter is omitted, no load operation begins. If specified, the load operation begins immediately (see the load entry for more information)."/>
<page href="flash/net/URLLoader.html#close()" title="URLLoader.close()" text="close Closes the load operation in progress. Any load operation in progress is immediately terminated. If no URL is currently being streamed, an invalid stream error is thrown."/>
<page href="flash/net/URLLoader.html#load()" title="URLLoader.load()" text="load Sends and loads data from the specified URL. The data can be received as text, raw binary data, or URL-encoded variables, depending on the value you set for the dataFormat property. Note that the default value of the dataFormat property is text. If you want to send data to the specified URL, you can set the data property in the URLRequest object. Note: If a file being loaded contains non-ASCII characters (as found in many non-English languages), it is recommended that you save the file with UTF-8 or UTF-16 encoding as opposed to a non-Unicode format like ASCII. When using this method, consider the Flash Player security model: For Flash Player 9 and later, 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. For Flash Player 8 and later: Data loading is not allowed if the calling SWF file is in the local-with-file-system sandbox and the target resource is from a network sandbox. Data loading is also not allowed if the calling SWF file is from a network sandbox and the target resource is local. For Flash Player 7 and later websites can permit cross-domain access to a resource through a cross-domain policy file. In SWF files of any version running in Flash Player 7 and later, url must be in exactly the same domain. For example, a SWF file at www.adobe.com can load data only from sources that are also at www.adobe.com. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper In SWF files that are 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's URL. For example, a SWF file at www.adobe.com can load data from sources at store.adobe.com because both files are in the same superdomain of adobe.com. request A URLRequest object specifying the URL to download. In the following example, an XML files is loaded and the content of its elements' first arguments are displayed in a text field. A URLRequest object is created to identify the location of the XML file, which for this example is in the same directory as the SWF file. The file is loaded in a try...catch block in order to catch any error that may occur. (Here we catch the SecurityError errors.) If an IO_ERROR event occurs, the errorHandler() method is invoked, which writes an error message in the xmlTextField text field. Once the XML file data is received and place in the data property of the loader URLLoader object, the Event.COMPLETE event is dispatched and the loaderCompleteHandler() method is invoked. In the loaderCompleteHandler() method, a try...catch block is used to catch any parsing error that may occur while converting the loaded data from the file into an XML object. The readNodes() method then recursively goes through all the elements in the nodes of the XML document and appends the xmlTextField text field with a list of the first attributes of all the elements. package { import flash.display.Sprite; import flash.events.Event; import flash.net.URLLoader; import flash.net.URLRequest; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.xml.*; import flash.events.IOErrorEvent; public class URLLoader_loadExample extends Sprite { private var xmlTextField:TextField = new TextField(); private var externalXML:XML; private var loader:URLLoader; public function URLLoader_loadExample() { var request:URLRequest = new URLRequest(&quot;xmlFile.xml&quot;); loader = new URLLoader(); try { loader.load(request); } catch (error:SecurityError) { trace(&quot;A SecurityError has occurred.&quot;); } loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler); loader.addEventListener(Event.COMPLETE, loaderCompleteHandler); xmlTextField.x = 10; xmlTextField.y = 10; xmlTextField.background = true; xmlTextField.autoSize = TextFieldAutoSize.LEFT; addChild(xmlTextField); } private function loaderCompleteHandler(event:Event):void { try { externalXML = new XML(loader.data); readNodes(externalXML); } catch (e:TypeError) { trace(&quot;Could not parse the XML file.&quot;); } } private function readNodes(node:XML):void { for each (var element:XML in node.elements()) { xmlTextField.appendText(element.attributes()[0] + &quot;\n&quot;); readNodes(element); } } private function errorHandler(e:IOErrorEvent):void { xmlTextField.text = &quot;Had problem loading the XML File.&quot;; } } } URLRequest.requestHeader objects may not contain certain prohibited HTTP request headers. For more information, see the URLRequestHeader class description."/>
<page href="flash/net/URLLoader.html#bytesLoaded" title="URLLoader.bytesLoaded" text="bytesLoaded Indicates the number of bytes that have been loaded thus far during the load operation."/>
<page href="flash/net/URLLoader.html#bytesTotal" title="URLLoader.bytesTotal" text="bytesTotal Indicates the total number of bytes in the downloaded data. This property contains 0 while the load operation is in progress and is populated when the operation is complete. Also, a missing Content-Length header will result in bytesTotal being indeterminate."/>
<page href="flash/net/URLLoader.html#data" title="URLLoader.data" text="data The data received from the load operation. This property is populated only when the load operation is complete. The format of the data depends on the setting of the dataFormat property: If the dataFormat property is URLLoaderDataFormat.TEXT, the received data is a string containing the text of the loaded file. If the dataFormat property is URLLoaderDataFormat.BINARY, the received data is a ByteArray object containing the raw binary data. If the dataFormat property is URLLoaderDataFormat.VARIABLES, the received data is a URLVariables object containing the URL-encoded variables."/>
<page href="flash/net/URLLoader.html#dataFormat" title="URLLoader.dataFormat" text="dataFormat Controls whether the downloaded data is received as text (URLLoaderDataFormat.TEXT), raw binary data (URLLoaderDataFormat.BINARY), or URL-encoded variables (URLLoaderDataFormat.VARIABLES). If the value of the dataFormat property is URLLoaderDataFormat.TEXT, the received data is a string containing the text of the loaded file. If the value of the dataFormat property is URLLoaderDataFormat.BINARY, the received data is a ByteArray object containing the raw binary data. If the value of the dataFormat property is URLLoaderDataFormat.VARIABLES, the received data is a URLVariables object containing the URL-encoded variables."/>
<page href="flash/net/URLLoader.html#event:complete" title="URLLoader.complete" text="complete Dispatched after all the received data is decoded and placed in the data property of the URLLoader object. The received data may be accessed once this event has been dispatched."/>
<page href="flash/net/URLLoader.html#event:httpStatus" title="URLLoader.httpStatus" text="httpStatus Dispatched if a call to URLLoader.load() attempts to access data over HTTP and the current Flash Player environment is able to detect and return the status code for the request. (Some browser environments may not be able to provide this information.) Note that the httpStatus event (if any) is sent before (and in addition to) any complete or error event."/>
<page href="flash/net/URLLoader.html#event:ioError" title="URLLoader.ioError" text="ioError Dispatched if a call to URLLoader.load() results in a fatal error that terminates the download."/>
<page href="flash/net/URLLoader.html#event:open" title="URLLoader.open" text="open Dispatched when the download operation commences following a call to the URLLoader.load() method."/>
<page href="flash/net/URLLoader.html#event:progress" title="URLLoader.progress" text="progress Dispatched when data is received as the download operation progresses. Note that with a URLLoader object, it is not possible to access the data until it has been received completely. So, the progress event only serves as a notification of how far the download has progressed. To access the data before it's entirely downloaded, use a URLStream object."/>
<page href="flash/net/URLLoader.html#event:securityError" title="URLLoader.securityError" text="securityError Dispatched if a call to URLLoader.load() attempts to load data from a server outside the security sandbox."/>
<page href="flash/net/Socket.html" title="Socket class" text="Socket The Socket class enables ActionScript code to make socket connections and to read and write raw binary data. It is similar to XMLSocket but does not dictate the format of the received or transmitted data. The Socket class is useful for working with servers that use binary protocols. When you use this class, consider the Flash Player security model: Data loading is not allowed if the calling SWF file is in the local-with-file-system sandbox and the target resource is from a network sandbox. Data loading is also not allowed if the calling SWF file is from a network sandbox and the target resource is local. The calling SWF file and the network resource being accessed must be in exactly the same domain. For example, a SWF file at adobe.com can connect only to a server daemon at adobe.com. Websites can permit cross-domain access to a resource through a cross-domain policy file. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper"/>
<page href="flash/net/Socket.html#Socket()" title="Socket.Socket()" text="Socket Creates a Socket object. If no parameters are specified, an initially disconnected socket is created. If parameters are specified, a connection is attempted to the specified host and port. host port The name of the host to connect to. If this parameter is not specified, an initially disconnected socket is created. The port number to connect to. If this parameter is not specified, an initially disconnected socket is created. This error occurs for the following reasons: Local untrusted SWF files cannot communicate with the Internet. You can work around this problem by reclassifying this SWF file as local-with-networking or trusted. You cannot specify a socket port higher than 65535."/>
<page href="flash/net/Socket.html#close()" title="Socket.close()" text="close Closes the socket. You cannot read or write any data after the close() method has been called. The close event is dispatched only when the server closes the connection; it is not dispatched when you call the close() method. You can reuse the Socket object by calling the connect() method on it again. The socket could not be closed, or the socket was not open."/>
<page href="flash/net/Socket.html#connect()" title="Socket.connect()" text="connect Connects the socket to the specified host and port. If the connection fails immediately, either an event is dispatched or an exception is thrown: an error event is dispatched if a host was specified, and an exception is thrown if no host was specified. Otherwise, the status of the connection is reported by an event. If the socket is already connected, the existing connection is closed first. host port The name of the host to connect to. If no host is specified, the host that is contacted is the host where the calling SWF file resides. If you do not specify a host, use an event listener to determine whether the connection was successful. The port number to connect to. No host was specified and the connection failed."/>
<page href="flash/net/Socket.html#flush()" title="Socket.flush()" text="flush Flushes any accumulated data in the socket's output buffer. Data written by the write methods is not immediately transmitted; it is queued until the flush() method is called. An I/O error occurred on the socket, or the socket is not open."/>
<page href="flash/net/Socket.html#readBoolean()" title="Socket.readBoolean()" text="readBoolean Reads a Boolean value from the socket. After reading a single byte, the method returns true if the byte is nonzero, and false otherwise. There is insufficient data available to read."/>
<page href="flash/net/Socket.html#readByte()" title="Socket.readByte()" text="readByte Reads a signed byte from the socket. There is insufficient data available to read."/>
<page href="flash/net/Socket.html#readBytes()" title="Socket.readBytes()" text="readBytes Reads the number of data bytes specified by the length parameter from the socket. The bytes are read into the specified byte array, starting at the position indicated by offset. bytes offset length The ByteArray object to read data into. The offset at which data reading should begin in the byte array. The number of bytes to read. The default value of 0 causes all available data to be read. There is insufficient data available to read."/>
<page href="flash/net/Socket.html#readDouble()" title="Socket.readDouble()" text="readDouble Reads an IEEE 754 double-precision floating-point number from the socket. There is insufficient data available to read."/>
<page href="flash/net/Socket.html#readFloat()" title="Socket.readFloat()" text="readFloat Reads an IEEE 754 single-precision floating-point number from the socket. There is insufficient data available to read."/>
<page href="flash/net/Socket.html#readInt()" title="Socket.readInt()" text="readInt Reads a signed 32-bit integer from the socket. There is insufficient data available to read."/>
<page href="flash/net/Socket.html#readMultiByte()" title="Socket.readMultiByte()" text="readMultiByte Reads a multibyte string from the byte stream, using the specified character set. length charSet The number of bytes from the byte stream to read. The string denoting the character set to use to interpret the bytes. Possible character set strings include &quot;shift_jis&quot;, &quot;CN-GB&quot;, and &quot;iso-8859-1&quot;. For a complete list, see Supported Character Sets. Note: If the value for the charSet parameter is not recognized by the current system, then Flash Player uses the system's default code page as the character set. For example, a value for the charSet parameter, as in myTest.readMultiByte(22, &quot;iso-8859-01&quot;) that uses 01 instead of 1 might work on your development machine, but not on another machine. On the other machine, Flash Player will use the system's default code page. There is insufficient data available to read."/>
<page href="flash/net/Socket.html#readObject()" title="Socket.readObject()" text="readObject Reads an object from the socket, encoded in AMF serialized format. There is insufficient data available to read."/>
<page href="flash/net/Socket.html#readShort()" title="Socket.readShort()" text="readShort Reads a signed 16-bit integer from the socket. There is insufficient data available to read."/>
<page href="flash/net/Socket.html#readUnsignedByte()" title="Socket.readUnsignedByte()" text="readUnsignedByte Reads an unsigned byte from the socket. There is insufficient data available to read."/>
<page href="flash/net/Socket.html#readUnsignedInt()" title="Socket.readUnsignedInt()" text="readUnsignedInt Reads an unsigned 32-bit integer from the socket. There is insufficient data available to read."/>
<page href="flash/net/Socket.html#readUnsignedShort()" title="Socket.readUnsignedShort()" text="readUnsignedShort Reads an unsigned 16-bit integer from the socket. There is insufficient data available to read."/>
<page href="flash/net/Socket.html#readUTF()" title="Socket.readUTF()" text="readUTF Reads a UTF-8 string from the socket. The string is assumed to be prefixed with an unsigned short integer that indicates the length in bytes. There is insufficient data available to read."/>
<page href="flash/net/Socket.html#readUTFBytes()" title="Socket.readUTFBytes()" text="readUTFBytes Reads the number of UTF-8 data bytes specified by the length parameter from the socket, and returns a string. length The number of bytes to read. There is insufficient data available to read."/>
<page href="flash/net/Socket.html#writeBoolean()" title="Socket.writeBoolean()" text="writeBoolean Writes a Boolean value to the socket. This method writes a single byte, with either a value of 1 (true) or 0 (false). Note: Data written by this method is not immediately transmitted; it is queued until the flush() method is called. value The value to write to the socket: 1 (true) or 0 (false). An I/O error occurred on the socket, or the socket is not open."/>
<page href="flash/net/Socket.html#writeByte()" title="Socket.writeByte()" text="writeByte Writes a byte to the socket. Note: Data written by this method is not immediately transmitted; it is queued until the flush() method is called. value The value to write to the socket. The low 8 bits of the value are used; the high 24 bits are ignored. An I/O error occurred on the socket, or the socket is not open."/>
<page href="flash/net/Socket.html#writeBytes()" title="Socket.writeBytes()" text="writeBytes Writes a sequence of bytes from the specified byte array. The write operation starts at the position specified by offset. If you omit the length parameter the default length of 0 causes the method to write the entire buffer starting at offset. If you also omit the offset parameter, the entire buffer is written. If offset or length is out of range, they are adjusted to match the beginning and end of the bytes array. Note: Data written by this method is not immediately transmitted; it is queued until the flush() method is called. bytes offset length The ByteArray object to write data from. The zero-based offset into the bytes ByteArray object at which data writing should begin. The number of bytes to write. The default value of 0 causes the entire buffer to be written, starting at the value specified by the offset parameter. An I/O error occurred on the socket, or the socket is not open."/>
<page href="flash/net/Socket.html#writeDouble()" title="Socket.writeDouble()" text="writeDouble Writes an IEEE 754 double-precision floating-point number to the socket. Note: Data written by this method is not immediately transmitted; it is queued until the flush() method is called. value The value to write to the socket. An I/O error occurred on the socket, or the socket is not open."/>
<page href="flash/net/Socket.html#writeFloat()" title="Socket.writeFloat()" text="writeFloat Writes an IEEE 754 single-precision floating-point number to the socket. Note: Data written by this method is not immediately transmitted; it is queued until the flush() method is called. value The value to write to the socket. An I/O error occurred on the socket, or the socket is not open."/>
<page href="flash/net/Socket.html#writeInt()" title="Socket.writeInt()" text="writeInt Writes a 32-bit signed integer to the socket. Note: Data written by this method is not immediately transmitted; it is queued until the flush() method is called. value The value to write to the socket. An I/O error occurred on the socket, or the socket is not open."/>
<page href="flash/net/Socket.html#writeMultiByte()" title="Socket.writeMultiByte()" text="writeMultiByte Writes a multibyte string from the byte stream, using the specified character set. Note: Data written by this method is not immediately transmitted; it is queued until the flush() method is called. value charSet The string value to be written. The string denoting the character set to use to interpret the bytes. Possible character set strings include &quot;shift_jis&quot;, &quot;CN-GB&quot;, and &quot;iso-8859-1&quot;. For a complete list, see Supported Character Sets."/>
<page href="flash/net/Socket.html#writeObject()" title="Socket.writeObject()" text="writeObject Write an object to the socket in AMF serialized format. Note: Data written by this method is not immediately transmitted; it is queued until the flush() method is called. object The object to be serialized. An I/O error occurred on the socket, or the socket is not open."/>
<page href="flash/net/Socket.html#writeShort()" title="Socket.writeShort()" text="writeShort Writes a 16-bit integer to the socket. The bytes written are as follows: (v &gt;&gt; 8) &amp; 0xff v &amp; 0xff The low 16 bits of the parameter are used; the high 16 bits are ignored. Note: Data written by this method is not immediately transmitted; it is queued until the flush() method is called. value The value to write to the socket. An I/O error occurred on the socket, or the socket is not open."/>
<page href="flash/net/Socket.html#writeUnsignedInt()" title="Socket.writeUnsignedInt()" text="writeUnsignedInt Writes a 32-bit unsigned integer to the socket. Note: Data written by this method is not immediately transmitted; it is queued until the flush() method is called. value The value to write to the socket. An I/O error occurred on the socket, or the socket is not open."/>
<page href="flash/net/Socket.html#writeUTF()" title="Socket.writeUTF()" text="writeUTF Writes the following data to the socket: a 16-bit unsigned integer, which indicates the length of the specified UTF-8 string in bytes, followed by the string itself. Before writing the string, the method calculates the number of bytes needed to represent all characters of the string. Note: Data written by this method is not immediately transmitted; it is queued until the flush() method is called. value The string to write to the socket. The length is larger than 65535."/>
<page href="flash/net/Socket.html#writeUTFBytes()" title="Socket.writeUTFBytes()" text="writeUTFBytes Writes a UTF-8 string to the socket. Note: Data written by this method is not immediately transmitted; it is queued until the flush() method is called. value The string to write to the socket. An I/O error occurred on the socket, or the socket is not open."/>
<page href="flash/net/Socket.html#bytesAvailable" title="Socket.bytesAvailable" text="bytesAvailable The number of bytes of data available for reading in the input buffer. Your code must access bytesAvailable to ensure that sufficient data is available before trying to read it with one of the read methods."/>
<page href="flash/net/Socket.html#connected" title="Socket.connected" text="connected Indicates whether this Socket object is currently connected. A call to this property returns a value of true if the socket is currently connected, or false otherwise."/>
<page href="flash/net/Socket.html#endian" title="Socket.endian" text="endian Indicates the byte order for the data; possible values are constants from the flash.utils.Endian class, Endian.BIG_ENDIAN or Endian.LITTLE_ENDIAN."/>
<page href="flash/net/Socket.html#objectEncoding" title="Socket.objectEncoding" text="objectEncoding Controls the version of AMF used when writing or reading an object."/>
<page href="flash/net/Socket.html#event:close" title="Socket.close" text="close Dispatched when the server closes the socket connection. The close event is dispatched only when the server closes the connection; it is not dispatched when you call the Socket.close() method."/>
<page href="flash/net/Socket.html#event:connect" title="Socket.connect" text="connect Dispatched when a network connection has been established."/>
<page href="flash/net/Socket.html#event:ioError" title="Socket.ioError" text="ioError Dispatched when an input/output error occurs that causes a send or load operation to fail."/>
<page href="flash/net/Socket.html#event:securityError" title="Socket.securityError" text="securityError Dispatched if a call to Socket.connect() attempts to connect either to a server outside the caller's security sandbox or to a port lower than 1024."/>
<page href="flash/net/Socket.html#event:socketData" title="Socket.socketData" text="socketData Dispatched when a socket has received data. Events of type socketData do not use the ProgressEvent.bytesTotal property."/>
<page href="flash/geom/ColorTransform.html" title="ColorTransform class" text="ColorTransform The ColorTransform class lets you adjust the color values in a display object. The color adjustment or color transformation can be applied to all four channels: red, green, blue, and alpha transparency. When a ColorTransform object is applied to a display object, a new value for each color channel is calculated like this: New red value = (old red value * redMultiplier) + redOffset New green value = (old green value * greenMultiplier) + greenOffset New blue value = (old blue value * blueMultiplier) + blueOffset New alpha value = (old alpha value * alphaMultiplier) + alphaOffset If any of the color channel values is greater than 255 after the calculation, it is set to 255. If it is less than 0, it is set to 0. You can use ColorTransform objects in the following ways: In the colorTransform parameter of the colorTransform() method of the BitmapData class As the colorTransform property of a Transform object (which can be used as the transform property of a display object) You must use the new ColorTransform() constructor to create a ColorTransform object before you can call the methods of the ColorTransform object. Color transformations do not apply to the background color of a movie clip (such as a loaded SWF object). They apply only to graphics and symbols that are attached to the movie clip."/>
<page href="flash/geom/ColorTransform.html#ColorTransform()" title="ColorTransform.ColorTransform()" text="ColorTransform Creates a ColorTransform object for a display object with the specified color channel values and alpha values. redMultiplier greenMultiplier blueMultiplier alphaMultiplier redOffset greenOffset blueOffset alphaOffset The value for the red multiplier, in the range from 0 to 1. The value for the green multiplier, in the range from 0 to 1. The value for the blue multiplier, in the range from 0 to 1. The value for the alpha transparency multiplier, in the range from 0 to 1. The offset value for the red color channel, in the range from -255 to 255. The offset value for the green color channel, in the range from -255 to 255. The offset for the blue color channel value, in the range from -255 to 255. The offset for alpha transparency channel value, in the range from -255 to 255."/>
<page href="flash/geom/ColorTransform.html#concat()" title="ColorTransform.concat()" text="concat Concatenates the ColorTranform object specified by the second parameter with the current ColorTransform object and sets the current object as the result, which is an additive combination of the two color transformations. When you apply the concatenated ColorTransform object, the effect is the same as applying the second color transformation after the original color transformation. second The ColorTransform object to be combined with the current ColorTransform object."/>
<page href="flash/geom/ColorTransform.html#toString()" title="ColorTransform.toString()" text="toString Formats and returns a string that describes all of the properties of the ColorTransform object."/>
<page href="flash/geom/ColorTransform.html#alphaMultiplier" title="ColorTransform.alphaMultiplier" text="alphaMultiplier A decimal value that is multiplied with the alpha transparency channel value. If you set the alpha transparency value of a display object directly by using the alpha property of the DisplayObject instance, it affects the value of the alphaMultiplier property of that display object's transform.colorTransform property."/>
<page href="flash/geom/ColorTransform.html#alphaOffset" title="ColorTransform.alphaOffset" text="alphaOffset A number from -255 to 255 that is added to the alpha transparency channel value after it has been multiplied by the alphaMultiplier value."/>
<page href="flash/geom/ColorTransform.html#blueMultiplier" title="ColorTransform.blueMultiplier" text="blueMultiplier A decimal value that is multiplied with the blue channel value."/>
<page href="flash/geom/ColorTransform.html#blueOffset" title="ColorTransform.blueOffset" text="blueOffset A number from -255 to 255 that is added to the blue channel value after it has been multiplied by the blueMultiplier value."/>
<page href="flash/geom/ColorTransform.html#color" title="ColorTransform.color" text="color The RGB color value for a ColorTransform object. When you set this property, it changes the three color offset values (redOffset, greenOffset, and blueOffset) accordingly, and it sets the three color multiplier values (redMultiplier, greenMultiplier, and blueMultiplier) to 0. The alpha transparency multiplier and offset values do not change. When you pass a value for this property, use the format 0xRRGGBB. 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."/>
<page href="flash/geom/ColorTransform.html#greenMultiplier" title="ColorTransform.greenMultiplier" text="greenMultiplier A decimal value that is multiplied with the green channel value."/>
<page href="flash/geom/ColorTransform.html#greenOffset" title="ColorTransform.greenOffset" text="greenOffset A number from -255 to 255 that is added to the green channel value after it has been multiplied by the greenMultiplier value."/>
<page href="flash/geom/ColorTransform.html#redMultiplier" title="ColorTransform.redMultiplier" text="redMultiplier A decimal value that is multiplied with the red channel value."/>
<page href="flash/geom/ColorTransform.html#redOffset" title="ColorTransform.redOffset" text="redOffset A number from -255 to 255 that is added to the red channel value after it has been multiplied by the redMultiplier value."/>
<page href="flash/geom/Matrix.html" title="Matrix class" text="Matrix The Matrix class represents a transformation matrix that determines how to map points from one coordinate space to another. You can perform various graphical transformations on a display object by setting the properties of a Matrix object, applying that Matrix object to the matrix property of a Transform object, and then applying that Transform object as the transform property of the display object. These transformation functions include translation (x and y repositioning), rotation, scaling, and skewing. Together these types of transformations are known as affine transformations. Affine transformations preserve the straightness of lines while transforming, so that parallel lines stay parallel. To apply a transformation matrix to a display object, you create a Transform object, set its matrix property to the transformation matrix, and then set the transform property of the display object to the Transform object. Matrix objects are also used as parameters of some methods, such as the following: The draw() method of a BitmapData object The beginBitmapFill() method, beginGradientFill() method, or lineGradientStyle() method of a Graphics object A transformation matrix object is a 3 x 3 matrix with the following contents: In traditional transformation matrixes, the u, v, and w properties provide extra capabilities. The Matrix class can only operate in two-dimensional space, so it always assumes that the property values u and v are 0.0, and that the property value w is 1.0. The effective values of the matrix are as follows: You can get and set the values of all six of the other properties in a Matrix object: a, b, c, d, tx, and ty. The Matrix class supports the four major types of transformations: translation, scaling, rotation, and skewing. You can set three of these transformations by using specialized methods, as described in the following table: Transformation Method Matrix values Display result Description Translation (displacement) translate(tx, ty) Moves the image tx pixels to the right and ty pixels down. Scaling scale(sx, sy) Resizes the image, multiplying the location of each pixel by sx on the x axis and sy on the y axis. Rotation rotate(q) Rotates the image by an angle q, which is measured in radians. Skewing or shearing None; must set the properties b and c Progressively slides the image in a direction parallel to the x or y axis. The b property of the Matrix object represents the tangent of the skew angle along the y axis; the c property of the Matrix object represents the tangent of the skew angle along the x axis. Each transformation function alters the current matrix properties so that you can effectively combine multiple transformations. To do this, you call more than one transformation function before applying the matrix to its display object target (by using the transform property of that display object). Use the new Matrix() constructor to create a Matrix object before you can call the methods of the Matrix object."/>
<page href="flash/geom/Matrix.html#Matrix()" title="Matrix.Matrix()" text="Matrix Creates a new Matrix object with the specified parameters. In matrix notation, the properties are organized like this: If you do not provide any parameters to the new Matrix() constructor, it creates an identity matrix with the following values: a = 1 b = 0 c = 0 d = 1 tx = 0 ty = 0 In matrix notation, the identity matrix looks like this: a b c d tx ty The value in the first row and first column of the new Matrix object. The value in the first row and second column of the new Matrix object. The value in the second row and first column of the new Matrix object. The value in the second row and second column of the new Matrix object. The value in the first row and third column of the new Matrix object. The value in the second row and third column of the new Matrix object. The following example creates matrix_1 by sending no parameters to the Matrix() constructor and matrix_2 by sending parameters to it. Notice that matrix_1, which was created with no parameters, results in an identity matrix with the values a=1, b=0, c=0, d=1, tx=0, ty=0. import flash.geom.Matrix; var matrix_1:Matrix = new Matrix(); trace(matrix_1); // (a=1, b=0, c=0, d=1, tx=0, ty=0) var matrix_2:Matrix = new Matrix(1, 2, 3, 4, 5, 6); trace(matrix_2); // (a=1, b=2, c=3, d=4, tx=5, ty=6)"/>
<page href="flash/geom/Matrix.html#clone()" title="Matrix.clone()" text="clone Returns a new Matrix object that is a clone of this matrix, with an exact copy of the contained object."/>
<page href="flash/geom/Matrix.html#concat()" title="Matrix.concat()" text="concat Concatenates a matrix with the current matrix, effectively combining the geometric effects of the two. In mathematical terms, concatenating two matrixes is the same as combining them using matrix multiplication. For example, if matrix m1 scales an object by a factor of four, and matrix m2 rotates an object by 1.5707963267949 radians (Math.PI/2), then m1.concat(m2) transforms m1 into a matrix that scales an object by a factor of four and rotates the object by Math.PI/2 radians. This method replaces the source matrix with the concatenated matrix. If you want to concatenate two matrixes without altering either of the two source matrixes, first copy the source matrix by using the clone() method, as shown in the Class Examples section. m The matrix to be concatenated to the source matrix."/>
<page href="flash/geom/Matrix.html#createBox()" title="Matrix.createBox()" text="createBox Includes parameters for scaling, rotation, and translation. When applied to a matrix it sets the matrix's values based on those parameters. Using the createBox() method lets you obtain the same matrix as you would if you applied the identity(), rotate(), scale(), and translate() methods in succession. For example, mat1.createBox(2,2,Math.PI/4, 100, 100) has the same effect as the following: import flash.geom.Matrix; var mat1:Matrix = new Matrix(); mat1.identity(); mat1.rotate(Math.PI/4); mat1.scale(2,2); mat1.translate(10,20); scaleX scaleY rotation tx ty The factor by which to scale horizontally. The factor by which scale vertically. The amount to rotate, in radians. The number of pixels to translate (move) to the right along the x axis. The number of pixels to translate (move) down along the y axis. The following example sets the x scale, y scale, rotation, x location, and y location of myMatrix by calling its createBox() method. package { import flash.display.Shape; import flash.display.Sprite; import flash.geom.Matrix; import flash.geom.Transform; public class Matrix_createBox extends Sprite { public function Matrix_createBox() { var myMatrix:Matrix = new Matrix(); trace(myMatrix.toString()); // (a=1, b=0, c=0, d=1, tx=0, ty=0) myMatrix.createBox(1, 2, Math.PI/4, 50, 100); trace(myMatrix.toString()); // (a=0.7071067811865476, b=1.414213562373095, c=-0.7071067811865475, // d=1.4142135623730951, tx=100, ty=200) var rectangleShape:Shape = createRectangle(20, 80, 0xFF0000); addChild(rectangleShape); var rectangleTrans:Transform = new Transform(rectangleShape); rectangleTrans.matrix = myMatrix; } public function createRectangle(w:Number, h:Number, color:Number):Shape { var rect:Shape = new Shape(); rect.graphics.beginFill(color); rect.graphics.drawRect(0, 0, w, h); addChild(rect); return rect; } } }"/>
<page href="flash/geom/Matrix.html#createGradientBox()" title="Matrix.createGradientBox()" text="createGradientBox Creates the specific style of matrix expected by the beginGradientFill() and lineGradientStyle() methods of the Graphics class. Width and height are scaled to a scaleX/scaleY pair and the tx/ty values are offset by half the width and height. For example, consider a gradient with the following characteristics: GradientType.LINEAR Two colors, green and blue, with the ratios array set to [0, 255] SpreadMethod.PAD InterpolationMethod.LINEAR_RGB The following illustrations show gradients in which the matrix was defined using the createGradientBox() method with different parameter settings: createGradientBox() settings Resulting gradient width = 25; height = 25; rotation = 0; tx = 0; ty = 0; width = 25; height = 25; rotation = 0; tx = 25; ty = 0; width = 50; height = 50; rotation = 0; tx = 0; ty = 0; width = 50; height = 50; rotation = Math.PI / 4; // 45° tx = 0; ty = 0; width height rotation tx ty The width of the gradient box. The height of the gradient box. The amount to rotate, in radians. The distance, in pixels, to translate to the right along the x axis. This value is offset by half of the width parameter. The distance, in pixels, to translate down along the y axis. This value is offset by half of the height parameter. The following example sets the x scale, y scale, rotation, x location, and y location of myMatrix by calling its createBox() method. package { import flash.display.GradientType; import flash.display.Sprite; import flash.geom.Matrix; public class Matrix_createGradientBox extends Sprite { public function Matrix_createGradientBox() { var myMatrix:Matrix = new Matrix(); trace(myMatrix.toString()); // (a=1, b=0, c=0, d=1, tx=0, ty=0) myMatrix.createGradientBox(200, 200, 0, 50, 50); trace(myMatrix.toString()); // (a=0.1220703125, b=0, c=0, d=0.1220703125, tx=150, ty=150) var colors:Array = [0xFF0000, 0x0000FF]; var alphas:Array = [100, 100]; var ratios:Array = [0, 0xFF]; this.graphics.beginGradientFill(GradientType.LINEAR, colors, alphas, ratios, myMatrix); this.graphics.drawRect(0, 0, 300, 200); } } }"/>
<page href="flash/geom/Matrix.html#deltaTransformPoint()" title="Matrix.deltaTransformPoint()" text="deltaTransformPoint Given a point in the pretransform coordinate space, returns the coordinates of that point after the transformation occurs. Unlike the standard transformation applied using the transformPoint() method, the deltaTransformPoint() method's transformation does not consider the translation parameters tx and ty. point The point for which you want to get the result of the matrix transformation."/>
<page href="flash/geom/Matrix.html#identity()" title="Matrix.identity()" text="identity Sets each matrix property to a value that causes a null transformation. An object transformed by applying an identity matrix will be identical to the original. After calling the identity() method, the resulting matrix has the following properties: a=1, b=0, c=0, d=1, tx=0, ty=0. In matrix notation, the identity matrix looks like this:"/>
<page href="flash/geom/Matrix.html#invert()" title="Matrix.invert()" text="invert Performs the opposite transformation of the original matrix. You can apply an inverted matrix to an object to undo the transformation performed when applying the original matrix. The following example creates a halfScaleMatrix by calling the invert() method of doubleScaleMatrix. It then demonstrates that the two are Matrix inverses of one another -- matrices that undo any transformations performed by the other -- by creating originalAndInverseMatrix which is equal to noScaleMatrix. package { import flash.display.Shape; import flash.display.Sprite; import flash.geom.Matrix; import flash.geom.Transform; public class Matrix_invert extends Sprite { public function Matrix_invert() { var rect0:Shape = createRectangle(20, 80, 0xFF0000); var rect1:Shape = createRectangle(20, 80, 0x00FF00); var rect2:Shape = createRectangle(20, 80, 0x0000FF); var rect3:Shape = createRectangle(20, 80, 0x000000); var trans0:Transform = new Transform(rect0); var trans1:Transform = new Transform(rect1); var trans2:Transform = new Transform(rect2); var trans3:Transform = new Transform(rect3); var doubleScaleMatrix:Matrix = new Matrix(2, 0, 0, 2, 0, 0); trans0.matrix = doubleScaleMatrix; trace(doubleScaleMatrix.toString()); // (a=2, b=0, c=0, d=2, tx=0, ty=0) var noScaleMatrix:Matrix = new Matrix(1, 0, 0, 1, 0, 0); trans1.matrix = noScaleMatrix; rect1.x = 50; trace(noScaleMatrix.toString()); // (a=1, b=0, c=0, d=1, tx=0, ty=0) var halfScaleMatrix:Matrix = doubleScaleMatrix.clone(); halfScaleMatrix.invert(); trans2.matrix = halfScaleMatrix; rect2.x = 100; trace(halfScaleMatrix.toString()); // (a=0.5, b=0, c=0, d=0.5, tx=0, ty=0) var originalAndInverseMatrix:Matrix = doubleScaleMatrix.clone(); originalAndInverseMatrix.concat(halfScaleMatrix); trans3.matrix = originalAndInverseMatrix; rect3.x = 150; trace(originalAndInverseMatrix.toString()); // (a=1, b=0, c=0, d=1, tx=0, ty=0) } public function createRectangle(w:Number, h:Number, color:Number):Shape { var rect:Shape = new Shape(); rect.graphics.beginFill(color); rect.graphics.drawRect(0, 0, w, h); addChild(rect); return rect; } } }"/>
<page href="flash/geom/Matrix.html#rotate()" title="Matrix.rotate()" text="rotate Applies a rotation transformation to the Matrix object. The rotate() method alters the a, b, c, and d properties of the Matrix object. In matrix notation, this is the same as concatenating the current matrix with the following: angle The rotation angle in radians."/>
<page href="flash/geom/Matrix.html#scale()" title="Matrix.scale()" text="scale Applies a scaling transformation to the matrix. The x axis is multiplied by sx, and the y axis it is multiplied by sy. The scale() method alters the a and d properties of the Matrix object. In matrix notation, this is the same as concatenating the current matrix with the following matrix: sx sy A multiplier used to scale the object along the x axis. A multiplier used to scale the object along the y axis."/>
<page href="flash/geom/Matrix.html#toString()" title="Matrix.toString()" text="toString Returns a text value listing the properties of the Matrix object."/>
<page href="flash/geom/Matrix.html#transformPoint()" title="Matrix.transformPoint()" text="transformPoint Returns the result of applying the geometric transformation represented by the Matrix object to the specified point. point The point for which you want to get the result of the Matrix transformation."/>
<page href="flash/geom/Matrix.html#translate()" title="Matrix.translate()" text="translate Translates the matrix along the x and y axes, as specified by the dx and dy parameters. dx dy The amount of movement along the x axis to the right, in pixels. The amount of movement down along the y axis, in pixels."/>
<page href="flash/geom/Matrix.html#a" title="Matrix.a" text="a The value in the first row and first column of the Matrix object, which affects the positioning of pixels along the x axis when scaling or rotating an image. The following example creates the Matrix object myMatrix and sets its a value. import flash.geom.Matrix; var myMatrix:Matrix = new Matrix(); trace(myMatrix.a); // 1 myMatrix.a = 2; trace(myMatrix.a); // 2"/>
<page href="flash/geom/Matrix.html#b" title="Matrix.b" text="b The value in the first row and second column of the Matrix object, which affects the positioning of pixels along the y axis when rotating or skewing an image. The following example creates the Matrix object myMatrix and sets its b value. import flash.geom.Matrix; var myMatrix:Matrix = new Matrix(); trace(myMatrix.b); // 0 var degrees:Number = 30; var radians:Number = (degrees/180) ~~ Math.PI; myMatrix.b = Math.tan(radians); trace(myMatrix.b); // 0.5773502691896257"/>
<page href="flash/geom/Matrix.html#c" title="Matrix.c" text="c The value in the second row and first column of the Matrix object, which affects the positioning of pixels along the x axis when rotating or skewing an image. The following example creates the Matrix object myMatrix and sets its c value. import flash.geom.Matrix; var myMatrix:Matrix = new Matrix(); trace(myMatrix.c); // 0 var degrees:Number = 30; var radians:Number = (degrees/180) ~~ Math.PI; myMatrix.c = Math.tan(radians); trace(myMatrix.c); // 0.5773502691896257"/>
<page href="flash/geom/Matrix.html#d" title="Matrix.d" text="d The value in the second row and second column of the Matrix object, which affects the positioning of pixels along the y axis when scaling or rotating an image. The following example creates the Matrix object myMatrix and sets its d value. import flash.geom.Matrix; var myMatrix:Matrix = new Matrix(); trace(myMatrix.d); // 1 myMatrix.d = 2; trace(myMatrix.d); // 2"/>
<page href="flash/geom/Matrix.html#tx" title="Matrix.tx" text="tx The distance by which to translate each point along the x axis. This represents the value in the first row and third column of the Matrix object. The following example creates the Matrix object myMatrix and sets its tx value. import flash.geom.Matrix; var myMatrix:Matrix = new Matrix(); trace(myMatrix.tx); // 0 myMatrix.tx = 50; // 50 trace(myMatrix.tx);"/>
<page href="flash/geom/Matrix.html#ty" title="Matrix.ty" text="ty The distance by which to translate each point along the y axis. This represents the value in the second row and third column of the Matrix object. The following example creates the Matrix object myMatrix and sets its ty value. import flash.geom.Matrix; var myMatrix:Matrix = new Matrix(); trace(myMatrix.ty); // 0 myMatrix.ty = 50; trace(myMatrix.ty); // 50"/>
<page href="flash/geom/Point.html" title="Point class" text="Point The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis. The following code creates a point at (0,0): var myPoint:Point = new Point(); Methods and properties of the following classes use Point objects: BitmapData DisplayObject DisplayObjectContainer DisplacementMapFilter Matrix Rectangle You can use the new Point() constructor to create a Point object."/>
<page href="flash/geom/Point.html#Point()" title="Point.Point()" text="Point Creates a new point. If you pass no parameters to this method, a point is created at (0,0). x y The horizontal coordinate. The vertical coordinate."/>
<page href="flash/geom/Point.html#add()" title="Point.add()" text="add Adds the coordinates of another point to the coordinates of this point to create a new point. v The point to be added."/>
<page href="flash/geom/Point.html#clone()" title="Point.clone()" text="clone Creates a copy of this Point object."/>
<page href="flash/geom/Point.html#distance()" title="Point.distance()" text="distance Returns the distance between pt1 and pt2. pt1 pt2 The first point. The second point."/>
<page href="flash/geom/Point.html#equals()" title="Point.equals()" text="equals Determines whether two points are equal. Two points are equal if they have the same x and y values. toCompare The point to be compared."/>
<page href="flash/geom/Point.html#interpolate()" title="Point.interpolate()" text="interpolate Determines a point between two specified points. The parameter f determines where the new interpolated point is located relative to the two end points specified by parameters pt1 and pt2. The closer the value of the parameter f is to 1.0, the closer the interpolated point is to the first point (parameter pt1). The closer the value of the parameter f is to 0, the closer the interpolated point is to the second point (parameter pt2). pt1 pt2 f The first point. The second point. The level of interpolation between the two points. Indicates where the new point will be, along the line between pt1 and pt2. If f=1, pt1 is returned; if f=0, pt2 is returned."/>
<page href="flash/geom/Point.html#normalize()" title="Point.normalize()" text="normalize Scales the line segment between (0,0) and the current point to a set length. thickness The scaling value. For example, if the current point is (0,5), and you normalize it to 1, the point returned is at (0,1)."/>
<page href="flash/geom/Point.html#offset()" title="Point.offset()" text="offset Offsets the Point object by the specified amount. The value of dx is added to the original value of x to create the new x value. The value of dy is added to the original value of y to create the new y value. dx dy The amount by which to offset the horizontal coordinate, x. The amount by which to offset the vertical coordinate, y."/>
<page href="flash/geom/Point.html#polar()" title="Point.polar()" text="polar Converts a pair of polar coordinates to a Cartesian point coordinate. len angle The length coordinate of the polar pair. The angle, in radians, of the polar pair."/>
<page href="flash/geom/Point.html#subtract()" title="Point.subtract()" text="subtract Subtracts the coordinates of another point from the coordinates of this point to create a new point. v The point to be subtracted."/>
<page href="flash/geom/Point.html#toString()" title="Point.toString()" text="toString Returns a string that contains the values of the x and y coordinates. The string has the form &quot;(x=x, y=y)&quot;, so calling the toString() method for a point at 23,17 would return &quot;(x=23, y=17)&quot;."/>
<page href="flash/geom/Point.html#length" title="Point.length" text="length The length of the line segment from (0,0) to this point."/>
<page href="flash/geom/Point.html#x" title="Point.x" text="x The horizontal coordinate of the point. The default value is 0."/>
<page href="flash/geom/Point.html#y" title="Point.y" text="y The vertical coordinate of the point. The default value is 0."/>
<page href="flash/geom/Rectangle.html" title="Rectangle class" text="Rectangle A Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height. The x, y, width, and height properties of the Rectangle class are independent of each other; changing the value of one property has no effect on the others. However, the right and bottom properties are integrally related to those four properties. For example, if you change the value of the right property, the value of the width property changes; if you change the bottom property, the value of the height property changes. The following methods and properties use Rectangle objects: The applyFilter(), colorTransform(), copyChannel(), copyPixels(), draw(), fillRect(), generateFilterRect(), getColorBoundsRect(), getPixels(), merge(), paletteMap(), pixelDisolve(), setPixels(), and threshold() methods, and the rect property of the BitmapData class The getBounds() and getRect() methods, and the scrollRect and scale9Grid properties of the DisplayObject class The getCharBoundaries() method of the TextField class The pixelBounds property of the Transform class The bounds parameter for the startDrag() method of the Sprite class The printArea parameter of the addPage() method of the PrintJob class You can use the new Rectangle() constructor to create a Rectangle object. Note: The Rectangle class does not define a rectangular Shape display object. To draw a rectangular Shape object onscreen, use the drawRect() method of the Graphics class."/>
<page href="flash/geom/Rectangle.html#Rectangle()" title="Rectangle.Rectangle()" text="Rectangle Creates a new Rectangle object with the top-left corner specified by the x and y parameters and with the specified width and height parameters. If you call this function without parameters, a rectangle with x, y, width, and height properties set to 0 is created. x y width height The x coordinate of the top-left corner of the rectangle. The y coordinate of the top-left corner of the rectangle. The width of the rectangle, in pixels. The height of the rectangle, in pixels."/>
<page href="flash/geom/Rectangle.html#clone()" title="Rectangle.clone()" text="clone Returns a new Rectangle object with the same values for the x, y, width, and height properties as the original Rectangle object."/>
<page href="flash/geom/Rectangle.html#contains()" title="Rectangle.contains()" text="contains Determines whether the specified point is contained within the rectangular region defined by this Rectangle object. x y The x coordinate (horizontal position) of the point. The y coordinate (vertical position) of the point."/>
<page href="flash/geom/Rectangle.html#containsPoint()" title="Rectangle.containsPoint()" text="containsPoint Determines whether the specified point is contained within the rectangular region defined by this Rectangle object. This method is similar to the Rectangle.contains() method, except that it takes a Point object as a parameter. point The point, as represented by its x and y coordinates."/>
<page href="flash/geom/Rectangle.html#containsRect()" title="Rectangle.containsRect()" text="containsRect Determines whether the Rectangle object specified by the rect parameter is contained within this Rectangle object. A Rectangle object is said to contain another if the second Rectangle object falls entirely within the boundaries of the first. rect The Rectangle object being checked."/>
<page href="flash/geom/Rectangle.html#equals()" title="Rectangle.equals()" text="equals Determines whether the object specified in the toCompare parameter is equal to this Rectangle object. This method compares the x, y, width, and height properties of an object against the same properties of this Rectangle object. toCompare The rectangle to compare to this Rectangle object."/>
<page href="flash/geom/Rectangle.html#inflate()" title="Rectangle.inflate()" text="inflate Increases the size of the Rectangle object by the specified amounts, in pixels. The center point of the Rectangle object stays the same, and its size increases to the left and right by the dx value, and to the top and the bottom by the dy value. dx dy The value to be added to the left and the right of the Rectangle object. The following equation is used to calculate the new width and position of the rectangle: x -= dx; width += 2 ~~ dx; The value to be added to the top and the bottom of the Rectangle. The following equation is used to calculate the new height and position of the rectangle: y -= dy; height += 2 ~~ dy;"/>
<page href="flash/geom/Rectangle.html#inflatePoint()" title="Rectangle.inflatePoint()" text="inflatePoint Increases the size of the Rectangle object. This method is similar to the Rectangle.inflate() method except it takes a Point object as a parameter. The following two code examples give the same result: rect1=new flash.geom.Rectangle(0,0,2,5); rect1.inflate(2,2) rect1=new flash.geom.Rectangle(0,0,2,5); pt1=new flash.geom.Point(2,2); rect1.inflatePoint(pt1) point The x property of this Point object is used to increase the horizontal dimension of the Rectangle object. The y property is used to increase the vertical dimension of the Rectangle object."/>
<page href="flash/geom/Rectangle.html#intersection()" title="Rectangle.intersection()" text="intersection If the Rectangle object specified in the toIntersect parameter intersects with this Rectangle object, returns the area of intersection as a Rectangle object. If the rectangles do not intersect, this method returns an empty Rectangle object with its properties set to 0. toIntersect The Rectangle object to compare against to see if it intersects with this Rectangle object."/>
<page href="flash/geom/Rectangle.html#intersects()" title="Rectangle.intersects()" text="intersects Determines whether the object specified in the toIntersect parameter intersects with this Rectangle object. This method checks the x, y, width, and height properties of the specified Rectangle object to see if it intersects with this Rectangle object. toIntersect The Rectangle object to compare against this Rectangle object."/>
<page href="flash/geom/Rectangle.html#isEmpty()" title="Rectangle.isEmpty()" text="isEmpty Determines whether or not this Rectangle object is empty."/>
<page href="flash/geom/Rectangle.html#offset()" title="Rectangle.offset()" text="offset Adjusts the location of the Rectangle object, as determined by its top-left corner, by the specified amounts. dx dy Moves the x value of the Rectangle object by this amount. Moves the y value of the Rectangle object by this amount."/>
<page href="flash/geom/Rectangle.html#offsetPoint()" title="Rectangle.offsetPoint()" text="offsetPoint Adjusts the location of the Rectangle object using a Point object as a parameter. This method is similar to the Rectangle.offset() method, except that it takes a Point object as a parameter. point A Point object to use to offset this Rectangle object."/>
<page href="flash/geom/Rectangle.html#setEmpty()" title="Rectangle.setEmpty()" text="setEmpty Sets all of the Rectangle object's properties to 0. A Rectangle object is empty if its width or height is less than or equal to 0. This method sets the values of the x, y, width, and height properties to 0."/>
<page href="flash/geom/Rectangle.html#toString()" title="Rectangle.toString()" text="toString Builds and returns a string that lists the horizontal and vertical positions and the width and height of the Rectangle object."/>
<page href="flash/geom/Rectangle.html#union()" title="Rectangle.union()" text="union Adds two rectangles together to create a new Rectangle object, by filling in the horizontal and vertical space between the two rectangles. toUnion A Rectangle object to add to this Rectangle object."/>
<page href="flash/geom/Rectangle.html#bottom" title="Rectangle.bottom" text="bottom The sum of the y and height properties."/>
<page href="flash/geom/Rectangle.html#bottomRight" title="Rectangle.bottomRight" text="bottomRight The location of the Rectangle object's bottom-right corner, determined by the values of the right and bottom properties."/>
<page href="flash/geom/Rectangle.html#height" title="Rectangle.height" text="height The height of the rectangle, in pixels. Changing the height value of a Rectangle object has no effect on the x, y, and width properties."/>
<page href="flash/geom/Rectangle.html#left" title="Rectangle.left" text="left The x coordinate of the top-left corner of the rectangle. Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property. The value of the left property is equal to the value of the x property."/>
<page href="flash/geom/Rectangle.html#right" title="Rectangle.right" text="right The sum of the x and width properties."/>
<page href="flash/geom/Rectangle.html#size" title="Rectangle.size" text="size The size of the Rectangle object, expressed as a Point object with the values of the width and height properties."/>
<page href="flash/geom/Rectangle.html#top" title="Rectangle.top" text="top The y coordinate of the top-left corner of the rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties. However it does affect the height property, whereas changing the y value does not affect the height property. The value of the top property is equal to the value of the y property."/>
<page href="flash/geom/Rectangle.html#topLeft" title="Rectangle.topLeft" text="topLeft The location of the Rectangle object's top-left corner, determined by the x and y coordinates of the point."/>
<page href="flash/geom/Rectangle.html#width" title="Rectangle.width" text="width The width of the rectangle, in pixels. Changing the width value of a Rectangle object has no effect on the x, y, and height properties."/>
<page href="flash/geom/Rectangle.html#x" title="Rectangle.x" text="x The x coordinate of the top-left corner of the rectangle. Changing the value of the x property of a Rectangle object has no effect on the y, width, and height properties. The value of the x property is equal to the value of the left property."/>
<page href="flash/geom/Rectangle.html#y" title="Rectangle.y" text="y The y coordinate of the top-left corner of the rectangle. Changing the value of the y property of a Rectangle object has no effect on the x, width, and height properties. The value of the y property is equal to the value of the top property."/>
<page href="flash/geom/Transform.html" title="Transform class" text="Transform The Transform class collects data about color transformations and coordinate transformations that are applied to a display object. Apply transformations by creating a new Matrix and/or a new ColorTransform and setting the appropriate properties of the transform property of a display object."/>
<page href="flash/geom/Transform.html#colorTransform" title="Transform.colorTransform" text="colorTransform A ColorTransform object containing values that universally adjust the colors in the display object. The colorTransform is null when being set"/>
<page href="flash/geom/Transform.html#concatenatedColorTransform" title="Transform.concatenatedColorTransform" text="concatenatedColorTransform A ColorTransform object representing the combined color transformations applied to the display object and all of its parent objects, back to the root level. If different color transformations have been applied at different levels, all of those transformations are concatenated into one ColorTransform object for this property."/>
<page href="flash/geom/Transform.html#concatenatedMatrix" title="Transform.concatenatedMatrix" text="concatenatedMatrix A Matrix object representing the combined transformation matrixes of the display object and all of its parent objects, back to the root level. If different transformation matrixes have been applied at different levels, all of those matrixes are concatenated into one matrix for this property."/>
<page href="flash/geom/Transform.html#matrix" title="Transform.matrix" text="matrix A Matrix object containing values that affect the scaling, rotation, and translation of the display object. The matrix is null when being set"/>
<page href="flash/geom/Transform.html#pixelBounds" title="Transform.pixelBounds" text="pixelBounds A Rectangle object that defines the bounding rectangle of the display object on the Stage."/>
<page href="RegExp.html" title="RegExp class" text="RegExp The RegExp class lets you work with regular expressions, which are patterns that you can use to perform searches in strings and to replace text in strings. You can create a new RegExp object by using the new RegExp() constructor or by assigning a RegExp literal to a variable: var pattern1:RegExp = new RegExp(&quot;test-\\d&quot;, &quot;i&quot;); var pattern2:RegExp = /test-\d/i; For more information, see &quot;Using Regular Expressions&quot; in Programming ActionScript 3.0."/>
<page href="RegExp.html#RegExp()" title="RegExp.RegExp()" text="RegExp Lets you construct a regular expression from two strings. One string defines the pattern of the regular expression, and the other defines the flags used in the regular expression. re flags The pattern of the regular expression (also known as the constructor string). This is the main part of the regular expression (the part that goes within the &quot;/&quot; characters). Notes: Do not include the starting and trailing &quot;/&quot; characters; use these only when defining a regular expression literal without using the constructor. For example, the following two regular expressions are equivalent: var re1:RegExp = new RegExp(&quot;bob&quot;, &quot;i&quot;); var re2:RegExp = /bob/i; In a regular expression that is defined with the RegExp() constructor method, to use a metasequence that begins with the backslash (\) character, such as \d (which matches any digit), type the backslash character twice. For example, the following two regular expressions are equivalent: var re1:RegExp = new RegExp(&quot;\\d+&quot;, &quot;&quot;); var re2:RegExp = /\d/; In the first expression, you must type the backlash character twice in this case, because the first parameter of the RegExp() constructor method is a string, and in a string literal you must type a backslash character twice to have it recognized as a single backslash character. The modifiers of the regular expression. These can include the following: g — When using the replace() method of the String class, specify this modifier to replace all matches, rather than only the first one. This modifier corresponds to the global property of the RegExp instance. i — The regular expression is evaluated without case sensitivity. This modifier corresponds to the ignoreCase property of the RegExp instance. s — The dot (.) character matches new-line characters. Note This modifier corresponds to the dotall property of the RegExp instance. m — The caret (^) character and dollar sign ($) match before and after new-line characters. This modifier corresponds to the multiline property of the RegExp instance. x — White space characters in the re string are ignored, so that you can write more readable constructors. This modifier corresponds to the extended property of the RegExp instance. All other characters in the flags string are ignored."/>
<page href="RegExp.html#exec()" title="RegExp.exec()" text="exec Performs a search for the regular expression on the given string str. If the g (global) flag is not set for the regular expression, then the search starts at the beginning of the string (at index position 0); the search ignores the lastIndex property of the regular expression. If the g (global) flag is set for the regular expression, then the search starts at the index position specified by the lastIndex property of the regular expression. If the search matches a substring, the lastIndex property changes to match the position of the end of the match. str The string to search. When the g (global) flag is not set in the regular expression, then you can use exec() to find the first match in the string: var myPattern:RegExp = /(\w~~)sh(\w~~)/ig; var str:String = &quot;She sells seashells by the seashore&quot;; var result:Object = myPattern.exec(str); trace(result); The result object is set to the following: result[0] is set to &quot;She&quot; (the complete match). result[1] is set to an empty string (the first matching parenthetical group). result[2] is set to &quot;e&quot; (the second matching parenthetical group). result.index is set to 0. result.input is set to the input string: &quot;She sells seashells by the seashore&quot;. In the following example, the g (global) flag is set in the regular expression, so you can use exec() repeatedly to find multiple matches: var myPattern:RegExp = /(\w~~)sh(\w~~)/ig; var str:String = &quot;She sells seashells by the seashore&quot;; var result:Object = myPattern.exec(str); while (result != null) { trace( result.index, &quot;\t&quot;, result); result = myPattern.exec(str); } This code results in the following output: 0 She,,e 10 seashells,sea,ells 27 seashore,sea,ore"/>
<page href="RegExp.html#test()" title="RegExp.test()" text="test Tests for the match of the regular expression in the given string str. If the g (global) flag is not set for the regular expression, then the search starts at the beginning of the string (at index position 0); the search ignores the lastIndex property of the regular expression. If the g (global) flag is set for the regular expression, then the search starts at the index position specified by the lastIndex property of the regular expression. If the search matches a substring, the lastIndex property changes to match the position of the end of the match. str The string to test. The following example shows the use of the test() method on a regular expression in which the g (global) flag is set: var re1:RegExp = /\w/g; var str:String = &quot;a b c&quot;; trace(re1.lastIndex); // 0 trace(re1.test(str)); // true trace(re1.lastIndex); // 1 trace(re1.test(str)); // true trace(re1.lastIndex); // 3 trace(re1.test(str)); // true trace(re1.lastIndex); // 5 trace(re1.test(str)); // false"/>
<page href="RegExp.html#dotall" title="RegExp.dotall" text="dotall Specifies whether the dot character (.) in a regular expression pattern matches new-line characters. Use the s flag when constructing a regular expression to set dotall = true. The following example shows the effect of the s (dotall) flag on a regular expression: var str:String = &quot;&lt;p&gt;Hello\n&quot; + &quot;again&lt;/p&gt;&quot; + &quot;&lt;p&gt;Hello&lt;/p&gt;&quot;; var pattern:RegExp = /&lt;p&gt;.*?&lt;\/p&gt;/; trace(pattern.dotall) // false trace(pattern.exec(str)); // &lt;p&gt;Hello&lt;/p&gt; pattern = /&lt;p&gt;.*?&lt;\/p&gt;/s; trace(pattern.dotall) // true trace(pattern.exec(str));"/>
<page href="RegExp.html#extended" title="RegExp.extended" text="extended Specifies whether to use extended mode for the regular expression. When a RegExp object is in extended mode, white space characters in the constructor string are ignored. This is done to allow more readable constructors. Use the x flag when constructing a regular expression to set extended = true. The following example shows different ways to construct the same regular expression. In each, the regular expression is to match a phone number pattern of xxx-xxx-xxxx or (xxx) xxx-xxxx or (xxx)xxx-xxxx. The second regular expression uses the x flag, causing the white spaces in the string to be ignored. var rePhonePattern1:RegExp = /\d{3}-\d{3}-\d{4}|\(\d{3}\)\s?\d{3}-\d{4}/; var str:String = &quot;The phone number is (415)555-1212.&quot;; trace(rePhonePattern1.extended) // false trace(rePhonePattern1.exec(str)); // (415)555-1212 var rePhonePattern2:RegExp = / \d{3}-\d{3}-\d{4} | \( \d{3} \) \ ? \d{3}-\d{4} /x; trace(rePhonePattern2.extended) // true trace(rePhonePattern2.exec(str)); // (415)555-1212"/>
<page href="RegExp.html#global" title="RegExp.global" text="global Specifies whether to use global matching for the regular expression. When global == true, the lastIndex property is set after a match is found. The next time a match is requested, the regular expression engine starts from the lastIndex position in the string. Use the g flag when constructing a regular expression to set global to true. The following example shows the effect setting the g (global) flag on the exec() method: var pattern:RegExp = /foo\d/; var str:String = &quot;foo1 foo2&quot;; trace(pattern.global); // false trace(pattern.exec(str)); // foo1 trace(pattern.lastIndex); // 0 trace(pattern.exec(str)); // foo1 pattern = /foo\d/g; trace(pattern.global); // true trace(pattern.exec(str)); // foo1 trace(pattern.lastIndex); // 4 trace(pattern.exec(str)); // foo2"/>
<page href="RegExp.html#ignoreCase" title="RegExp.ignoreCase" text="ignoreCase Specifies whether the regular expression ignores case sensitivity. Use the i flag when constructing a regular expression to set ignoreCase = true. The following example shows the effect of setting the i (ignoreCase) flag: var pattern:RegExp = /bob/; var str:String = &quot;Bob bob&quot;; trace(pattern.ignoreCase); // false trace(pattern.exec(str)); // bob pattern = /bob/i; trace(pattern.ignoreCase); // true trace(pattern.exec(str)); // Bob"/>
<page href="RegExp.html#lastIndex" title="RegExp.lastIndex" text="lastIndex Specifies the index position in the string at which to start the next search. This property affects the exec() and test() methods of the RegExp class. However, the match(), replace(), and search() methods of the String class ignore the lastIndex property and start all searches from the beginning of the string. When the exec() or test() method finds a match and the g (global) flag is set to true for the regular expression, the method automatically sets the lastIndex property to the index position of the character after the last character in the matching substring of the last match. If the g (global) flag is set to false, the method does not set the lastIndexproperty. You can set the lastIndex property to adjust the starting position in the string for regular expression matching. The following example shows the effect of setting the lastIndex property, and it shows how it is updated after a call to the exec() method on a regular expression in which the g (global) flag is set: var pattern:RegExp = /\w\d/g; var str:String = &quot;a1 b2 c3 d4&quot;; pattern.lastIndex = 2; trace(pattern.exec(str)); // b2 trace(pattern.lastIndex); // 5 trace(pattern.exec(str)); // c3 trace(pattern.lastIndex); // 8 trace(pattern.exec(str)); // d4 trace(pattern.lastIndex); // 11 trace(pattern.exec(str)); // null"/>
<page href="RegExp.html#multiline" title="RegExp.multiline" text="multiline Specifies whether the m (multiline) flag is set. If it is set, the caret (^) and dollar sign ($) in a regular expression match before and after new lines. Use the m flag when constructing a regular expression to set multiline = true. The following example shows the effect setting the m (multiline) flag: var pattern:RegExp = /^bob/; var str:String = &quot;foo\n&quot; + &quot;bob&quot;; trace(pattern.multiline); // false trace(pattern.exec(str)); // null pattern = /^bob/m; trace(pattern.multiline); // true trace(pattern.exec(str)); // bob"/>
<page href="RegExp.html#source" title="RegExp.source" text="source Specifies the pattern portion of the regular expression. The following code outputs the source parameter for two regular expressions: var re1:RegExp = /aabb/gi; trace(re1.source); // aabb var re2:RegExp = new RegExp(&quot;x+y*&quot;, &quot;i&quot;); trace(re2.source); // x+y*"/>
<page href="Math.html" title="Math class" text="Math The Math class contains methods and constants that represent common mathematical functions and values. 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'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/180 To calculate degrees from radians, use the following formula: degrees = radians ~~ 180/Math.PI The 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) Note: The Math functions acos, asin, atan, atan2, cos, exp, log, pow, sin, and sqrt may result in slightly different values depending on the algorithms used by the CPU or operating system. Flash Player calls on the CPU (or operating system if the CPU doesn't support floating point calculations) when performing the calculations for the listed functions, and results have shown slight variations depending upon the CPU or operating system in use."/>
<page href="Math.html#abs()" title="Math.abs()" text="abs Computes and returns an absolute value for the number specified by the parameter val. val The number whose absolute value is returned."/>
<page href="Math.html#acos()" title="Math.acos()" text="acos Computes and returns the arc cosine of the number specified in the parameter val, in radians. val A number from -1.0 to 1.0."/>
<page href="Math.html#asin()" title="Math.asin()" text="asin Computes and returns the arc sine for the number specified in the parameter val, in radians. val A number from -1.0 to 1.0."/>
<page href="Math.html#atan()" title="Math.atan()" text="atan Computes and returns the value, in radians, of the angle whose tangent is specified in the parameter val. The return value is between negative pi divided by 2 and positive pi divided by 2. val A number that represents the tangent of an angle."/>
<page href="Math.html#atan2()" title="Math.atan2()" text="atan2 Computes and returns the angle of the point y/x in radians, when measured counterclockwise from a circle's x axis (where 0,0 represents the center of the circle). The return value is between positive pi and negative pi. Note that the first parameter to atan2 is always the y coordinate. y x The y coordinate of the point. The x coordinate of the point."/>
<page href="Math.html#ceil()" title="Math.ceil()" text="ceil Returns 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. val A number or expression."/>
<page href="Math.html#cos()" title="Math.cos()" text="cos Computes and returns the cosine of the specified angle in radians. To calculate a radian, see the overview of the Math class. angleRadians A number that represents an angle measured in radians."/>
<page href="Math.html#exp()" title="Math.exp()" text="exp Returns the value of the base of the natural logarithm (e), to the power of the exponent specified in the parameter val. The constant Math.E can provide the value of e. val The exponent; a number or expression."/>
<page href="Math.html#floor()" title="Math.floor()" text="floor Returns the floor of the number or expression specified in the parameter val. The floor is the closest integer that is less than or equal to the specified number or expression. val A number or expression."/>
<page href="Math.html#log()" title="Math.log()" text="log Returns the natural logarithm of the parameter val. val A number or expression with a value greater than 0."/>
<page href="Math.html#max()" title="Math.max()" text="max Evaluates val1 and val2 (or more values) and returns the largest value. val1 val2 rest A number or expression. A number or expression. A number or expression. Math.max() can accept multiple arguments."/>
<page href="Math.html#min()" title="Math.min()" text="min Evaluates val1 and val2 (or more values) and returns the smallest value. val1 val2 rest A number or expression. A number or expression. A number or expression. Math.min() can accept multiple arguments."/>
<page href="Math.html#pow()" title="Math.pow()" text="pow Computes and returns val1 to the power of val2. val1 val2 A number to be raised by the power of the parameter val2. A number specifying the power that the parameter val1 is raised by."/>
<page href="Math.html#random()" title="Math.random()" text="random Returns a pseudo-random number n, where 0 &lt;= n &lt; 1. The number returned is calculated in an undisclosed manner, and pseudo-random because the calculation inevitably contains some element of non-randomness."/>
<page href="Math.html#round()" title="Math.round()" text="round Rounds the value of the parameter val up or down to the nearest integer and returns the value. If val is equidistant from its two nearest integers (that is, if the number ends in .5), the value is rounded up to the next higher integer. val The number to round."/>
<page href="Math.html#sin()" title="Math.sin()" text="sin Computes and returns the sine of the specified angle in radians. To calculate a radian, see the overview of the Math class. angleRadians A number that represents an angle measured in radians."/>
<page href="Math.html#sqrt()" title="Math.sqrt()" text="sqrt Computes and returns the square root of the specified number. val A number or expression greater than or equal to 0."/>
<page href="Math.html#tan()" title="Math.tan()" text="tan Computes and returns the tangent of the specified angle. To calculate a radian, see the overview of the Math class. angleRadians A number that represents an angle measured in radians."/>
<page href="Math.html#E" title="Math.E" text="E A mathematical constant for the base of natural logarithms, expressed as e. The approximate value of e is 2.71828182845905."/>
<page href="Math.html#LN10" title="Math.LN10" text="LN10 A mathematical constant for the natural logarithm of 10, expressed as loge10, with an approximate value of 2.302585092994046."/>
<page href="Math.html#LN2" title="Math.LN2" text="LN2 A mathematical constant for the natural logarithm of 2, expressed as loge2, with an approximate value of 0.6931471805599453."/>
<page href="Math.html#LOG10E" title="Math.LOG10E" text="LOG10E A 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 to obtain the base-10 logarithm."/>
<page href="Math.html#LOG2E" title="Math.LOG2E" text="LOG2E A mathematical constant for the base-2 logarithm of the constant 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 to obtain the base-2 logarithm."/>
<page href="Math.html#PI" title="Math.PI" text="PI A mathematical constant for the ratio of the circumference of a circle to its diameter, expressed as pi, with a value of 3.141592653589793."/>
<page href="Math.html#SQRT1_2" title="Math.SQRT1_2" text="SQRT1_2 A mathematical constant for the square root of one-half, with an approximate value of 0.7071067811865476."/>
<page href="Math.html#SQRT2" title="Math.SQRT2" text="SQRT2 A mathematical constant for the square root of 2, with an approximate value of 1.4142135623730951."/>
<page href="Error.html" title="Error class" text="Error The Error class contains information about an error that occurred in a script. In developing ActionScript 3.0 applications, when you run your compiled code in the debugger version of Flash Player, a dialog box displays exceptions of type Error, or of a subclass, to help you troubleshoot the code. You create an Error object by using the Error constructor function. Typically, you throw a new Error object from within a try code block that is caught by a catch or finally code block. You can also create a subclass of the Error class and throw instances of that subclass."/>
<page href="Error.html#Error()" title="Error.Error()" text="Error Creates a new Error object. If message is specified, its value is assigned to the object's Error.message property. message id A string associated with the Error object; this parameter is optional. A reference number to associate with the specific error message. The following example creates a new Error object err and then, using the Error() constructor, assigns the string &quot;New Error Message&quot; to err. var err:Error = new Error(); trace(err.toString()); // Error err = new Error(&quot;New Error Message&quot;); trace(err.toString()); // Error: New Error Message"/>
<page href="Error.html#getStackTrace()" title="Error.getStackTrace()" text="getStackTrace Returns the call stack for an error as a string at the time of the error's construction (for the debugger version of Flash Player only). As shown in the following example, the first line of the return value is the string representation of the exception object, followed by the stack trace elements: TypeError: null cannot be converted to an object at com.xyz.OrderEntry.retrieveData(OrderEntry.as:995) at com.xyz.OrderEntry.init(OrderEntry.as:200) at com.xyz.OrderEntry.$construct(OrderEntry.as:148)"/>
<page href="Error.html#toString()" title="Error.toString()" text="toString Returns the string &quot;Error&quot; by default or the value contained in Error.message property, if defined. The following example creates a new Error object err and then, using the Error() constructor, assigns the string &quot;New Error Message&quot; to err. Finally, the message property is set to &quot;Another New Error Message&quot;, which overwrites &quot;New Error Message&quot;. var err:Error = new Error(); trace(err.toString()); // Error err = new Error(&quot;New Error Message&quot;); trace(err.toString()); // Error: New Error Message err.message = &quot;Another New Error Message&quot;; trace(err.toString()); // Error: Another New Error Message"/>
<page href="Error.html#errorID" title="Error.errorID" text="errorID Contains the reference number associated with the specific error message. For a custom Error object, this number is the value from the id parameter supplied in the constructor."/>
<page href="Error.html#message" title="Error.message" text="message Contains 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."/>
<page href="Error.html#name" title="Error.name" text="name Contains the name of the Error object. By default, the value of this property is &quot;Error&quot;."/>
<page href="Namespace.html" title="Namespace class" text="Namespace The Namespace class contains methods and properties for defining and working with namespaces. There are three scenarios for using namespaces: Namespaces of XML objects Namespaces associate a namespace prefix with a Uniform Resource Identifier (URI) that identifies the namespace. The prefix is a string used to reference the namespace within an XML object. If the prefix is undefined, when the XML is converted to a string, a prefix is automatically generated. Namespace to differentiate methods Namespaces can differentiate methods with the same name to perform different tasks. If two methods have the same name but separate namespaces, they can perform different tasks. Namespaces for access control Namespaces can be used to control access to a group of properties and methods in a class. If you place the properties and methods into a private namespace, they are inaccessible to any code that does not have access to that namespace. You can grant access to the group of properties and methods by passing the namespace to other classes, methods or functions. This class shows two forms of the constructor method because each form accepts different parameters. This class (along with the XML, XMLList, and QName classes) implements powerful XML-handling standards defined in ECMAScript for XML (E4X) specification (ECMA-357 edition 2)."/>
<page href="Namespace.html#Namespace()" title="Namespace.Namespace()" text="Namespace Creates a Namespace object. The values assigned to the uri and prefix properties of the new Namespace object depend on the type of value passed for the uriValue parameter: If no value is passed, the prefix and uri properties are set to an empty string. If the value is a Namespace object, a copy of the object is created. If the value is a QName object, the uri property is set to the uri property of the QName object. Note: This class shows two constructor entries because each form accepts different parameters. The constructor behaves differently depending on the type and number of parameters passed, as detailed in each entry. ActionSript 3.0 does not support method or constructor overloading. uriValue The Uniform Resource Identifier (URI) of the namespace."/>
<page href="Namespace.html#Namespace()" title="Namespace.Namespace()" text="Namespace Creates a Namespace object according to the values of the prefixValue and uriValue parameters. This constructor requires both parameters. The value of the prefixValue parameter is assigned to the prefix property as follows: If undefined is passed, prefix is set to undefined. If the value is a valid XML name, as determined by the isXMLName() function, it is converted to a string and assigned to the prefix property. If the value is not a valid XML name, the prefix property is set to undefined. The value of the uriValue parameter is assigned to the uri property as follows: If a QName object is passed, the uri property is set to the value of the QName object's uri property. Otherwise, the uriValue parameter is converted to a string and assigned to the uri property. Note: This class shows two constructor method entries because each form accepts different parameters. The constructor behaves differently depending on the type and number of arguments passed, as detailed in each entry. ActionSript 3.0 does not support method or constructor overloading. prefixValue uriValue The prefix to use for the namespace. The Uniform Resource Identifier (URI) of the namespace."/>
<page href="Namespace.html#toString()" title="Namespace.toString()" text="toString Equivalent to the Namespace.uri property."/>
<page href="Namespace.html#valueOf()" title="Namespace.valueOf()" text="valueOf Returns the URI value of the specified object."/>
<page href="Namespace.html#prefix" title="Namespace.prefix" text="prefix The prefix of the namespace."/>
<page href="Namespace.html#uri" title="Namespace.uri" text="uri The Uniform Resource Identifier (URI) of the namespace."/>
<page href="QName.html" title="QName class" text="QName QName objects represent qualified names of XML elements and attributes. Each QName object has a local name and a namespace Uniform Resource Identifier (URI). When the value of the namespace URI is null, the QName object matches any namespace. Use the QName constructor to create a new QName object that is either a copy of another QName object or a new QName object with a uri from a Namespace object and a localName from a QName object. Methods specific to E4X can use QName objects interchangeably with strings. E4X methods are in the QName, Namespace, XML, and XMLList classes. These E4X methods, which take a string, can also take a QName object. This interchangeability is how namespace support works with, for example, the XML.child() method. The QName class (along with the XML, XMLList, and Namespace classes) implements powerful XML-handling standards defined in ECMAScript for XML (E4X) specification (ECMA-357 edition 2). A qualified identifier evaluates to a QName object. If the QName object of an XML element is specified without identifying a namespace, the uri property of the associated QName object is set to the global default namespace. If the QName object of an XML attribute is specified without identifying a namespace, the uri property is set to an empty string."/>
<page href="QName.html#QName()" title="QName.QName()" text="QName Creates a QName object with a URI from a Namespace object and a localName from a QName object. If either parameter is not the expected data type, the parameter is converted to a string and assigned to the corresponding property of the new QName object. For example, if both parameters are strings, a new QName object is returned with a uri property set to the first parameter and a localName property set to the second parameter. In other words, the following permutations, along with many others, are valid forms of the constructor: QName (uri:Namespace, localName:String); QName (uri:String, localName: QName); QName (uri:String, localName: String); If you pass null for the uri parameter, the uri property of the new QName object is set to null. Note: This class shows two constructor entries because each form accepts different parameters. The constructor behaves differently depending on the type and number of parameters passed, as detailed in each entry. ActionSript 3.0 does not support method or constructor overloading. uri localName A Namespace object from which to copy the uri value. A parameter of any other type is converted to a string. A QName object from which to copy the localName value. A parameter of any other type is converted to a string."/>
<page href="QName.html#QName()" title="QName.QName()" text="QName Creates a QName object that is a copy of another QName object. If the parameter passed to the constructor is a QName object, a copy of the QName object is created. If the parameter is not a QName object, the parameter is converted to a string and assigned to the localName property of the new QName instance. If the parameter is undefined or unspecified, a new QName object is created with the localName property set to the empty string. Note: This class shows two constructor entries because each form accepts different parameters. The constructor behaves differently depending on the type and number of parameters passed, as detailed in each entry. ActionSript 3.0 does not support method or constructor overloading. qname The QName object to be copied. Objects of any other type are converted to a string that is assigned to the localName property of the new QName object."/>
<page href="QName.html#toString()" title="QName.toString()" text="toString Returns a string composed of the URI, and the local name for the QName object, separated by &quot;::&quot;. The format depends on the uri property of the QName object: If uri == &quot;&quot; toString returns localName else if uri == null toString returns ~~::localName else toString returns uri::localName"/>
<page href="QName.html#valueOf()" title="QName.valueOf()" text="valueOf Returns the QName object."/>
<page href="QName.html#localName" title="QName.localName" text="localName The local name of the QName object."/>
<page href="QName.html#uri" title="QName.uri" text="uri The Uniform Resource Identifier (URI) of the QName object."/>
<page href="RangeError.html" title="RangeError class" text="RangeError A RangeError exception is thrown when a numeric value is outside the acceptable range. When working with arrays, referring to an index position of an array item that does not exist will throw a RangeError exception. Using Number.toExponential(), Number.toPrecision(), and Number.toFixed() methods will throw a RangeError exception in cases where the arguments are outside the acceptable range of numbers. You can extend Number.toExponential(), Number.toPrecision(), and Number.toFixed() to avoid throwing a RangeError. Other situations that cause this exception to be thrown include the following: Any Flash Player API that expects a depth number is invoked with an invalid depth number. Any Flash Player API that expects a frame number is invoked with an invalid frame number. Any Flash Player API that expects a layer number is invoked with an invalid layer number."/>
<page href="RangeError.html#RangeError()" title="RangeError.RangeError()" text="RangeError Creates a new RangeError object. message Contains the message associated with the RangeError object."/>
<page href="uint.html" title="uint class" text="uint The uint class provides methods for working with a data type representing a 32-bit unsigned integer. Because an unsigned integer can only be positive, its maximum value is twice that of the int class. The range of values represented by the uint class is 0 to 4,294,967,295 (2^32-1). You can create a uint object by declaring a variable of type uint and assigning the variable a literal value. The default value of a variable of type uint is 0. The uint class is primarily useful for pixel color values (ARGB and RGBA) and other situations where the int data type does not work well. For example, the number 0xFFFFFFFF, which represents the color value white with an alpha value of 255, can't be represented using the int data type because it is not within the valid range of the int values. The following example creates a uint object and calls the toString() method: var myuint:uint = 1234; trace(myuint.toString()); // output: 1234 The following example assigns the value of the MIN_VALUE property to a variable without the use of the constructor: var smallest:uint = uint.MIN_VALUE; trace(smallest.toString()); // output: 0"/>
<page href="uint.html#uint()" title="uint.uint()" text="uint Creates a new uint object. You can create a variable of uint type and assign it a literal value. The new uint() constructor is primarily used as a placeholder. A uint object is not the same as the uint() function, which converts a parameter to a primitive value. num The numeric value of the uint object being created, or a value to be converted to a number. If num is not provided, the default value is 0. The following code constructs two new uint objects; the first by assigning a literal value, and the second by using the constructor function: var n1:uint = 3; var n2:uint = new uint(10);"/>
<page href="uint.html#toExponential()" title="uint.toExponential()" text="toExponential Returns a string representation of the number in exponential notation. The string contains one digit before the decimal point and up to 20 digits after the decimal point, as specified by the fractionDigits parameter. fractionDigits An integer between 0 and 20, inclusive, that represents the desired number of decimal places. The following example shows how toExponential(2) returns a string in exponential notation. var num:Number = 315003; trace(num.toExponential(2)); // 3.15e+5 Throws an exception if the fractionDigits argument is outside the range 0 to 20."/>
<page href="uint.html#toFixed()" title="uint.toFixed()" text="toFixed Returns a string representation of the number in fixed-point notation. Fixed-point notation means that the string will contain a specific number of digits after the decimal point, as specified in the fractionDigits parameter. The valid range for the fractionDigits parameter is from 0 to 20. Specifying a value outside this range throws an exception. fractionDigits An integer between 0 and 20, inclusive, that represents the desired number of decimal places. The following example shows how toFixed(3) returns a string that rounds to three decimal places. var num:Number = 7.31343; trace(num.toFixed(3)); // 7.313 Throws an exception if the fractionDigits argument is outside the range 0 to 20."/>
<page href="uint.html#toPrecision()" title="uint.toPrecision()" text="toPrecision Returns a string representation of the number either in exponential notation or in fixed-point notation. The string will contain the number of digits specified in the precision parameter. precision An integer between 1 and 21, inclusive, that represents the desired number of digits to represent in the resulting string. The following example shows how toPrecision(3) returns a string with only three digits. The string is in fixed-point notation because exponential notation is not required. var num:Number = 31.570; trace(num.toPrecision(3)); // 31.6 Throws an exception if the precision argument is outside the range 1 to 21."/>
<page href="uint.html#toString()" title="uint.toString()" text="toString Returns the string representation of a uint object. radix 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. The following example uses 2 and 8 for the radix parameters and returns a string value with the corresponding representation of the number 9: var myuint:uint = 9; trace(myuint.toString(2)); // output: 1001 trace(myuint.toString(8)); // output: 11 The following example creates hexadecimal values: var r:uint = 250; var g:uint = 128; var b:uint = 114; var rgb:String = &quot;0x&quot; + r.toString(16) + g.toString(16) + b.toString(16); trace(rgb); // 0xfa8072"/>
<page href="uint.html#valueOf()" title="uint.valueOf()" text="valueOf Returns the primitive uint type value of the specified uint object. The following example outputs the primitive value of the numSocks object. var numSocks:uint = 2; trace(numSocks.valueOf()); // 2"/>
<page href="uint.html#MAX_VALUE" title="uint.MAX_VALUE" text="MAX_VALUE The largest representable 32-bit unsigned integer, which is 4,294,967,295. The following ActionScript displays the largest and smallest representable uint values: trace(&quot;uint.MIN_VALUE = &quot; + uint.MIN_VALUE); trace(&quot;uint.MAX_VALUE = &quot; + uint.MAX_VALUE); The values are: uint.MIN_VALUE = 0 uint.MAX_VALUE = 4294967295"/>
<page href="uint.html#MIN_VALUE" title="uint.MIN_VALUE" text="MIN_VALUE The smallest representable unsigned integer, which is 0. The following ActionScript displays the largest and smallest representable uint values: trace(&quot;uint.MIN_VALUE = &quot; + uint.MIN_VALUE); trace(&quot;uint.MAX_VALUE = &quot; + uint.MAX_VALUE); The values are: uint.MIN_VALUE = 0 uint.MAX_VALUE = 4294967295"/>
<page href="ReferenceError.html" title="ReferenceError class" text="ReferenceError A ReferenceError exception is thrown when a reference to an undefined property is attempted on a sealed (nondynamic) object. References to undefined variables will result in ReferenceError exceptions to inform you of potential bugs and help you troubleshoot application code. However, you can refer to undefined properties of a dynamic class without causing a ReferenceError exception to be thrown. For more information, see the dynamic keyword."/>
<page href="ReferenceError.html#ReferenceError()" title="ReferenceError.ReferenceError()" text="ReferenceError Creates a new ReferenceError object. message Contains the message associated with the ReferenceError object."/>
<page href="XMLList.html" title="XMLList class" text="XMLList The XMLList class contains methods for working with one or more XML elements. An XMLList object can represent one or more XML objects or elements (including multiple nodes or attributes), so you can call methods on the elements as a group or on the individual elements in the collection. If an XMLList object has only one XML element, you can use the XML class methods on the XMLList object directly. In the following example, example.two is an XMLList object of length 1, so you can call any XML method on it. var example2 = &lt;example&gt;&lt;two&gt;2&lt;/two&gt;&lt;/example&gt;; If you attempt to use XML class methods with an XMLList object containing more than one XML object, an exception is thrown; instead, iterate over the XMLList collection (using a for each..in statement, for example) and apply the methods to each XML object in the collection."/>
<page href="XMLList.html#XMLList()" title="XMLList.XMLList()" text="XMLList Creates a new XMLList object. value Any object that can be converted to an XMLList object by using the top-level XMLList() function."/>
<page href="XMLList.html#attribute()" title="XMLList.attribute()" text="attribute Calls the attribute() method of each XML object and returns an XMLList object of the results. The results match the given attributeName parameter. If there is no match, the attribute() method returns an empty XMLList object. attributeName The name of the attribute that you want to include in an XMLList object."/>
<page href="XMLList.html#attributes()" title="XMLList.attributes()" text="attributes Calls the attributes() method of each XML object and returns an XMLList object of attributes for each XML object."/>
<page href="XMLList.html#child()" title="XMLList.child()" text="child Calls the child() method of each XML object and returns an XMLList object that contains the results in order. propertyName The element name or integer of the XML child."/>
<page href="XMLList.html#children()" title="XMLList.children()" text="children Calls the children() method of each XML object and returns an XMLList object that contains the results."/>
<page href="XMLList.html#comments()" title="XMLList.comments()" text="comments Calls the comments() method of each XML object and returns an XMLList of comments."/>
<page href="XMLList.html#contains()" title="XMLList.contains()" text="contains Checks whether the XMLList object contains an XML object that is equal to the given value parameter. value An XML object to compare against the current XMLList object."/>
<page href="XMLList.html#copy()" title="XMLList.copy()" text="copy Returns a copy of the given XMLList object. The copy is a duplicate of the entire tree of nodes. The copied XML object has no parent and returns null if you attempt to call the parent() method."/>
<page href="XMLList.html#descendants()" title="XMLList.descendants()" text="descendants Returns all descendants (children, grandchildren, great-grandchildren, and so on) of the XML object that have the given name parameter. The name parameter can be a QName object, a String data type, or any other data type that is then converted to a String data type. To return all descendants, use the asterisk (~~) parameter. If no parameter is passed, the string &quot;~~&quot; is passed and returns all descendants of the XML object. name The name of the element to match."/>
<page href="XMLList.html#elements()" title="XMLList.elements()" text="elements Calls the elements() method of each XML object. The name parameter is passed to the descendants() method. If no parameter is passed, the string &quot;~~&quot; is passed to the descendants() method. name The name of the elements to match."/>
<page href="XMLList.html#hasComplexContent()" title="XMLList.hasComplexContent()" text="hasComplexContent Checks whether the XMLList object contains complex content. An XMLList object is considered to contain complex content if it is not empty and either of the following conditions is true: The XMLList object contains a single XML item with complex content. The XMLList object contains elements."/>
<page href="XMLList.html#hasOwnProperty()" title="XMLList.hasOwnProperty()" text="hasOwnProperty Checks for the property specified by p. p The property to match."/>
<page href="XMLList.html#hasSimpleContent()" title="XMLList.hasSimpleContent()" text="hasSimpleContent Checks whether the XMLList object contains simple content. An XMLList object is considered to contain simple content if one or more of the following conditions is true: The XMLList object is empty The XMLList object contains a single XML item with simple content The XMLList object contains no elements"/>
<page href="XMLList.html#length()" title="XMLList.length()" text="length Returns the number of properties in the XMLList object."/>
<page href="XMLList.html#normalize()" title="XMLList.normalize()" text="normalize Merges adjacent text nodes and eliminates empty text nodes for each of the following: all text nodes in the XMLList, all the XML objects contained in the XMLList, and the descendants of all the XML objects in the XMLList."/>
<page href="XMLList.html#parent()" title="XMLList.parent()" text="parent Returns the parent of the XMLList object if all items in the XMLList object have the same parent. If the XMLList object has no parent or different parents, the method returns undefined."/>
<page href="XMLList.html#processingInstructions()" title="XMLList.processingInstructions()" text="processingInstructions If a name parameter is provided, lists all the children of the XMLList object that contain processing instructions with that name. With no parameters, the method lists all the children of the XMLList object that contain any processing instructions. name The name of the processing instructions to match."/>
<page href="XMLList.html#propertyIsEnumerable()" title="XMLList.propertyIsEnumerable()" text="propertyIsEnumerable Checks whether the property p is in the set of properties that can be iterated in a for..in statement applied to the XMLList object. This is true only if toNumber(p) is greater than or equal to 0 and less than the length of the XMLList object. p The index of a property to check."/>
<page href="XMLList.html#text()" title="XMLList.text()" text="text Calls the text() method of each XML object and returns an XMLList object that contains the results."/>
<page href="XMLList.html#toString()" title="XMLList.toString()" text="toString Returns a string representation of all the XML objects in an XMLList object. The rules for this conversion depend on whether the XML object has simple content or complex content: If the XML object has simple content, toString() returns the string contents of the XML object with the following stripped out: the start tag, attributes, namespace declarations, and end tag. If the XML object has complex content, toString() returns an XML encoded string representing the entire XML object, including the start tag, attributes, namespace declarations, and end tag. To return the entire XML object every time, use the toXMLString() method. The following example shows what the toString() method returns when the XML object has simple content: var test:XML = &lt;type name=&quot;Joe&quot;&gt;example&lt;/type&gt;; trace(test.toString()); //example"/>
<page href="XMLList.html#toXMLString()" title="XMLList.toXMLString()" text="toXMLString Returns a string representation of all the XML objects in an XMLList object. Unlike the toString() method, the toXMLString() method always returns the start tag, attributes, and end tag of the XML object, regardless of whether the XML object has simple content or complex content. (The toString() method strips out these items for XML objects that contain simple content.)"/>
<page href="XMLList.html#valueOf()" title="XMLList.valueOf()" text="valueOf Returns the XMLList object."/>
<page href="String.html" title="String class" text="String The String class is a data type that represents a string of characters. The String class provides methods and properties that let you manipulate primitive string value types. You can convert the value of any object into a String data type object 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 whether you use the constructor method new String() to create a new string variable or simply assign a string literal value. Unlike previous versions of ActionScript, it makes no difference whether you use the constructor, the global function, or simply assign a string literal value. The following lines of code are equivalent: var str:String = new String(&quot;foo&quot;); var str:String = &quot;foo&quot;; var str:String = String(&quot;foo&quot;); When setting a string variable to undefined, Adobe® Flash® Player coerces undefined to null. So, the statement: var s:String = undefined; sets the value to null instead of undefined. Use the String() function if you need to use undefined."/>
<page href="String.html#String()" title="String.String()" text="String Creates a new String object initialized to the specified string. Note: Because string literals use less overhead than String objects and are generally easier to use, you should use string literals instead of the String class unless you have a good reason to use a String object rather than a string literal. val The initial value of the new String object."/>
<page href="String.html#charAt()" title="String.charAt()" text="charAt Returns the character in the position specified by the index parameter. 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. index 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."/>
<page href="String.html#charCodeAt()" title="String.charCodeAt()" text="charCodeAt Returns the numeric Unicode character code of the character at the specified 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 the actual character. index 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."/>
<page href="String.html#concat()" title="String.concat()" text="concat Appends the supplied arguments to the end of the String object, converting them to strings if necessary, and returns the resulting string. The original value of the source String object remains unchanged. args Zero or more values to be concatenated."/>
<page href="String.html#fromCharCode()" title="String.fromCharCode()" text="fromCharCode Returns a string comprising the characters represented by the Unicode character codes in the parameters. charCodes A series of decimal integers that represent Unicode values."/>
<page href="String.html#indexOf()" title="String.indexOf()" text="indexOf Searches the string and returns the position of the first occurrence of val 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 val is not found, the method returns -1. val startIndex The substring for which to search. An optional integer specifying the starting index of the search."/>
<page href="String.html#lastIndexOf()" title="String.lastIndexOf()" text="lastIndexOf Searches the string from right to left and returns the index of the last occurrence of val found before startIndex. The index is zero-based, meaning that the first character is at index 0, and the last is at string.length - 1. If val is not found, the method returns -1. val startIndex The string for which to search. An optional integer specifying the starting index from which to search for val. The default is the maximum value allowed for an index. If startIndex is not specified, the search starts at the last item in the string."/>
<page href="String.html#localeCompare()" title="String.localeCompare()" text="localeCompare Compares the sort order of two or more strings and returns the result of the comparison as an integer. While this method is intended to handle the comparison in a locale-specific way, the ActionScript 3.0 implementation does not produce a different result from other string comparisons such as the equality (==) or inequality (!=) operators. If the strings are equivalent, the return value is 0. If the original string value precedes the string value specified by other, the return value is a negative integer, the absolute value of which represents the number of characters that separates the two string values. If the original string value comes after other, the return value is a positive integer, the absolute value of which represents the number of characters that separates the two string values. other values A string value to compare. Optional set of more strings to compare."/>
<page href="String.html#match()" title="String.match()" text="match Matches the specifed pattern against the string. pattern The pattern to match, which can be any type of object, but it is typically either a string or a regular expression. If the pattern is not a regular expression or a string, then the method converts it to a string before executing."/>
<page href="String.html#replace()" title="String.replace()" text="replace Matches the specifed pattern against the string and returns a new string in which the first match of pattern is replaced with the content specified by repl. The pattern parameter can be a string or a regular expression. The repl parameter can be a string or a function; if it is a function, the string returned by the function is inserted in place of the match. The original string is not modified. In the following example, only the first instance of &quot;sh&quot; (case-sensitive) is replaced: var myPattern:RegExp = /sh/; var str:String = &quot;She sells seashells by the seashore.&quot;; trace(str.replace(myPattern, &quot;sch&quot;)); // She sells seaschells by the seashore. In the following example, all instances of &quot;sh&quot; (case-sensitive) are replaced because the g (global) flag is set in the regular expression: var myPattern:RegExp = /sh/g; var str:String = &quot;She sells seashells by the seashore.&quot;; trace(str.replace(myPattern, &quot;sch&quot;)); // She sells seaschells by the seaschore. In the following example, all instance of &quot;sh&quot; are replaced because the g (global) flag is set in the regular expression and the matches are not case-sensitive because the i (ignoreCase) flag is set: var myPattern:RegExp = /sh/gi; var str:String = &quot;She sells seashells by the seashore.&quot;; trace(str.replace(myPattern, &quot;sch&quot;)); // sche sells seaschells by the seaschore. pattern repl The pattern to match, which can be any type of object, but it is typically either a string or a regular expression. If you specify a pattern parameter that is any object other than a string or a regular expression, the toString() method is applied to the parameter and the replace() method executes using the resulting string as the pattern. Typically, the string that is inserted in place of the matching content. However, you can also specify a function as this parameter. If you specify a function, the string returned by the function is inserted in place of the matching content. When you specify a string as the repl parameter and specify a regular expression as the pattern parameter, you can use the following special $ replacement codes in the repl string: $ Code Replacement Text $$ $ $&amp; The matched substring. $` The portion of the string that precedes the matched substring. Note that this code uses the straight left single quote character (`), not the straight single quote character (') or the left curly single quote character (‘). $' The portion of string that follows the matched substring. Note that this code uses the straight single quote character ('). $n The nth captured parenthetical group match, where n is a single digit 1-9 and $n is not followed by a decimal digit. $nn The nnth captured parenthetical group match, where nn is a two-digit decimal number (01-99). If the nnth capture is undefined, the replacement text is an empty string. For example, the following shows the use of the $2 and $1 replacement codes, which represent the first and second capturing group matched: var str:String = &quot;flip-flop&quot;; var pattern:RegExp = /(\w+)-(\w+)/g; trace(str.replace(pattern, &quot;$2-$1&quot;)); // flop-flip When you specify a function as the repl, the replace() method passes the following parameters to the function: The matching portion of the string. Any captured parenthetical group matches are provided as the next arguments. The number of arguments passed this way will vary depending on the number of parenthetical matches. You can determine the number of parenthetical matches by checking arguments.length - 3 within the function code. The index position in the string where the match begins. The complete string. For example, consider the following: var str1:String = &quot;abc12 def34&quot;; var pattern:RegExp = /([a-z]+)([0-9]+)/g; var str2:String = str1.replace(pattern, replFN); trace(str2); // 12abc 34def function replFN():String { return arguments[2] + arguments[1]; } The call to the replace() method uses a function as the repl parameter. The regular expression (/([a-z]([0-9]/g) is matched twice. The first time, the pattern matches the substring &quot;abc12&quot;, and the following list of arguments is passed to the function: {&quot;abc12&quot;, &quot;abc&quot;, &quot;12&quot;, 0, &quot;abc12 def34&quot;} The second time, the pattern matches the substring &quot;def23&quot;, and the following list of arguments is passed to the function: {&quot;def34&quot;, &quot;def&quot;, &quot;34&quot;, 6, &quot;abc123 def34&quot;}"/>
<page href="String.html#search()" title="String.search()" text="search Searches for the specifed pattern and returns the index of the first matching substring. If there is no matching substring, the method returns -1. pattern The pattern to match, which can be any type of object but is typically either a string or a regular expression.. If the pattern is not a regular expression or a string, then the method converts it to a string before executing. Note that if you specify a regular expression, the method ignores the global flag (&quot;g&quot;) of the regular expression, and it ignores the lastIndex property of the regular expression (and leaves it unmodified). If you pass an undefined value (or no value), the method returns -1."/>
<page href="String.html#slice()" title="String.slice()" text="slice Returns a string that includes the startIndex character and all characters up to, but not including, the endIndex character. The original String object is not modified. If the endIndex parameter is not specified, then the end of the substring is the end of the string. If the character indexed by startIndex is the same as or to the right of the character indexed by endIndex, the method returns an empty string. startIndex endIndex The zero-based index of the starting point for the slice. If startIndex is a negative number, the slice is created from right-to-left, where -1 is the last character. An integer that is one greater than the index of the ending point for the slice. The character indexed by the endIndex parameter is not included in the extracted string. If endIndex is a negative number, the ending point is determined by counting back from the end of the string, where -1 is the last character. The default is the maximum value allowed for an index. If this parameter is omitted, String.length is used."/>
<page href="String.html#split()" title="String.split()" text="split Splits a String object into an array of substrings by dividing it wherever the specified delimiter parameter occurs. If the delimiter parameter is a regular expression, only the first match at a given position of the string is considered, even if backtracking could find a nonempty substring match at that position. For example: var str:String = &quot;ab&quot;; var results:Array = str.split(/a~~?/); // results == [&quot;&quot;,&quot;b&quot;] results = str.split(/a~~/); // results == [&quot;&quot;,&quot;b&quot;].) If the delimiter parameter is a regular expression containing grouping parentheses, then each time the delimiter is matched, the results (including any undefined results) of the grouping parentheses are spliced into the output array. For example var str:String = &quot;Thi5 is a tricky-66 example.&quot;; var re:RegExp = /(\d+)/; var results:Array = str.split(re); // results == [&quot;Thi&quot;,&quot;5&quot;,&quot; is a tricky-&quot;,&quot;66&quot;,&quot; example.&quot;] If the limit parameter is specified, then the returned array will have no more than the specified number of elements. If the delimiter is an empty string, an empty regular expression, or a regular expression that can match an empty string, each single character in the string is output 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. delimiter limit The pattern that specifies where to split this string. This can be any type of object but is typically either a string or a regular expression. If the delimiter is not a regular expression or string, then the method converts it to a string before executing. The maximum number of items to place into the array. The default is the maximum value allowed."/>
<page href="String.html#substr()" title="String.substr()" text="substr Returns a substring consisting of the characters that start at the specified startIndex and with a length specified by len. The original string is unmodified. startIndex len An integer that specified the index of the first character to be used to create the substring. If startIndex is a negative number, the starting index is determined from the end of the string, where -1 is the last character. The number of characters in the substring being created. The default value is the maximum value allowed. If len is not specified, the substring includes all the characters from startIndex to the end of the string."/>
<page href="String.html#substring()" title="String.substring()" text="substring Returns a string consisting of the character specified by startIndex and all characters up to endIndex - 1. If endIndex is not specified, String.length is used. If the value of startIndex equals the value of endIndex, the method returns an empty string. If the value of startIndex is greater than the value of endIndex, the parameters are automatically swapped before the function executes. The original string is unmodified. startIndex endIndex An integer specifying the index of the first character used to create the substring. Valid values for startIndex are 0 through String.length. If startIndex is a negative value, 0 is used. An integer that is one greater than the index of the last character in the extracted substring. Valid values for endIndex are 0 through String.length. The character at endIndex is not included in the substring. The default is the maximum value allowed for an index. If this parameter is omitted, String.length is used. If this parameter is a negative value, 0 is used."/>
<page href="String.html#toLocaleLowerCase()" title="String.toLocaleLowerCase()" text="toLocaleLowerCase Returns a copy of this string, with all uppercase characters converted to lowercase. The original string is unmodified. While this method is intended to handle the conversion in a locale-specific way, the ActionScript 3.0 implementation does not produce a different result from the toLowerCase() method."/>
<page href="String.html#toLocaleUpperCase()" title="String.toLocaleUpperCase()" text="toLocaleUpperCase Returns a copy of this string, with all lowercase characters converted to uppercase. The original string is unmodified. While this method is intended to handle the conversion in a locale-specific way, the ActionScript 3.0 implementation does not produce a different result from the toUpperCase() method."/>
<page href="String.html#toLowerCase()" title="String.toLowerCase()" text="toLowerCase Returns a copy of this string, with all uppercase characters converted to lowercase. The original string is unmodified. This method converts all characters (not simply A-Z) for which Unicode lowercase equivalents exist: var str:String = &quot; JOSÉ BARÇA&quot;; trace(str.toLowerCase()); // josé barça"/>
<page href="String.html#toUpperCase()" title="String.toUpperCase()" text="toUpperCase Returns a copy of this string, with all lowercase characters converted to uppercase. The original string is unmodified. This method converts all characters (not simply a-z) for which Unicode uppercase equivalents exist: var str:String = &quot;José Barça&quot;; trace(str.toUpperCase()); // JOSÉ BARÇA"/>
<page href="String.html#valueOf()" title="String.valueOf()" text="valueOf Returns the primitive value of a String instance. This method is designed to convert a String object into a primitive string value. Because Flash Player automatically calls valueOf() when necessary, you rarely need to explicitly call this method."/>
<page href="String.html#length" title="String.length" text="length An integer specifying the number of characters in the specified String object. Because all string indexes are zero-based, the index of the last character for any string x is x.length - 1."/>
<page href="Number.html" title="Number class" text="Number A data type representing an IEEE-754 double-precision floating-point number. 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 Number data type adheres to the double-precision IEEE-754 standard. The Number data type is useful when you need to use floating-point values. Flash Player handles int and uint data types more efficiently than Number, but Number is useful in situations where the range of values required exceeds the valid range of the int and uint data types. The Number class can be used to represent integer values well beyond the valid range of the int and uint data types. The Number data type can use up to 53 bits to represent integer values, compared to the 32 bits available to int and uint. The default value of a variable typed as Number is NaN (Not a Number)."/>
<page href="Number.html#Number()" title="Number.Number()" text="Number Creates a Number object with the specified value. This constructor has the same effect as the Number() public native function that converts an object of a different type to a primitive numeric value. num The numeric value of the Number instance being created or a value to be converted to a Number. The default value is 0 if num is not specified. Using the constructor without specifying a num parameter is not the same as declaring a variable of type Number with no value assigned (such as var myNumber:Number), which defaults to NaN. A number with no value assigned is undefined and the equivalent of new Number(undefined)."/>
<page href="Number.html#toExponential()" title="Number.toExponential()" text="toExponential Returns a string representation of the number in exponential notation. The string contains one digit before the decimal point and up to 20 digits after the decimal point, as specified by the fractionDigits parameter. fractionDigits An integer between 0 and 20, inclusive, that represents the desired number of decimal places. The following example shows how toExponential(2) returns a string in exponential notation. var num:Number = 315003; trace(num.toExponential(2)); // 3.15e+5 Throws an exception if the fractionDigits argument is outside the range 0 to 20."/>
<page href="Number.html#toFixed()" title="Number.toFixed()" text="toFixed Returns a string representation of the number in fixed-point notation. Fixed-point notation means that the string will contain a specific number of digits after the decimal point, as specified in the fractionDigits parameter. The valid range for the fractionDigits parameter is from 0 to 20. Specifying a value outside this range throws an exception. fractionDigits An integer between 0 and 20, inclusive, that represents the desired number of decimal places. The following example shows how toFixed(3) returns a string that rounds to three decimal places. var num:Number = 7.31343; trace(num.toFixed(3)); // 7.313 Throws an exception if the fractionDigits argument is outside the range 0 to 20."/>
<page href="Number.html#toPrecision()" title="Number.toPrecision()" text="toPrecision Returns a string representation of the number either in exponential notation or in fixed-point notation. The string will contain the number of digits specified in the precision parameter. precision An integer between 1 and 21, inclusive, that represents the desired number of digits to represent in the resulting string. The following example shows how toPrecision(3) returns a string with only three digits. The string is in fixed-point notation because exponential notation is not required. var num:Number = 31.570; trace(num.toPrecision(3)); // 31.6 Throws an exception if the precision argument is outside the range 1 to 21."/>
<page href="Number.html#toString()" title="Number.toString()" text="toString Returns the string representation of the specified Number object (myNumber). If the value of the Number object is a decimal number without a leading zero (such as .4), Number.toString() adds a leading zero (0.4). radix 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."/>
<page href="Number.html#valueOf()" title="Number.valueOf()" text="valueOf Returns the primitive value type of the specified Number object."/>
<page href="Number.html#MAX_VALUE" title="Number.MAX_VALUE" text="MAX_VALUE The largest representable number (double-precision IEEE-754). This number is approximately 1.79e+308."/>
<page href="Number.html#MIN_VALUE" title="Number.MIN_VALUE" text="MIN_VALUE The smallest representable non-negative, non-zero, number (double-precision IEEE-754). This number is approximately 5e-324. The smallest representable number overall is actually -Number.MAX_VALUE."/>
<page href="Number.html#NaN" title="Number.NaN" text="NaN The IEEE-754 value representing Not a Number (NaN)."/>
<page href="Number.html#NEGATIVE_INFINITY" title="Number.NEGATIVE_INFINITY" text="NEGATIVE_INFINITY Specifies the IEEE-754 value representing negative infinity. The value of this property is the same as that of the constant -Infinity. Negative infinity is a special numeric value that is returned when a mathematical operation or function returns a negative value larger than can be represented."/>
<page href="Number.html#POSITIVE_INFINITY" title="Number.POSITIVE_INFINITY" text="POSITIVE_INFINITY Specifies the IEEE-754 value representing positive infinity. The value of this property is the same as that of the constant Infinity. Positive infinity is a special numeric value that is returned when a mathematical operation or function returns a value larger than can be represented."/>
<page href="Array.html" title="Array class" text="Array The Array class lets you access and manipulate arrays. Array indices 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 new Array() constructor . Array() can also be invoked as a function. In addition, you can use the array access ([]) operator to initialize an array or access the elements of an array. 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. Arrays are sparse arrays, meaning there might be an element at index 0 and another at index 5, but nothing in the index positions between those two elements. In such a case, the elements in positions 1 through 4 are undefined, which indicates the absence of an element, not necessarily the presence of an element with the value undefined. 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. Do not use the Array class to create associative arrays (also called hashes), which are data structures that contain named elements instead of numbered elements. To create associative arrays, use the Object class. Although ActionScript permits you to create associative arrays using the Array class, you cannot use any of the Array class methods or properties with associative arrays. You can extend the Array class and override or add methods. However, you must specify the subclass as dynamic or you will lose the ability to store data in an array."/>
<page href="Array.html#Array()" title="Array.Array()" text="Array Lets you create an array of the specified number of elements. If you don't specify any parameters, an array containing 0 elements is created. If you specify a number of elements, an array is created with numElements number of elements. Note: This class shows two constructor method entries because the constructor accepts variable types of arguments. The constructor behaves differently depending on the type and number of arguments passed, as detailed in each entry. ActionScript 3.0 does not support method or constructor overloading. numElements An integer that specifies the number of elements in the array. The following example creates the Array object myArr with no arguments and an initial length of 0: package { import flash.display.Sprite; public class Array_Array extends Sprite { public function Array_Array() { var myArr:Array = new Array(); trace(myArr.length); // 0 } } } The argument is a number that is not an integer greater than or equal to 0."/>
<page href="Array.html#Array()" title="Array.Array()" text="Array Lets you create an array that contains the specified elements. You can specify values of any type. The first element in an array always has an index (or position) of 0. Note: This class shows two constructor entries because the constructor accepts variable types of arguments. The constructor behaves differently depending on the type and number of arguments passed, as detailed in each entry. ActionSript 3.0 does not support method or constructor overloading. values A comma-separated list of one or more arbitrary values. Note: If only a single numeric parameter is passed to the Array constructor, it is assumed to specify the array's length property. The following example creates a new Array object with an initial length of 3, populates the array with the string elements one, two, and three, and then converts the elements to a string. package { import flash.display.Sprite; public class Array_Array_3 extends Sprite { public function Array_Array_3() { var myArr:Array = new Array(&quot;one&quot;, &quot;two&quot;, &quot;three&quot;); trace(myArr.length); // 3 trace(myArr); // one,two,three } } } The argument is a number that is not an integer greater than or equal to 0."/>
<page href="Array.html#concat()" title="Array.concat()" text="concat Concatenates the elements specified in the parameters with the elements in an array and creates a new array. If the parameters specify an array, the elements of that array are concatenated. args A value of any data type (such as numbers, elements, or strings) to be concatenated in a new array. If you don't pass any values, the new array is a duplicate of the original array. The following code creates four Array objects: The numbers array, which contains the numbers 1, 2, and 3. The letters array, which contains the letters a, b, and c. The numbersAndLetters array, which calls the concat() method to produce the array [1,2,3,a,b,c]. The lettersAndNumbers array, which calls the concat() method to produce the array [a,b,c,1,2,3]. var numbers:Array = new Array(1, 2, 3); var letters:Array = new Array(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;); var numbersAndLetters:Array = numbers.concat(letters); var lettersAndNumbers:Array = letters.concat(numbers); trace(numbers); // 1,2,3 trace(letters); // a,b,c trace(numbersAndLetters); // 1,2,3,a,b,c trace(lettersAndNumbers); // a,b,c,1,2,3"/>
<page href="Array.html#every()" title="Array.every()" text="every Executes a test function on each item in the array until an item is reached that returns false for the specified function. You use this method to determine whether all items in an array meet a criterion, such as having values less than a particular number. For this method, the second parameter, thisObject, must be null if the first parameter, callback, is a method closure. Suppose you create a function in a movie clip called me: function myFunction(obj:Object):void { //your code here } Suppose you then use the every() method on an array called myArray: myArray.every(myFunction, me); Because myFunction is a member of the Timeline class, which cannot be overridden by me, Flash Player will throw an exception. You can avoid this runtime error by assigning the function to a variable, as follows: var myFunction:Function = function(obj:Object):void { //your code here }; myArray.every(myFunction, me); callback thisObject The function to run on each item in the array. This function can contain a simple comparison (for example, item &lt; 20) or a more complex operation, and is invoked with three arguments; the value of an item, the index of an item, and the Array object: function callback(item:*, index:int, array:Array):Boolean; An object to use as this for the function. The following example tests two arrays to determine whether every item in each array is a number. It also outputs the results of the test, showing that isNumeric is true for the first array and false for the second: package { import flash.display.Sprite; public class Array_every extends Sprite { public function Array_every() { var arr1:Array = new Array(1, 2, 4); var res1:Boolean = arr1.every(isNumeric); trace(&quot;isNumeric:&quot;, res1); // true var arr2:Array = new Array(1, 2, &quot;ham&quot;); var res2:Boolean = arr2.every(isNumeric); trace(&quot;isNumeric:&quot;, res2); // false } private function isNumeric(element:*, index:int, arr:Array):Boolean { return (element is Number); } } }"/>
<page href="Array.html#filter()" title="Array.filter()" text="filter Executes a test function on each item in the array and constructs a new array for all items that return true for the specified function. If an item returns false, it is not included in the new array. For this method, the second parameter, thisObject, must be null if the first parameter, callback, is a method closure. Suppose you create a function in a movie clip called me: function myFunction(obj:Object):void { //your code here } Suppose you then use the filter() method on an array called myArray: myArray.filter(myFunction, me); Because myFunction is a member of the Timeline class, which cannot be overridden by me, Flash Player will throw an exception. You can avoid this runtime error by assigning the function to a variable, as follows: var myFunction:Function = function(obj:Object):void { //your code here }; myArray.filter(myFunction, me); callback thisObject The function to run on each item in the array. This function can contain a simple comparison (for example, item &lt; 20) or a more complex operation, and is invoked with three arguments; the value of an item, the index of an item, and the Array object: function callback(item:*, index:int, array:Array):Boolean; An object to use as this for the function. The following example creates an array of all employees who are managers: package { import flash.display.Sprite; public class Array_filter extends Sprite { public function Array_filter() { var employees:Array = new Array(); employees.push({name:&quot;Employee 1&quot;, manager:false}); employees.push({name:&quot;Employee 2&quot;, manager:true}); employees.push({name:&quot;Employee 3&quot;, manager:false}); trace(&quot;Employees:&quot;); employees.forEach(traceEmployee); var managers:Array = employees.filter(isManager); trace(&quot;Managers:&quot;); managers.forEach(traceEmployee); } private function isManager(element:*, index:int, arr:Array):Boolean { return (element.manager == true); } private function traceEmployee(element:*, index:int, arr:Array):void { trace(&quot;\t&quot; + element.name + ((element.manager) ? &quot; (manager)&quot; : &quot;&quot;)); } } }"/>
<page href="Array.html#forEach()" title="Array.forEach()" text="forEach Executes a function on each item in the array. For this method, the second parameter, thisObject, must be null if the first parameter, callback, is a method closure. Suppose you create a function in a movie clip called me: function myFunction(obj:Object):void { //your code here } Suppose you then use the forEach() method on an array called myArray: myArray.forEach(myFunction, me); Because myFunction is a member of the Timeline class, which cannot be overridden by me, Flash Player will throw an exception. You can avoid this runtime error by assigning the function to a variable, as follows: var myFunction:Function = function(obj:Object):void { //your code here }; myArray.forEach(myFunction, me); callback thisObject The function to run on each item in the array. This function can contain a simple command (for example, a trace() statement) or a more complex operation, and is invoked with three arguments; the value of an item, the index of an item, and the Array object: function callback(item:*, index:int, array:Array):void; An object to use as this for the function. The following example runs the trace() statement in the traceEmployee() function on each item in the array: package { import flash.display.Sprite; public class Array_forEach extends Sprite { public function Array_forEach() { var employees:Array = new Array(); employees.push({name:&quot;Employee 1&quot;, manager:false}); employees.push({name:&quot;Employee 2&quot;, manager:true}); employees.push({name:&quot;Employee 3&quot;, manager:false}); trace(employees); employees.forEach(traceEmployee); } private function traceEmployee(element:*, index:int, arr:Array):void { trace(element.name + &quot; (&quot; + element.manager + &quot;)&quot;); } } }"/>
<page href="Array.html#indexOf()" title="Array.indexOf()" text="indexOf Searches for an item in an array by using strict equality (===) and returns the index position of the item. searchElement fromIndex The item to find in the array. The location in the array from which to start searching for the item. The following example displays the position of the specified array: package { import flash.display.Sprite; public class Array_indexOf extends Sprite { public function Array_indexOf() { var arr:Array = new Array(123,45,6789); arr.push(&quot;123-45-6789&quot;); arr.push(&quot;987-65-4321&quot;); var index:int = arr.indexOf(&quot;123&quot;); trace(index); // -1 var index2:int = arr.indexOf(123); trace(index2); // 0 } } }"/>
<page href="Array.html#join()" title="Array.join()" text="join Converts 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. sep 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. The following code creates an Array object myArr with elements one, two, and three and then a string containing one and two and three using the join() method. var myArr:Array = new Array(&quot;one&quot;, &quot;two&quot;, &quot;three&quot;); var myStr:String = myArr.join(&quot; and &quot;); trace(myArr); // one,two,three trace(myStr); // one and two and three"/>
<page href="Array.html#lastIndexOf()" title="Array.lastIndexOf()" text="lastIndexOf Searches for an item in an array, working backward from the last item, and returns the index position of the matching item using strict equality (===). searchElement fromIndex The item to find in the array. The location in the array from which to start searching for the item. The default is the maximum value allowed for an index. If you do not specify fromIndex, the search starts at the last item in the array. The following example displays the position of the specified array: package { import flash.display.Sprite; public class Array_lastIndexOf extends Sprite { public function Array_lastIndexOf() { var arr:Array = new Array(123,45,6789,123,984,323,123,32); var index:int = arr.indexOf(123); trace(index); // 0 var index2:int = arr.lastIndexOf(123); trace(index2); // 6 } } }"/>
<page href="Array.html#map()" title="Array.map()" text="map Executes a function on each item in an array, and constructs a new array of items corresponding to the results of the function on each item in the original array. For this method, the second parameter, thisObject, must be null if the first parameter, callback, is a method closure. Suppose you create a function in a movie clip called me: function myFunction(obj:Object):void { //your code here } Suppose you then use the map() method on an array called myArray: myArray.map(myFunction, me); Because myFunction is a member of the Timeline class, which cannot be overridden by me, Flash Player will throw an exception. You can avoid this runtime error by assigning the function to a variable, as follows: var myFunction:Function = function(obj:Object):void { //your code here }; myArray.map(myFunction, me); callback thisObject The function to run on each item in the array. This function can contain a simple command (such as changing the case of an array of strings) or a more complex operation, and is invoked with three arguments; the value of an item, the index of an item, and the Array object: function callback(item:*, index:int, array:Array):void; An object to use as this for the function. The following example changes all items in the array to use uppercase letters: package { import flash.display.Sprite; public class Array_map extends Sprite { public function Array_map() { var arr:Array = new Array(&quot;one&quot;, &quot;two&quot;, &quot;Three&quot;); trace(arr); // one,two,Three var upperArr:Array = arr.map(toUpper); trace(upperArr); // ONE,TWO,THREE } private function toUpper(element:*, index:int, arr:Array):String { return String(element).toUpperCase(); } } }"/>
<page href="Array.html#pop()" title="Array.pop()" text="pop Removes the last element from an array and returns the value of that element. The following code creates an Array object letters with elements a, b, and c. The last element (c) is then removed from the array using the pop() method and assigned to the String object letter. var letters:Array = new Array(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;); trace(letters); // a,b,c var letter:String = letters.pop(); trace(letters); // a,b trace(letter); // c"/>
<page href="Array.html#push()" title="Array.push()" text="push Adds one or more elements to the end of an array and returns the new length of the array. args One or more values to append to the array. The following code creates an empty Array object letters and then populates the array with the elements a, b, and c using the push() method. var letters:Array = new Array(); letters.push(&quot;a&quot;); letters.push(&quot;b&quot;); letters.push(&quot;c&quot;); trace(letters.toString()); // a,b,c"/>
<page href="Array.html#reverse()" title="Array.reverse()" text="reverse Reverses the array in place. The following code creates an Array object letters with elements a, b, and c. The order of the array elements is then reversed using the reverse() method to produce the array [c,b,a]. var letters:Array = new Array(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;); trace(letters); // a,b,c letters.reverse(); trace(letters); // c,b,a"/>
<page href="Array.html#shift()" title="Array.shift()" text="shift Removes the first element from an array and returns that element. The remaining array elements are moved from their original position, i, to i-1. The following code creates the Array object letters with elements a, b, and c. The shift() method is then used to remove the first element (a) from letters and assign it to the string firstLetter. var letters:Array = new Array(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;); var firstLetter:String = letters.shift(); trace(letters); // b,c trace(firstLetter); // a"/>
<page href="Array.html#slice()" title="Array.slice()" text="slice Returns 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't pass any parameters, a duplicate of the original array is created. startIndex endIndex A number specifying the index of the starting point for the slice. If startIndex is a negative number, the starting point begins at the end of the array, where -1 is the last element. 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 endIndex is a negative number, the ending point is specified from the end of the array, where -1 is the last element. The following code creates an Array object letters with elements [a,b,c,d,e,f]. The array someLetters is then created by calling the slice() method on elements one (b) through three (d), resulting in an array with elements b and c. var letters:Array = new Array(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;d&quot;, &quot;e&quot;, &quot;f&quot;); var someLetters:Array = letters.slice(1,3); trace(letters); // a,b,c,d,e,f trace(someLetters); // b,c"/>
<page href="Array.html#some()" title="Array.some()" text="some Executes a test function on each item in the array until an item is reached that returns true. Use this method to determine whether any items in an array meet a criterion, such as having a value less than a particular number. For this method, the second parameter, thisObject, must be null if the first parameter, callback, is a method closure. Suppose you create a function in a movie clip called me: function myFunction(obj:Object):void { //your code here } Suppose you then use the some() method on an array called myArray: myArray.some(myFunction, me); Because myFunction is a member of the Timeline class, which cannot be overridden by me, Flash Player will throw an exception. You can avoid this runtime error by assigning the function to a variable, as follows: var myFunction:Function = function(obj:Object):void { //your code here }; myArray.some(myFunction, me); callback thisObject The function to run on each item in the array. This function can contain a simple comparison (for example item &lt; 20) or a more complex operation, and is invoked with three arguments; the value of an item, the index of an item, and the Array object: function callback(item:*, index:int, array:Array):Boolean; An object to use as this for the function. The following example displays which values are undefined: package { import flash.display.Sprite; public class Array_some extends Sprite { public function Array_some() { var arr:Array = new Array(); arr[0] = &quot;one&quot;; arr[1] = &quot;two&quot;; arr[3] = &quot;four&quot;; var isUndef:Boolean = arr.some(isUndefined); if (isUndef) { trace(&quot;array contains undefined values: &quot; + arr); } else { trace(&quot;array contains no undefined values.&quot;); } } private function isUndefined(element:*, index:int, arr:Array):Boolean { return (element == undefined); } } }"/>
<page href="Array.html#sort()" title="Array.sort()" text="sort Sorts the elements in an array. This method sorts according to Unicode values. (ASCII is a subset of Unicode.) By default, Array.sort() works in the following way: 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. All elements, regardless of data type, are sorted as if they were strings, so 100 precedes 99, because &quot;1&quot; is a lower string value than &quot;9&quot;. 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 sortOptions portion of the ...args parameter description, or you can create your own custom function to do the sorting. If you create a custom function, you call the sort() method, and use the name of your custom function as the first argument (compareFunction) args The arguments specifying a comparison function and one or more values that determine the behavior of the sort. This method uses the syntax and argument order Array.sort(compareFunction, sortOptions) with the arguments defined as follows: compareFunction - A comparison function used to determine the sorting order of elements in an array. This argument is optional. A comparison function should take two arguments to compare. 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 sequence 0, if A equals B 1, if A should appear after B in the sorted sequence sortOptions - One or more numbers or defined constants, separated by the | (bitwise OR) operator, that change the behavior of the sort from the default. This argument is optional. The following values are acceptable for sortOptions: 1 or Array.CASEINSENSITIVE 2 or Array.DESCENDING 4 or Array.UNIQUESORT 8 or Array.RETURNINDEXEDARRAY 16 or Array.NUMERIC For more information, see the Array.sortOn() method. The following code creates the Array object vegetables with elements [spinach, green pepper, cilantro, onion, avocado]. The array is then sorted by the sort() method, which is called with no parameters. The result is vegetables sorted in alphabetical order ([avocado, cilantro, green pepper, onion, spinach]). var vegetables:Array = new Array(&quot;spinach&quot;, &quot;green pepper&quot;, &quot;cilantro&quot;, &quot;onion&quot;, &quot;avocado&quot;); trace(vegetables); // spinach,green pepper,cilantro,onion,avocado vegetables.sort(); trace(vegetables); // avocado,cilantro,green pepper,onion,spinach"/>
<page href="Array.html#sortOn()" title="Array.sortOn()" text="sortOn Sorts 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 that is specified in the fieldName parameter, the field is assumed to be set to undefined, and the elements are placed consecutively in the sorted array in no particular order. By default, Array.sortOn() works in the following way: 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;. Flash Player 7 added the options parameter, which you can use to override the default sort behavior. To sort a simple array (for example, an array with only one field), or to specify a sort order that the options parameter doesn't support, use Array.sort(). To pass multiple flags, separate them with the bitwise OR (|) operator: my_array.sortOn(someFieldName, Array.DESCENDING | Array.NUMERIC); Flash Player 8 added the ability to specify a different sorting option for each field when you sort by more than one field. In Flash Player 8 and later, the options parameter accepts an array of sort options such that each sort option corresponds to a sort field in the fieldName parameter. The following example sorts the primary sort field, a, using a descending sort; the secondary sort field, b, using a numeric sort; and the tertiary sort field, c, using a case-insensitive sort: Array.sortOn ([&quot;a&quot;, &quot;b&quot;, &quot;c&quot;], [Array.DESCENDING, Array.NUMERIC, Array.CASEINSENSITIVE]); Note: The fieldName and options arrays must have the same number of elements; otherwise, the options array is ignored. Also, the Array.UNIQUESORT and Array.RETURNINDEXEDARRAY options can be used only as the first element in the array; otherwise, they are ignored. fieldName options 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. 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 1 Array.DESCENDING or 2 Array.UNIQUESORT or 4 Array.RETURNINDEXEDARRAY or 8 Array.NUMERIC or 16 Code hinting is enabled if you use the string form of the flag (for example, DESCENDING) rather than the numeric form (2). The following code creates an empty Array object vegetables and the array is then populated using five calls to push(). Each time push() is called, a new Vegetable object is created by calling the Vegetable() constructor, which accepts a String (name) and Number (price) object. Calling push() five times with the values shown results in the following array: [lettuce:1.49, spinach:1.89, asparagus:3.99, celery:1.29, squash:1.44]. The sortOn() method is then used with the name parameter to produce the following array: [asparagus:3.99, celery:1.29, lettuce:1.49, spinach:1.89, squash:1.44]. The sortOn() method is then called again with the price parameter, and the NUMERIC and DESCENDING constants to produce an array sorted by numbers in descending order: [asparagus:3.99, spinach:1.89, lettuce:1.49, squash:1.44, celery:1.29]. var vegetables:Array = new Array(); vegetables.push(new Vegetable(&quot;lettuce&quot;, 1.49)); vegetables.push(new Vegetable(&quot;spinach&quot;, 1.89)); vegetables.push(new Vegetable(&quot;asparagus&quot;, 3.99)); vegetables.push(new Vegetable(&quot;celery&quot;, 1.29)); vegetables.push(new Vegetable(&quot;squash&quot;, 1.44)); trace(vegetables); // lettuce:1.49, spinach:1.89, asparagus:3.99, celery:1.29, squash:1.44 vegetables.sortOn(&quot;name&quot;); trace(vegetables); // asparagus:3.99, celery:1.29, lettuce:1.49, spinach:1.89, squash:1.44 vegetables.sortOn(&quot;price&quot;, Array.NUMERIC | Array.DESCENDING); trace(vegetables); // asparagus:3.99, spinach:1.89, lettuce:1.49, squash:1.44, celery:1.29 class Vegetable { public var name:String; public var price:Number; public function Vegetable(name:String, price:Number) { this.name = name; this.price = price; } public function toString():String { return &quot; &quot; + name + &quot;:&quot; + price; } }"/>
<page href="Array.html#splice()" title="Array.splice()" text="splice Adds elements to and removes elements from an array. This method modifies the array without making a copy. Note: To override this method in a subclass of Array, use ...args for the parameters, as this example shows: public override function splice(...args) { // your statements here } startIndex deleteCount values An integer that specifies the index of the element in the array where the insertion or deletion begins. You can use a negative integer to specify a position relative to the end of the array (for example, -1 is the last element of the array). An integer that specifies the number of elements to be deleted. This number includes the element specified in the startIndex parameter. If you do not specify a value 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. An optional list of one or more comma-separated values, or an array, to insert into the array at the position specified in the startIndex parameter. The following code creates the Array object vegetables with the elements [spinach, green pepper, cilantro, onion, avocado]. The splice() method is then called with the parameters 2 and 2, which assigns cilantro and onion to the spliced array. The vegetables array then contains [spinach,green pepper,avocado]. The splice() method is called a second time using the parameters 1, 0, and the spliced array to assign [cilantro,onion] as the second element in vegetables. var vegetables:Array = new Array(&quot;spinach&quot;, &quot;green pepper&quot;, &quot;cilantro&quot;, &quot;onion&quot;, &quot;avocado&quot;); var spliced:Array = vegetables.splice(2, 2); trace(vegetables); // spinach,green pepper,avocado trace(spliced); // cilantro,onion vegetables.splice(1, 0, spliced); trace(vegetables); // spinach,cilantro,onion,green pepper,avocado"/>
<page href="Array.html#toLocaleString()" title="Array.toLocaleString()" text="toLocaleString Returns a string that represents the elements in the specified array. 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. In the ActionScript 3.0 implementation, this method returns the same value as the Array.toString() method."/>
<page href="Array.html#toString()" title="Array.toString()" text="toString Returns a string that represents the elements in the specified array. 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. The following code creates an Array, converts the values to strings, and stores them in the vegnums variable of the String data type. var vegetables:Array = new Array(); vegetables.push(1); vegetables.push(2); vegetables.push(3); vegetables.push(4); vegetables.push(5); var vegnums:String = vegetables.toString(); trace(vegnums+&quot;,6&quot;); // 1,2,3,4,5,6"/>
<page href="Array.html#unshift()" title="Array.unshift()" text="unshift Adds one or more elements to the beginning of an array and returns the new length of the array. The other elements in the array are moved from their original position, i, to i+1. args One or more numbers, elements, or variables to be inserted at the beginning of the array. The following code creates the empty Array object names. The strings Bill and Jeff are added by the push() method, and then the strings Alfred and Kyle are added to the beginning of names by two calls to the unshift() method. var names:Array = new Array(); names.push(&quot;Bill&quot;); names.push(&quot;Jeff&quot;); trace(names); // Bill,Jeff names.unshift(&quot;Alfred&quot;); names.unshift(&quot;Kyle&quot;); trace(names); // Kyle,Alfred,Bill,Jeff"/>
<page href="Array.html#CASEINSENSITIVE" title="Array.CASEINSENSITIVE" text="CASEINSENSITIVE Specifies case-insensitive sorting for the Array class sorting methods. You can use this constant for the options parameter in the sort() or sortOn() method. The value of this constant is 1."/>
<page href="Array.html#DESCENDING" title="Array.DESCENDING" text="DESCENDING Specifies descending sorting for the Array class sorting methods. You can use this constant for the options parameter in the sort() or sortOn() method. The value of this constant is 2."/>
<page href="Array.html#length" title="Array.length" text="length A 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. The following code creates an Array object names with the string element Bill. It then uses the push() method to add another string element Kyle. The length of the array, as determined by the length property, was one element before the use of push() and is two elements after push() is called. Another string, Jeff, is added to make the length of names three elements. The shift() method is then called twice to remove Bill and Kyle, making the final array of length one. var names:Array = new Array(&quot;Bill&quot;); names.push(&quot;Kyle&quot;); trace(names.length); // 2 names.push(&quot;Jeff&quot;); trace(names.length); // 3 names.shift(); names.shift(); trace(names.length); // 1"/>
<page href="Array.html#NUMERIC" title="Array.NUMERIC" text="NUMERIC Specifies numeric (instead of character-string) sorting for the Array class sorting methods. Including this constant in the options parameter causes the sort() and sortOn() methods to sort numbers as numeric values, not as strings of numeric characters. Without the NUMERIC constant, sorting treats each array element as a character string and produces the results in Unicode order. For example, given the array of values [2005, 7, 35], if the NUMERIC constant is not included in the options parameter, the sorted array is [2005, 35, 7], but if the NUMERIC constant is included, the sorted array is [7, 35, 2005]. This constant applies only to numbers in the array; it does not apply to strings that contain numeric data such as [&quot;23&quot;, &quot;5&quot;]. The value of this constant is 16."/>
<page href="Array.html#RETURNINDEXEDARRAY" title="Array.RETURNINDEXEDARRAY" text="RETURNINDEXEDARRAY Specifies that a sort returns an array that consists of array indices. You can use this constant for the options parameter in the sort() or sortOn() method, so you have access to multiple views of the array elements while the original array is unmodified. The value of this constant is 8."/>
<page href="Array.html#UNIQUESORT" title="Array.UNIQUESORT" text="UNIQUESORT Specifies the unique sorting requirement for the Array class sorting methods. You can use this constant for the options parameter in the sort() or sortOn() method. The unique sorting option terminates the sort if any two elements or fields being sorted have identical values. The value of this constant is 4."/>
<page href="TypeError.html" title="TypeError class" text="TypeError A TypeError exception is thrown when the actual type of an operand is different from the expected type. In addition, this exception is thrown when: An actual parameter to a function or method could not be coerced to the formal parameter type. A value is assigned to a variable and cannot be coerced to the variable's type. The right side of the is or instanceof operator is not a valid type. The super keyword is used illegally. A property lookup results in more than one binding, and is therefore ambiguous. A method is invoked on an incompatible object. For example, a TypeError exception is thrown if a RegExp class method is &quot;grafted&quot; onto a generic object and then invoked."/>
<page href="TypeError.html#TypeError()" title="TypeError.TypeError()" text="TypeError Creates a new TypeError object. message Contains the message associated with the TypeError object."/>
<page href="Date.html" title="Date class" text="Date The Date class represents date and time information. An instance of the Date class represents a particular point in time for which the properties such as month, day, hours, and seconds can be queried or modified. The 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 local time, which is determined by the local time zone setting on the operating system that is running Flash Player. 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() and Date.parse() methods are exceptions; they are static methods. 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 use the Date class, construct a Date instance using the new operator. ActionScript 3.0 adds several new accessor properties that can be used in place of many Date class methods that access or modify Date instances. ActionScript 3.0 also includes several new variations of the toString() method that are included for ECMA-262 3rd Edition compliance, including: Date.toLocaleString(), Date.toTimeString(), Date.toLocaleTimeString(), Date.toDateString(), and Date.toLocaleDateString(). To compute relative time or time elapsed, see the getTimer() method in the flash.utils package."/>
<page href="Date.html#Date()" title="Date.Date()" text="Date 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. The date that the newly constructed Date object contains depends on the number, and data type, of arguments passed. If you pass no arguments, the Date object is assigned the current date and time. If you pass one argument of data type Number, the Date object is assigned a time value based on the number of milliseconds since January 1, 1970 0:00:000 GMT, as specified by the lone argument. If you pass one argument of data type String, and the string contains a valid date, the Date object contains a time value based on that date. If you pass two or more arguments, the Date object is assigned a time value based on the argument values passed, which represent the date's year, month, date, hour, minute, second, and milliseconds. If you pass a string to the Date class constructor, the date can be in a variety of formats, but must at least include the month, date, and year. For example, Feb 1 2005 is valid, but Feb 2005 is not. The following list indicates some of the valid formats: Day Month Date Hours:Minutes:Seconds GMT Year (for instance, &quot;Tue Feb 1 00:00:00 GMT-0800 2005&quot;, which matches toString()) Day Month Date Year Hours:Minutes:Seconds AM/PM (for instance, &quot;Tue Feb 1 2005 12:00:00 AM&quot;, which matches toLocaleString()) Day Month Date Year (for instance, &quot;Tue Feb 1 2005&quot;, which matches toDateString()) Month/Day/Year (for instance, &quot;02/01/2005&quot;) yearOrTimevalue month date hour minute second millisecond 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. An integer from 0 (January) to 11 (December). An integer from 1 to 31. An integer from 0 (midnight) to 23 (11 p.m.). An integer from 0 to 59. An integer from 0 to 59. An integer from 0 to 999 of milliseconds."/>
<page href="Date.html#getDate()" title="Date.getDate()" text="getDate Returns the day of the month (an integer from 1 to 31) specified by a Date object according to local time. Local time is determined by the operating system on which Flash Player is running. The following example creates a new Date object someBirthday with parameters year (1974), month (10 = November), day (30), hour (1) and minute (20). The getDate() method is then called, which retrieves the day of the month. package { import flash.display.Sprite; public class DateExample extends Sprite { public function DateExample() { var someBirthday:Date = new Date(1974, 10, 30, 1, 20); trace(someBirthday); // Sat Nov 30 01:20:00 GMT-0800 1974 trace(someBirthday.getDate()); // 30 } } }"/>
<page href="Date.html#getDay()" title="Date.getDay()" text="getDay Returns the day of the week (0 for Sunday, 1 for Monday, and so on) specified by this Date according to local time. Local time is determined by the operating system on which Flash Player is running. The following example creates a new Array object weekDayLabels, with elements [Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday] and a new Date object someBirthday with parameters year (1974), month (10 = November), day (30), hour (1) and minute (20). The getDay() method is then called twice, which first shows the day of the month as 6 and then shows the day of the week using weekDayLabels. var weekDayLabels: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 someBirthday:Date = new Date(1974, 10, 30, 1, 20); trace(someBirthday); // Sat Nov 30 01:20:00 GMT-0800 1974 trace(someBirthday.getDay()); // 6 trace(weekDayLabels[someBirthday.getDay()]); // Saturday"/>
<page href="Date.html#getFullYear()" title="Date.getFullYear()" text="getFullYear Returns the full year (a four-digit number, such as 2000) of a Date object according to local time. Local time is determined by the operating system on which Flash Player is running. The following example creates a new Date object someBirthday with parameters year (1974), month (10 = November), day (30), hour (1) and minute (20). The getFullYear() method is then called, which retrieves the four-digit year. var someBirthday:Date = new Date(1974, 10, 30, 1, 20); trace(someBirthday); // Sat Nov 30 01:20:00 GMT-0800 1974 trace(someBirthday.getFullYear()); // 1974"/>
<page href="Date.html#getHours()" title="Date.getHours()" text="getHours Returns the hour (an integer from 0 to 23) of the day portion of a Date object according to local time. Local time is determined by the operating system on which Flash Player is running. The following example creates a new Date object someBirthday with parameters year (1974), month (10 = November), day (30), hour (1) and minute (20). The getHours() and getMinutes() methods are then called, which retrieves the hours and the minutes in 24-hour format. Finally, a string localTime is created and assigned to the result of a call to the function getUSClockTime(), which, in turn calls getHours() and getMinutes() again, resulting in the time 03:05 PM. var someBirthday:Date = new Date(1974, 10, 30, 15, 5); trace(someBirthday); // Sat Nov 30 15:20:00 GMT-0800 1974 trace(someBirthday.getHours() + &quot;:&quot; + someBirthday.getMinutes()); // 15:5 var localTime:String = getUSClockTime(someBirthday.getHours(), someBirthday.getMinutes()); trace(localTime); // 03:05 PM function getUSClockTime(hrs:uint, mins:uint):String { var modifier:String = &quot;PM&quot;; var minLabel:String = doubleDigitFormat(mins); if(hrs &gt; 12) { hrs = hrs-12; } else if(hrs == 0) { modifier = &quot;AM&quot;; hrs = 12; } else if(hrs &lt; 12) { modifier = &quot;AM&quot;; } return (doubleDigitFormat(hrs) + &quot;:&quot; + minLabel + &quot; &quot; + modifier); } function doubleDigitFormat(num:uint):String { if(num &lt; 10) { return (&quot;0&quot; + num); } return num; }"/>
<page href="Date.html#getMilliseconds()" title="Date.getMilliseconds()" text="getMilliseconds Returns the milliseconds (an integer from 0 to 999) portion of a Date object according to local time. Local time is determined by the operating system on which Flash Player is running. The following example creates a new Date object now with no parameters. The getMilliseconds() method is then called, which retrieves the milliseconds of the Date object now at the time it was created. var now:Date = new Date(); trace(now.getMilliseconds());"/>
<page href="Date.html#getMinutes()" title="Date.getMinutes()" text="getMinutes Returns the minutes (an integer from 0 to 59) portion of a Date object according to local time. Local time is determined by the operating system on which Flash Player is running. The following example creates a new Date object now with no parameters. The getMinutes() method is then called, which retrieves the minutes of the Date object now at the time it was created. var now:Date = new Date(); trace(now); trace(now.getMinutes());"/>
<page href="Date.html#getMonth()" title="Date.getMonth()" text="getMonth Returns the month (0 for January, 1 for February, and so on) portion of this Date according to local time. Local time is determined by the operating system on which Flash Player is running. The following example creates a new Array object monthLabels, with elements January through December and a new Date object now with no parameters. The getMonth() method is then called twice, which first returns the month number and then the month name of the month the Date object now was created. var monthLabels: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;); var now:Date = new Date(); trace(now.getMonth()); trace(monthLabels[now.getMonth()]);"/>
<page href="Date.html#getSeconds()" title="Date.getSeconds()" text="getSeconds Returns the seconds (an integer from 0 to 59) portion of a Date object according to local time. Local time is determined by the operating system on which Flash Player is running. The following example creates a new Date object now with no parameters. The getSeconds() method is then called, which retrieves the seconds of the Date object now at the time it was created. var now:Date = new Date(); trace(now.getSeconds());"/>
<page href="Date.html#getTime()" title="Date.getTime()" text="getTime Returns the number of milliseconds since midnight January 1, 1970, universal time, for a Date object. Use this method to represent a specific instant in time when comparing two or more Date objects. Note: The getTime() method incorporates leap years so your Date arithmetic doesn't require additional logic for leap year changes. The following example creates a new Date object mlk with parameters year (1929), month (0 = January), and day (15). The getTime() method is then called, which retrieves the milliseconds since midnight January 1, 1970, which is negative since the year is set to 1929. var mlk:Date = new Date(1929, 0, 15); trace(mlk); // Tue Jan 15 00:00:00 GMT-0800 1929 trace(mlk.getTime()); // -1292601600000"/>
<page href="Date.html#getTimezoneOffset()" title="Date.getTimezoneOffset()" text="getTimezoneOffset Returns the difference, in minutes, between universal time (UTC) and the computer's local time. The following example creates a new Date object now with no parameters. The getTimezoneOffset() method is then called, which retrieves the difference (in minutes) of the time now was created and Universal Time. The time zone offset is then converted to hours by dividing the result by 60. var date:Date = new Date(); trace(date.getTimezoneOffset() / 60);"/>
<page href="Date.html#getUTCDate()" title="Date.getUTCDate()" text="getUTCDate Returns the day of the month (an integer from 1 to 31) of a Date object, according to universal time (UTC). The following example creates a new Date object someBirthday with parameters year (1974), month (10 = November), day (30), hour (1) and minute (20). The getUTCDate() method is then called, which retrieves the day of the month, according to the UTC. var someBirthday:Date = new Date(1974, 10, 30, 1, 20); trace(someBirthday); // Sat Nov 30 01:20:00 GMT-0800 1974 trace(someBirthday.getUTCDate()); // 30"/>
<page href="Date.html#getUTCDay()" title="Date.getUTCDay()" text="getUTCDay Returns the day of the week (0 for Sunday, 1 for Monday, and so on) of this Date according to universal time (UTC). The following example creates a new Array object weekDayLabels, with elements [Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday] and a new Date object someBirthday with parameters year (1974), month (10 = November), day (30), hour (1) and minute (20). The getUTCDay() method is then called twice, which first shows the day of the month as 6 and then shows the day of the week using weekDayLabels, according to the UTC. var weekDayLabels: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 someBirthday:Date = new Date(1974, 10, 30, 1, 20); trace(someBirthday); // Sat Nov 30 01:20:00 GMT-0800 1974 trace(someBirthday.getUTCDay()); // 6 trace(weekDayLabels[someBirthday.getUTCDay()]); // Saturday"/>
<page href="Date.html#getUTCFullYear()" title="Date.getUTCFullYear()" text="getUTCFullYear Returns the four-digit year of a Date object according to universal time (UTC). The following example creates a new Date object someBirthday with parameters year (1974), month (10 = November), day (30), hour (1) and minute (20). The getUTCFullYear() method is then called, which retrieves the four-digit year, according to the UTC. var someBirthday:Date = new Date(1974, 10, 30, 1, 20); trace(someBirthday); // Sat Nov 30 01:20:00 GMT-0800 1974 trace(someBirthday.getUTCFullYear()); // 1974"/>
<page href="Date.html#getUTCHours()" title="Date.getUTCHours()" text="getUTCHours Returns the hour (an integer from 0 to 23) of the day of a Date object according to universal time (UTC). The following example creates a new Date object someBirthday with parameters year (1974), month (10 = November), day (30), hour (1) and minute (20). The getHours() and getMinutes() methods are then called, which retrieves the hours and the minutes in 24-hour format. Finally, a string localTime is created and assigned to the result of a call to the function getUSClockTime(), which, in turn calls getHours() and getMinutes() again, resulting in the time 03:05 PM. Lastly, a String variable utcTime is created in the same manner as localTime, and in this case, the result is the same. var someBirthday:Date = new Date(1974, 10, 30, 15, 5); trace(someBirthday); // Sat Nov 30 15:20:00 GMT-0800 1974 trace(someBirthday.getHours() + &quot;:&quot; + someBirthday.getMinutes()); // 15:5 var localTime:String = getUSClockTime(someBirthday.getHours(), someBirthday.getMinutes()); trace(localTime); // 03:05 PM var utcTime:String = getUSClockTime(someBirthday.getUTCHours(), someBirthday.getUTCMinutes()); trace(utcTime); // 11:05 PM function getUSClockTime(hrs:uint, mins:uint):String { var modifier:String = &quot;PM&quot;; var minLabel:String = doubleDigitFormat(mins); if(hrs &gt; 12) { hrs = hrs-12; } else if(hrs == 0) { modifier = &quot;AM&quot;; hrs = 12; } else if(hrs &lt; 12) { modifier = &quot;AM&quot;; } return (doubleDigitFormat(hrs) + &quot;:&quot; + minLabel + &quot; &quot; + modifier); } function doubleDigitFormat(num:uint):String { if(num &lt; 10) { return (&quot;0&quot; + num); } return num; }"/>
<page href="Date.html#getUTCMilliseconds()" title="Date.getUTCMilliseconds()" text="getUTCMilliseconds Returns the milliseconds (an integer from 0 to 999) portion of a Date object according to universal time (UTC). The following example creates a new Date object now with no parameters. The getUTCMilliseconds() method is then called, which retrieves the milliseconds of the Date object now at the time it was created, according to the UTC var now:Date = new Date(); trace(now.getUTCMilliseconds());"/>
<page href="Date.html#getUTCMinutes()" title="Date.getUTCMinutes()" text="getUTCMinutes Returns the minutes (an integer from 0 to 59) portion of a Date object according to universal time (UTC). The following example creates a new Date object now with no parameters. The getUTCMinutes() method is then called, which retrieves the minutes of the Date object now at the time it was created, according to the UTC var now:Date = new Date(); trace(now.getUTCMinutes());"/>
<page href="Date.html#getUTCMonth()" title="Date.getUTCMonth()" text="getUTCMonth Returns the month (0 [January] to 11 [December]) portion of a Date object according to universal time (UTC). The following example creates a new Array object monthLabels, with elements January through December and a new Date object now with no parameters. The getUTCMonth() method is then called twice, which first returns the month number and then the month name of the month the Date object now was created, according to the UTC var monthLabels: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;); var now:Date = new Date(); trace(now.getMonth()); trace(now.getUTCMonth()); trace(monthLabels[now.getUTCMonth()]);"/>
<page href="Date.html#getUTCSeconds()" title="Date.getUTCSeconds()" text="getUTCSeconds Returns the seconds (an integer from 0 to 59) portion of a Date object according to universal time (UTC). The following example creates a new Date object now with no parameters. The getUTCSeconds() method is then called, which retrieves the seconds of the Date object now at the time it was created, according to the UTC var now:Date = new Date(); trace(now.getUTCSeconds());"/>
<page href="Date.html#parse()" title="Date.parse()" text="parse Converts a string representing a date into a number equaling the number of milliseconds elapsed since January 1, 1970, UTC. date A string representation of a date, which conforms to the format for the output of Date.toString(). The date format for the output of Date.toString() is: Day Mon DD HH:MM:SS TZD YYYY For example: Wed Apr 12 15:30:17 GMT-0700 2006 The Time Zone Designation (TZD) is always in the form GMT-HHMM or UTC-HHMM indicating the hour and minute offset relative to Greenwich Mean Time (GMT), which is now also called universal time (UTC). The year month and day terms can be separated by a forward slash (/) or by spaces, but never by a dash (-). Other supported formats include the following (you can include partial representations of these formats; that is, just the month, day, and year): MM/DD/YYYY HH:MM:SS TZD HH:MM:SS TZD Day Mon/DD/YYYY Mon DD YYYY HH:MM:SS TZD Day Mon DD HH:MM:SS TZD YYYY Day DD Mon HH:MM:SS TZD YYYY Mon/DD/YYYY HH:MM:SS TZD YYYY/MM/DD HH:MM:SS TZD The following example assigns a date string to dateParsed for November 30, 1974. The Date.parse() method is then called, which converts the date into milliseconds since January 1, 1970. var dateParsed:String = &quot;Sat Nov 30 1974&quot;; var milliseconds:Number = Date.parse(dateParsed); trace(milliseconds); // 155030400000"/>
<page href="Date.html#setDate()" title="Date.setDate()" text="setDate Sets the day of the month, 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. day An integer from 1 to 31. The following example creates a new Date object someBirthday with parameters year (1974), month (10 = November), day (30), hour (1) and minute (20). The method getDate() is then called, which retrieves the day of the month. Next setDate() is called with the day parameter set to 20 and then getDate() is called again, which retrieves the newly set day of month. var someBirthday:Date = new Date(1974, 10, 30, 1, 20); trace(someBirthday); // Sat Nov 30 01:20:00 GMT-0800 1974 trace(someBirthday.getDate()); // 30 someBirthday.setDate(20); trace(someBirthday.getDate()); // 20"/>
<page href="Date.html#setFullYear()" title="Date.setFullYear()" text="setFullYear Sets the year, according to local time, and returns the new time in milliseconds. If the month and day 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 Date 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. year month day 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. An integer from 0 (January) to 11 (December). A number from 1 to 31. The following example creates a new Date object someBirthday with parameters year (1974), month (10 = November), day (30), hour (1) and minute (20). The method getFullYear() is then called, which retrieves the four-digit year. Next setFullYear() is called with the year parameter set to 2000 and then getFullYear() is called again, which retrieves the newly set year. var someBirthday:Date = new Date(1974, 10, 30, 1, 20); trace(someBirthday); // Sat Nov 30 01:20:00 GMT-0800 1974 trace(someBirthday.getFullYear()); // 1974 someBirthday.setFullYear(2000); trace(someBirthday.getFullYear()); // 2000"/>
<page href="Date.html#setHours()" title="Date.setHours()" text="setHours Sets the hour, 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. hour minute second millisecond An integer from 0 (midnight) to 23 (11 p.m.). An integer from 0 to 59. An integer from 0 to 59. An integer from 0 to 999. The following example creates a new Date object someBirthday with parameters year (1974), month (10 = November), day (30), hour (1) and minute (20). The methods getHours() and getMinutes() are then called, which retrieves the hours and minutes. Next setHours() is called with the hour parameter set to 12 and then getHours() and getMinutes() are called again, which retrieves the newly set hours and minutes. var someBirthday:Date = new Date(1974, 10, 30, 15, 20); trace(someBirthday); // Sat Nov 30 15:20:00 GMT-0800 1974 trace(someBirthday.getHours() + &quot;:&quot; + someBirthday.getMinutes()); // 15:20 someBirthday.setHours(12); trace(someBirthday.getHours() + &quot;:&quot; + someBirthday.getMinutes()); // 12:20"/>
<page href="Date.html#setMilliseconds()" title="Date.setMilliseconds()" text="setMilliseconds Sets the milliseconds, 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. millisecond An integer from 0 to 999. The following example creates a new Date object now with no parameters. The method getMilliseconds() is then called, which retrieves the milliseconds when now was created. Then another new Date object before with an additional call to setMilliseconds() with the millisecond parameter set to 4 and getMilliseconds() is called again, which retrieves the newly set milliseconds. var now:Date = new Date(); trace(now); trace(now.getMilliseconds()); var before:Date = new Date(now.setMilliseconds(4)); trace(before); trace(before.getMilliseconds());"/>
<page href="Date.html#setMinutes()" title="Date.setMinutes()" text="setMinutes Sets the minutes, 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. minute second millisecond An integer from 0 to 59. An integer from 0 to 59. An integer from 0 to 999. The following example creates a new Date object now with no parameters. The method getMinutes() is then called, which retrieves the minutes when now was created. Then another new Date object before with an additional call to setMinutes() with the minute parameter set to 0 and getMinutes() is called again, which retrieves the newly set minutes. var now:Date = new Date(); trace(now); trace(now.getMinutes()); var before:Date = new Date(now.setMinutes(0)); trace(before); trace(before.getMinutes());"/>
<page href="Date.html#setMonth()" title="Date.setMonth()" text="setMonth Sets the month and optionally the day of the month, 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. month day An integer from 0 (January) to 11 (December). An integer from 1 to 31. The following example creates a new Array object monthLabels, with elements January through December and a new month object now with no parameters. The method getMonth() is then called, which retrieves the month in which now was created. Next setMonth() is called with the month parameter set to 0 and then getMonth() is called again, which retrieves the newly set month. var monthLabels: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;); var now:Date = new Date(); trace(now.getMonth()); trace(monthLabels[now.getMonth()]); now.setMonth(0); trace(now.getMonth()); // 0 trace(monthLabels[now.getMonth()]); // January"/>
<page href="Date.html#setSeconds()" title="Date.setSeconds()" text="setSeconds Sets the seconds, 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. second millisecond An integer from 0 to 59. An integer from 0 to 999. The following example creates a new Date object now with no parameters. The method getseconds() is then called, which retrieves the seconds when now was created. Then the setSeconds() is called with the second parameter set to 0 and getSeconds() is called again, which retrieves the newly set seconds. var now:Date = new Date(); trace(now.getSeconds()); now.setSeconds(0); trace(now.getSeconds()); // 0"/>
<page href="Date.html#setTime()" title="Date.setTime()" text="setTime Sets the date in milliseconds since midnight on January 1, 1970, and returns the new time in milliseconds. millisecond An integer value where 0 is midnight on January 1, universal time (UTC). The following example creates a new Date object now with no parameters. The setTime() method is then called, with the millisecond parameter set to -1292601600000, which sets the time to Tue Jan 15 00:00:00 GMT-0800 1929. var now:Date = new Date(); trace(now); now.setTime(-1292601600000); trace(now); // Tue Jan 15 00:00:00 GMT-0800 1929"/>
<page href="Date.html#setUTCDate()" title="Date.setUTCDate()" text="setUTCDate Sets the day of the month, in universal time (UTC), and returns the new time in milliseconds. Calling this method does not modify the other fields of a Date object, but the Date.getUTCDay() and Date.getDay() methods can report a new value if the day of the week changes as a result of calling this method. day A number; an integer from 1 to 31. The following example creates a new Date object someBirthday with parameters year (1974), month (10 = November), day (30), hour (1) and minute (20). The method getUTCDate() is called and correctly returns the day of the month. Next setUTCDate() is called with the day parameter set to 1 and a trace() statement confirms the date was correctly set. var someBirthday:Date = new Date(1974, 10, 30, 1, 20); trace(someBirthday); // Sat Nov 30 01:20:00 GMT-0800 1974 trace(someBirthday.getUTCDate()); // 30 someBirthday.setUTCDate(1); trace(someBirthday); // Fri Nov 1 01:20:00 GMT-0800 1974"/>
<page href="Date.html#setUTCFullYear()" title="Date.setUTCFullYear()" text="setUTCFullYear Sets the year, in universal time (UTC), and returns the new time in milliseconds. Optionally, this method can also set the month and day of the month. Calling this method does not modify the other fields, but the Date.getUTCDay() and Date.getDay() methods can report a new value if the day of the week changes as a result of calling this method. year month day An integer that represents the year specified as a full four-digit year, such as 2000. An integer from 0 (January) to 11 (December). An integer from 1 to 31. The following example creates a new Date object someBirthday with parameters year (1974), month (10 = November), day (30), hour (1) and minute (20). The method getUTCFullYear() is called and correctly returns the four-digit year. Next setUTCFullYear() is called with the year parameter set to 1975 and a trace() statement confirms the year was correctly set. var someBirthday:Date = new Date(1974, 10, 30, 1, 20); trace(someBirthday); // Sat Nov 30 01:20:00 GMT-0800 1974 trace(someBirthday.getUTCFullYear()); // 1974 someBirthday.setUTCFullYear(1975); trace(someBirthday); // Thu Nov 30 01:20:00 GMT-0800 1975"/>
<page href="Date.html#setUTCHours()" title="Date.setUTCHours()" text="setUTCHours Sets the hour, in universal time (UTC), and returns the new time in milliseconds. Optionally, the minutes, seconds, and milliseconds can be specified. hour minute second millisecond An integer from 0 (midnight) to 23 (11 p.m.). An integer from 0 to 59. An integer from 0 to 59. An integer from 0 to 999. The following example creates a new Date object someBirthday with parameters year (1974), month (10 = November), day (30), hour (1) and minute (20). The methods getHours(), getMinutes(), getUTCHours(), and getUTCMinutes() are then called, which retrieves the hours and minutes. Next setUTCHours() is called with the hour parameter set to 12 and then the methods getHours(), getMinutes(), getUTCHours(), and getUTCMinutes() are re-called and correctly display the updated hour. var someBirthday:Date = new Date(1974, 10, 30, 15, 20); trace(someBirthday); // Sat Nov 30 15:20:00 GMT-0800 1974 trace(someBirthday.getHours() + &quot;:&quot; + someBirthday.getMinutes()); // 15:20 trace(someBirthday.getUTCHours() + &quot;:&quot; + someBirthday.getUTCMinutes()); // 23:20 someBirthday.setUTCHours(12); trace(someBirthday.getHours() + &quot;:&quot; + someBirthday.getMinutes()); // 4:20 trace(someBirthday.getUTCHours() + &quot;:&quot; + someBirthday.getUTCMinutes()); // 12:20"/>
<page href="Date.html#setUTCMilliseconds()" title="Date.setUTCMilliseconds()" text="setUTCMilliseconds Sets the milliseconds, in universal time (UTC), and returns the new time in milliseconds. millisecond An integer from 0 to 999. The following example creates a new Date object now with no parameters. The method getUTCMilliseconds() is then called, which retrieves the UTCMilliseconds when now was created. Then another new Date object before with an additional call to setUTCMilliseconds() with the millisecond parameter set to 4 and getUTCMilliseconds() is called again, which retrieves the newly set milliseconds. var now:Date = new Date(); trace(now); trace(now.getUTCMilliseconds()); var before:Date = new Date(now.setUTCMilliseconds(4)); trace(before); trace(before.getUTCMilliseconds());"/>
<page href="Date.html#setUTCMinutes()" title="Date.setUTCMinutes()" text="setUTCMinutes Sets the minutes, in universal time (UTC), and returns the new time in milliseconds. Optionally, you can specify the seconds and milliseconds. minute second millisecond An integer from 0 to 59. An integer from 0 to 59. An integer from 0 to 999. The following example creates a new Date object now with no parameters. The method getUTCMinutes() is then called, which retrieves the UTCMinutes when now was created. Then another new Date object before with an additional call to setUTCMinutes() with the minute parameter set to 0 and getUTCMinutes() is called again, which retrieves the newly set minutes. var now:Date = new Date(); trace(now); trace(now.getUTCMinutes()); var before:Date = new Date(now.setUTCMinutes(0)); trace(before); trace(before.getUTCMinutes());"/>
<page href="Date.html#setUTCMonth()" title="Date.setUTCMonth()" text="setUTCMonth Sets the month, and optionally the day, in universal time(UTC) and returns the new time in milliseconds. Calling this method does not modify the other fields, but the Date.getUTCDay() and Date.getDay() methods might report a new value if the day of the week changes as a result of calling this method. month day An integer from 0 (January) to 11 (December). An integer from 1 to 31. The following example creates a new Array object UTCMonthLabels, with elements January through December and a new UTCMonth object now with no parameters. The method getUTCMonth() is then called, which retrieves the UTCMonth in which now was created. Next setUTCMonth() is called with the month parameter set to 0 and then getUTCMonth() is called again, which retrieves the newly set month. var UTCMonthLabels: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;); var now:Date = new Date(); trace(now.getUTCMonth()); trace(UTCMonthLabels[now.getUTCMonth()]); now.setUTCUTCMonth(0); trace(now.getUTCMonth()); // 0 trace(UTCMonthLabels[now.getUTCMonth()]); // January"/>
<page href="Date.html#setUTCSeconds()" title="Date.setUTCSeconds()" text="setUTCSeconds Sets the seconds, and optionally the milliseconds, in universal time (UTC) and returns the new time in milliseconds. second millisecond An integer from 0 to 59. An integer from 0 to 999. The following example creates a new Date object now with no parameters. The method getUTCSeconds() is then called, which retrieves the seconds when now was created. Then the setUTCSeconds() is called with the second parameter set to 0 and getUTCSeconds() is called again, which retrieves the newly set seconds. var now:Date = new Date(); trace(now.getUTCSeconds()); now.setUTCSeconds(0); trace(now.getUTCSeconds()); // 0"/>
<page href="Date.html#toDateString()" title="Date.toDateString()" text="toDateString Returns a string representation of the day and date only, and does not include the time or timezone. Contrast with the following methods: Date.toTimeString(), which returns only the time and timezone Date.toString(), which returns not only the day and date, but also the time and timezone. The following example creates a new Date object now with no parameters and then the following methods are called within a trace() statement toString: displays all parameters for now at the time now was created. toDateString(): displays the day, month, and year parameters for the time now was created. var now:Date = new Date(); trace(now); trace(now.toDateString());"/>
<page href="Date.html#toLocaleDateString()" title="Date.toLocaleDateString()" text="toLocaleDateString Returns a String representation of the day and date only, and does not include the time or timezone. This method returns the same value as Date.toDateString. Contrast with the following methods: Date.toTimeString(), which returns only the time and timezone Date.toString(), which returns not only the day and date, but also the time and timezone."/>
<page href="Date.html#toLocaleString()" title="Date.toLocaleString()" text="toLocaleString Returns a String representation of the day, date, time, given in local time. Contrast with the Date.toString() method, which returns the same information (plus the timezone) with the year listed at the end of the string."/>
<page href="Date.html#toLocaleTimeString()" title="Date.toLocaleTimeString()" text="toLocaleTimeString Returns a String representation of the time only, and does not include the day, date, year, or timezone. Contrast with the Date.toTimeString() method, which returns the time and timezone."/>
<page href="Date.html#toString()" title="Date.toString()" text="toString Returns a String representation of the day, date, time, and timezone. The date format for the output is: Day Mon Date HH:MM:SS TZD YYYY For example: Wed Apr 12 15:30:17 GMT-0700 2006 The following example creates a new Date object now with no parameters and then toString is called within a trace() statement, which displays all parameters for now at the time now was created. var now:Date = new Date(); trace(now);"/>
<page href="Date.html#toTimeString()" title="Date.toTimeString()" text="toTimeString Returns a String representation of the time and timezone only, and does not include the day and date. Contrast with the Date.toDateString() method, which returns only the day and date."/>
<page href="Date.html#toUTCString()" title="Date.toUTCString()" text="toUTCString Returns a String representation of the day, date, and time in universal time (UTC). For example, the date February 1, 2005 is returned as Tue Feb 1 00:00:00 2005 UTC."/>
<page href="Date.html#UTC()" title="Date.UTC()" text="UTC Returns the number of milliseconds between midnight on January 1, 1970, universal time, and the time specified in the parameters. This method uses universal time, whereas the Date constructor uses local time. This method is useful if you want to pass a UTC date to the Date class constructor. Because the Date class constructor accepts the millisecond offset as an argument, you can use the Date.UTC() method to convert your UTC date into the corresponding millisecond offset, and send that offset as an argument to the Date class constructor: year month date hour minute second millisecond A four-digit integer that represents the year (for example, 2000). An integer from 0 (January) to 11 (December). An integer from 1 to 31. An integer from 0 (midnight) to 23 (11 p.m.). An integer from 0 to 59. An integer from 0 to 59. An integer from 0 to 999. The following example creates a new Date object someBirthday with parameters year (1974), month (10 = November), day (30), hour (1) and minute (20) using local time. Then a call to UTC() within a setTime() method resets the same parameters to universal time. var someBirthday:Date = new Date(1974, 10, 30, 15, 20); trace(someBirthday.toString()); someBirthday.setTime(Date.UTC(1974, 10, 30, 15, 20)); trace(someBirthday.toString());"/>
<page href="Date.html#valueOf()" title="Date.valueOf()" text="valueOf Returns the number of milliseconds since midnight January 1, 1970, universal time, for a Date object. The following example creates a new Date object now with no parameters The getTime() method is then called, which retrieves the number of milliseconds between the time now was created and midnight on January 1, 1970, and then valueOf() is called, which retrieves the same thing. var now:Date = new Date(); trace(now.getTime()); trace(now.valueOf());"/>
<page href="Date.html#date" title="Date.date" text="date The day of the month (an integer from 1 to 31) specified by a Date object according to local time. Local time is determined by the operating system on which Flash Player is running."/>
<page href="Date.html#dateUTC" title="Date.dateUTC" text="dateUTC The day of the month (an integer from 1 to 31) of a Date object according to universal time (UTC)."/>
<page href="Date.html#day" title="Date.day" text="day The day of the week (0 for Sunday, 1 for Monday, and so on) specified by this Date according to local time. Local time is determined by the operating system on which Flash Player is running."/>
<page href="Date.html#dayUTC" title="Date.dayUTC" text="dayUTC The day of the week (0 for Sunday, 1 for Monday, and so on) of this Date according to universal time (UTC)."/>
<page href="Date.html#fullYear" title="Date.fullYear" text="fullYear The full year (a four-digit number, such as 2000) of a Date object according to local time. Local time is determined by the operating system on which Flash Player is running."/>
<page href="Date.html#fullYearUTC" title="Date.fullYearUTC" text="fullYearUTC The four-digit year of a Date object according to universal time (UTC)."/>
<page href="Date.html#hours" title="Date.hours" text="hours The hour (an integer from 0 to 23) of the day portion of a Date object according to local time. Local time is determined by the operating system on which Flash Player is running."/>
<page href="Date.html#hoursUTC" title="Date.hoursUTC" text="hoursUTC The hour (an integer from 0 to 23) of the day of a Date object according to universal time (UTC)."/>
<page href="Date.html#milliseconds" title="Date.milliseconds" text="milliseconds The milliseconds (an integer from 0 to 999) portion of a Date object according to local time. Local time is determined by the operating system on which Flash Player is running."/>
<page href="Date.html#millisecondsUTC" title="Date.millisecondsUTC" text="millisecondsUTC The milliseconds (an integer from 0 to 999) portion of a Date object according to universal time (UTC)."/>
<page href="Date.html#minutes" title="Date.minutes" text="minutes The minutes (an integer from 0 to 59) portion of a Date object according to local time. Local time is determined by the operating system on which Flash Player is running."/>
<page href="Date.html#minutesUTC" title="Date.minutesUTC" text="minutesUTC The minutes (an integer from 0 to 59) portion of a Date object according to universal time (UTC)."/>
<page href="Date.html#month" title="Date.month" text="month The month (0 for January, 1 for February, and so on) portion of a Date object according to local time. Local time is determined by the operating system on which Flash Player is running."/>
<page href="Date.html#monthUTC" title="Date.monthUTC" text="monthUTC The month (0 [January] to 11 [December]) portion of a Date object according to universal time (UTC)."/>
<page href="Date.html#seconds" title="Date.seconds" text="seconds The seconds (an integer from 0 to 59) portion of a Date object according to local time. Local time is determined by the operating system on which Flash Player is running."/>
<page href="Date.html#secondsUTC" title="Date.secondsUTC" text="secondsUTC The seconds (an integer from 0 to 59) portion of a Date object according to universal time (UTC)."/>
<page href="Date.html#time" title="Date.time" text="time The number of milliseconds since midnight January 1, 1970, universal time, for a Date object. Use this method to represent a specific instant in time when comparing two or more Date objects."/>
<page href="Date.html#timezoneOffset" title="Date.timezoneOffset" text="timezoneOffset The difference, in minutes, between universal time (UTC) and the computer's local time. Specifically, this value is the number of minutes you need to add to the computer's local time to equal UTC. If your computer's time is set later than UTC, the value will be negative."/>
<page href="int.html" title="int class" text="int The int class lets you work with the data type representing a 32-bit signed integer. The range of values represented by the int class is -2,147,483,648 (-2^31) to 2,147,483,647 (2^31-1). The constant properties of the int class, MAX_VALUE and MIN_VALUE, are static, which means that you don't need an object to use them, so you don't need to use the constructor. The methods, however, are not static, which means that you do need an object to use them. You can create an int object by using the int class constructor or by declaring a variable of type int and assigning the variable a literal value. The int data type is useful for loop counters and other situations where a floating point number is not needed, and is similar to the int data type in Java and C++. The default value of a variable typed as int is 0. If you are working with numbers that exceed int.MAX_VALUE, consider using Number. The following example calls the toString() method of the int class, which returns the string 1234: var myint:int = 1234; myint.toString(); The following example assigns the value of the MIN_VALUE property to a variable declared without the use of the constructor: var smallest:int = int.MIN_VALUE;"/>
<page href="int.html#int()" title="int.int()" text="int Constructor; creates a new int object. An int object is not the same as the int() function that converts a parameter to a primitive value. num The numeric value of the int object being created or a value to be converted to a number. The default value is 0 if value is not provided. The following code constructs new int objects: var n1:int = new int(3.4); var n2:int = new int(-10);"/>
<page href="int.html#toExponential()" title="int.toExponential()" text="toExponential Returns a string representation of the number in exponential notation. The string contains one digit before the decimal point and up to 20 digits after the decimal point, as specified by the fractionDigits parameter. fractionDigits An integer between 0 and 20, inclusive, that represents the desired number of decimal places. The following example shows how toExponential(2) returns a string in exponential notation. var num:Number = 315003; trace(num.toExponential(2)); // 3.15e+5 Throws an exception if the fractionDigits argument is outside the range 0 to 20."/>
<page href="int.html#toFixed()" title="int.toFixed()" text="toFixed Returns a string representation of the number in fixed-point notation. Fixed-point notation means that the string will contain a specific number of digits after the decimal point, as specified in the fractionDigits parameter. The valid range for the fractionDigits parameter is from 0 to 20. Specifying a value outside this range throws an exception. fractionDigits An integer between 0 and 20, inclusive, that represents the desired number of decimal places. The following example shows how toFixed(3) returns a string that rounds to three decimal places. var num:Number = 7.31343; trace(num.toFixed(3)); // 7.313 Throws an exception if the fractionDigits argument is outside the range 0 to 20."/>
<page href="int.html#toPrecision()" title="int.toPrecision()" text="toPrecision Returns a string representation of the number either in exponential notation or in fixed-point notation. The string will contain the number of digits specified in the precision parameter. precision An integer between 1 and 21, inclusive, that represents the desired number of digits to represent in the resulting string. The following example shows how toPrecision(3) returns a string with only three digits. The string is in fixed-point notation because exponential notation is not required. var num:Number = 31.570; trace(num.toPrecision(3)); // 31.6 Throws an exception if the precision argument is outside the range 1 to 21."/>
<page href="int.html#toString()" title="int.toString()" text="toString Returns the string representation of an int object. radix 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. The following example uses 2 and 8 for the radix parameter and returns a string that contains the corresponding representation of the number 9: var myint:int = new int(9); trace(myint.toString(2)); // output: 1001 trace(myint.toString(8)); // output: 11 The following example results in a hexadecimal value. var r:int = new int(250); var g:int = new int(128); var b:int = new int(114); var rgb:String = &quot;0x&quot;+ r.toString(16)+g.toString(16)+b.toString(16); trace(rgb); // 0xfa8072"/>
<page href="int.html#valueOf()" title="int.valueOf()" text="valueOf Returns the primitive value of the specified int object. The following example results in the primative value of the numSocks object. var numSocks:int = new int(2); trace(numSocks.valueOf()); // 2"/>
<page href="int.html#MAX_VALUE" title="int.MAX_VALUE" text="MAX_VALUE The largest representable 32-bit signed integer, which is 2,147,483,647. The following ActionScript displayswrites the largest and smallest representable int objects to the Output panelto the log file: trace(&quot;int.MIN_VALUE = &quot;+int.MIN_VALUE); trace(&quot;int.MAX_VALUE = &quot;+int.MAX_VALUE); This code logsdisplays the following values: int.MIN_VALUE = -2147483648 int.MAX_VALUE = 2147483647"/>
<page href="int.html#MIN_VALUE" title="int.MIN_VALUE" text="MIN_VALUE The smallest representable 32-bit signed integer, which is -2,147,483,648. The following ActionScript displayswrites the largest and smallest representable int objects to the Output panel to the log file: trace(&quot;int.MIN_VALUE = &quot;+int.MIN_VALUE); trace(&quot;int.MAX_VALUE = &quot;+int.MAX_VALUE); This code logsdisplays the following values: int.MIN_VALUE = -2147483648 int.MAX_VALUE = 2147483647"/>
<page href="DefinitionError.html" title="DefinitionError class" text="DefinitionError The DefinitionError class represents an error that occurs when user code attempts to define an identifier that is already defined. This error commonly occurs in redefining classes, interfaces, and functions."/>
<page href="DefinitionError.html#DefinitionError()" title="DefinitionError.DefinitionError()" text="DefinitionError Creates a new DefinitionError object. message"/>
<page href="EvalError.html" title="EvalError class" text="EvalError The EvalError class represents an error that occurs when user code calls the eval() function or attempts to use the new operator with the Function object. Calling eval() and calling new with the Function object are not supported."/>
<page href="EvalError.html#EvalError()" title="EvalError.EvalError()" text="EvalError Creates a new EvalError object. message A string associated with the error."/>
<page href="Boolean.html" title="Boolean class" text="Boolean A Boolean object is a data type that can have one of two values, either true or false, used for logical operations. Use the Boolean class to retrieve the primitive data type or string representation of a Boolean object. To create a Boolean object, you can use the constructor or the global function, or assign a literal value. It doesn't matter which technique you use; in ActionScript 3.0, all three techniques are equivalent. (This is different from JavaScript, where a Boolean object is distinct from the Boolean primitive type.) The following lines of code are equivalent: var flag:Boolean = true; var flag:Boolean = new Boolean(true); var flag:Boolean = Boolean(true);"/>
<page href="Boolean.html#Boolean()" title="Boolean.Boolean()" text="Boolean Creates a Boolean object with the specified value. If you omit the expression parameter, the Boolean object is initialized with a value of false. If you specify a value for the expression parameter, the method evaluates it and returns the result as a Boolean value according to the rules in the global Boolean() function. expression Any expression. The following code creates a new Boolean object, initialized to a value of false called myBoolean: var myBoolean:Boolean = new Boolean();"/>
<page href="Boolean.html#toString()" title="Boolean.toString()" text="toString Returns the string representation (&quot;true&quot; or &quot;false&quot;) of the Boolean object. The output is not localized, and is &quot;true&quot; or &quot;false&quot; regardless of the system language. This example creates a variable of type Boolean and then uses the toString() method to convert the value to a string for use in an array of strings: var myStringArray:Array = new Array(&quot;yes&quot;, &quot;could be&quot;); var myBool:Boolean = 0; myBool.toString(); myStringArray.push(myBool); trace(myStringArray); // yes,could be,false"/>
<page href="Boolean.html#valueOf()" title="Boolean.valueOf()" text="valueOf Returns true if the value of the specified Boolean object is true; false otherwise. The following example shows how this method works, and also shows that the value of a new Boolean object is false: var myBool:Boolean = new Boolean(); trace(myBool.valueOf());   // false myBool = (6==3+3); trace(myBool.valueOf());   // true"/>
<page href="Class.html" title="Class class" text="Class A Class object is created for each class definition in a program. Every Class object is an instance of the Class class. The Class object contains the static properties and methods of the class. The class object creates instances of the class when invoked using the new operator. Some methods, such as flash.net.getClassByAlias(), return an object of type Class. Other methods may have a parameter of type Class, such as flash.net.registerClassAlias(). The class name is the reference to the Class object, as this example shows: class Foo { } The class Foo{} statement is the class definition that creates the Class object Foo. Additionally, the statement new Foo() will create a new instance of class Foo, and the result will be of type Foo. Use the class statement to declare your classes. Class objects are useful for advanced techniques, such as assigning classes to an existing instance object at runtime, as shown in the &quot;Examples&quot; section below. Any static properties and methods of a class live on the class's Class object. Class, itself, declares prototype. Generally, you do not need to declare or create variables of type Class manually. However, in the following code, a class is assigned as a public Class property circleClass, and you can refer to this Class property as a property of the main Library class: package { import flash.display.Sprite; public class Library extends Sprite { public var circleClass:Class = Circle; public function Library() { } } } import flash.display.Shape; class Circle extends Shape { public function Circle(color:uint = 0xFFCC00, radius:Number = 10) { graphics.beginFill(color); graphics.drawCircle(radius, radius, radius); } } Another SWF file can load the resulting Library.swf file and then instantiate objects of type Circle. The following example shows one way to get access to a child SWF file's assets. (Other techniques include using flash.utils.getDefnitionByName() or importing stub definitions of the child SWF file.) package { import flash.display.Sprite; import flash.display.Shape; import flash.display.Loader; import flash.net.URLRequest; import flash.events.Event; public class LibaryLoader extends Sprite { public function LibaryLoader() { var ldr:Loader = new Loader(); var urlReq:URLRequest = new URLRequest(&quot;Library.swf&quot;); ldr.load(urlReq); ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded); } private function loaded(event:Event):void { var library:Object = event.target.content; var circle:Shape = new library.circleClass(); addChild(circle); } } } In ActionScript 3.0, you can create embedded classes for external assets (such as images, sounds, or fonts) that are compiled into SWF files. In earlier versions of ActionScript, you associated those assets using a linkage ID with the MovieClip.attachMovie() method. In ActionScript 3.0, each embedded asset is represented by a unique embedded asset class. Therefore, you can use the new operator to instantiate the asset's associated class and call methods and properties on that asset."/>
<page href="SecurityError.html" title="SecurityError class" text="SecurityError The SecurityError exception is thrown when some type of security violation takes place. Examples of security errors: An unauthorized property access or method call is made across a security sandbox boundary. An attempt was made to access a URL not permitted by the security sandbox. A socket connection was attempted to an unauthorized port number, e.g. a port above 65535. An attempt was made to access the user's camera or microphone, and the request to access the device was denied by the user."/>
<page href="SecurityError.html#SecurityError()" title="SecurityError.SecurityError()" text="SecurityError Creates a new SecurityError object. message"/>
<page href="arguments.html" title="arguments class" text="arguments An arguments object is used to store and access a function's arguments. Within a function's body, you can access its arguments object by using the local arguments variable. The arguments are stored as array elements: the first is accessed as arguments[0], the second as arguments[1], and so on. The arguments.length property indicates the number of arguments passed to the function. There may be a different number of arguments passed than the function declares. Unlike previous versions of ActionScript, ActionScript 3.0 has no arguments.caller property. To get a reference to the function that called the current function, you must pass a reference to that function as an argument. An example of this technique can be found in the example for arguments.callee. ActionScript 3.0 includes a new ...(rest) keyword that is recommended instead of the arguments class."/>
<page href="arguments.html#callee" title="arguments.callee" text="callee A reference to the currently executing function. The following code shows how to get a reference to the function that calls the function named secondFunction(). The firstFunction() function has the Boolean argument of true to demonstrate that secondFunction() successfully calls firstFunction() and to prevent an infinite loop of each function calling the other. Because the callSecond parameter is true, firstFunction() calls secondFunction() and passes a reference to itself as the only argument. The function secondFunction() receives this argument and stores it using a parameter named caller, which is of data type Function. From within secondFunction(), the caller parameter is then used to call the firstFunction function, but this time with the callSecond argument set to false. When execution returns to firstFunction(), the trace() statement is executed because callSecond is false. package { import flash.display.Sprite; public class ArgumentsExample extends Sprite { private var count:int = 1; public function ArgumentsExample() { firstFunction(true); } public function firstFunction(callSecond:Boolean) { trace(count + &quot;: firstFunction&quot;); if(callSecond) { secondFunction(arguments.callee); } else { trace(&quot;CALLS STOPPED&quot;); } } public function secondFunction(caller:Function) { trace(count + &quot;: secondFunction\n&quot;); count++; caller(false); } } }"/>
<page href="arguments.html#length" title="arguments.length" text="length The number of arguments passed to the function. This may be more or less than the function declares."/>
<page href="SyntaxError.html" title="SyntaxError class" text="SyntaxError A SyntaxError exception is thrown when a parsing error occurs. Flash Player throws SyntaxError exceptions when an invalid regular expression is parsed by the RegExp class. Flash Player throws SyntaxError exceptions when invalid XML is parsed by the XML class."/>
<page href="SyntaxError.html#SyntaxError()" title="SyntaxError.SyntaxError()" text="SyntaxError Creates a new SyntaxError object. message Contains the message associated with the SyntaxError object."/>
<page href="Function.html" title="Function class" text="Function A function is the basic unit of code that can be invoked in ActionScript. Both user-defined and built-in functions in ActionScript are represented by Function objects, which are instances of the Function class. Methods of a class are slightly different than Function objects. Unlike an ordinary function object, a method is tightly linked to its associated class object. Therefore, a method or property has a definition that is shared among all instances of the same class. Methods can be extracted from an instance and treated as &quot;bound&quot; methods (retaining the link to the original instance). For a bound method, the this keyword points to the original object that implemented the method. For a function, this points to the associated object at the time the function is invoked."/>
<page href="Function.html#apply()" title="Function.apply()" text="apply 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. thisObject argArray The object to which the function is applied. An array whose elements are passed to the function as parameters."/>
<page href="Function.html#call()" title="Function.call()" text="call 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, 3); In 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. thisObject parameter1 An object that specifies the value of thisObject within the function body. A parameter to be passed to the function. You can specify zero or more parameters."/>
<page href="URIError.html" title="URIError class" text="URIError A URIError exception is thrown when one of the global URI handling functions is used in a way that is incompatible with its definition. This exception is thrown when an invalid URI is specified to a function that expects a valid URI, such as the Socket.connect() method."/>
<page href="URIError.html#URIError()" title="URIError.URIError()" text="URIError Creates a new URIError object. message Contains the message associated with the URIError object."/>
<page href="XML.html" title="XML class" text="XML The XML class contains methods and properties for working with XML objects. The XML class (along with the XMLList, Namespace, and QName classes) implements the powerful XML-handling standards defined in ECMAScript for XML (E4X) specification (ECMA-357 edition 2). Use the toXMLString() method to return a string representation of the XML object regardless of whether the XML object has simple content or complex content. Note: The XML class (along with related classes) from ActionScript 2.0 has been renamed XMLDocument and moved into the flash.xml package. It is included in ActionScript 3.0 for backward compatibility."/>
<page href="XML.html#XML()" title="XML.XML()" text="XML 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. Use the toXMLString() method to return a string representation of the XML object regardless of whether the XML object has simple content or complex content. value Any object that can be converted to XML with the top-level XML() function."/>
<page href="XML.html#addNamespace()" title="XML.addNamespace()" text="addNamespace Adds a namespace to the set of in-scope namespaces for the XML object. If the namespace already exists in the in-scope namespaces for the XML object (with a prefix matching that of the given parameter), then the prefix of the existing namespace is set to undefined. If the input parameter is a Namespace object, it's used directly. If it's a QName object, the input parameter's URI is used to create a new namespace; otherwise, it's converted to a String and a namespace is created from the String. ns The namespace to add to the XML object. This example uses a namespace defined in one XML object and applies it to another XML object: var xml1:XML = &lt;ns:foo xmlns:ns=&quot;www.example.com/ns&quot; /&gt;; var nsNamespace:Namespace = xml1.namespace(); var xml2:XML = &lt;bar /&gt;; xml2.addNamespace(nsNamespace); trace(xml2.toXMLString()); // &lt;bar xmlns:ns=&quot;www.example.com/ns&quot;/&gt;"/>
<page href="XML.html#appendChild()" title="XML.appendChild()" text="appendChild Appends the given child to the end of the XML object's properties. The appendChild() method takes an XML object, an XMLList object, or any other data type that is then converted to a String. Use the delete (XML) operator to remove XML nodes. child The XML object to append. This example appends a new element to the end of the child list of an XML object: var xml:XML = &lt;body&gt; &lt;p&gt;hello&lt;/p&gt; &lt;/body&gt;; xml.appendChild(&lt;p&gt;world&lt;/p&gt;); trace(xml.p[0].toXMLString()); // &lt;p&gt;hello&lt;/p&gt; trace(xml.p[1].toXMLString()); // &lt;p&gt;world&lt;/p&gt;"/>
<page href="XML.html#attribute()" title="XML.attribute()" text="attribute Returns the XML value of the attribute that has the name matching the attributeName parameter. Attributes are found within XML elements. In the following example, the element has an attribute named &quot;gender&quot; with the value &quot;boy&quot;: &lt;first gender=&quot;boy&quot;&gt;John&lt;/first&gt;. The attributeName parameter can be any data type; however, String is the most common data type to use. When passing any object other than a QName object, the attributeName parameter uses the toString() method to convert the parameter to a string. If you need a qualified name reference, you can pass in a QName object. A QName object defines a namespace and the local name, which you can use to define the qualified name of an attribute. Therefore calling attribute(qname) is not the same as calling attribute(qname.toString()). attributeName The name of the attribute. This example shows a QName object passed into the attribute() method. The localName property is attr and the namespace property is ns. var xml:XML = &lt;ns:node xmlns:ns = &quot;http://uri&quot; ns:attr = '7' /&gt; var qn:QName = new QName(&quot;http://uri&quot;, &quot;attr&quot;); trace(xml.attribute(qn)); // 7"/>
<page href="XML.html#attributes()" title="XML.attributes()" text="attributes Returns a list of attribute values for the given XML object. Use the name() method with the attributes() method to return the name of an attribute. Use @~~ to return the names of all attributes. The following example returns the name of the attribute: var xml:XML=&lt;example id='123' color='blue'/&gt; trace(xml.attributes()[1].name()); //color"/>
<page href="XML.html#child()" title="XML.child()" text="child Lists the children of an XML object. An XML child is an XML element, text node, comment, or processing instruction. Use the propertyName parameter to list the contents of a specific XML child. For example, to return the contents of a child named &lt;first&gt;, use child.name(&quot;first&quot;). You can generate the same result by using the child's index number. The index number identifies the child's position in the list of other XML children. For example, name.child(0) returns the first child in a list. Use an asterisk (~~) to output all the children in an XML document. For example, doc.child(&quot;~~&quot;). Use the length() method with the asterisk (~~) parameter of the child() method to output the total number of children. For example, numChildren = doc.child(&quot;~~&quot;).length(). propertyName The element name or integer of the XML child. This example shows the use of the child() method to identify child elements with a specified name: var xml:XML = &lt;foo&gt; &lt;bar&gt;text1&lt;/bar&gt; &lt;bar&gt;text2&lt;/bar&gt; &lt;/foo&gt;; trace(xml.child(&quot;bar&quot;).length()); // 2 trace(xml.child(&quot;bar&quot;)[0].toXMLString()); // &lt;bar&gt;text1&lt;/bar&gt; trace(xml.child(&quot;bar&quot;)[1].toXMLString()); // &lt;bar&gt;text2&lt;/bar&gt;"/>
<page href="XML.html#childIndex()" title="XML.childIndex()" text="childIndex Identifies the zero-indexed position of this XML object within the context of its parent. This example shows the use of the childIndex() method: var xml:XML = &lt;foo&gt; &lt;bar /&gt; text &lt;bob /&gt; &lt;/foo&gt;; trace(xml.bar.childIndex()); // 0 trace(xml.bob.childIndex()); // 2"/>
<page href="XML.html#children()" title="XML.children()" text="children Lists the children of the XML object in the sequence in which they appear. An XML child is an XML element, text node, comment, or processing instruction. This example shows the use of the children() method: XML.ignoreComments = false; XML.ignoreProcessingInstructions = false; var xml:XML = &lt;foo id=&quot;22&quot;&gt; &lt;bar&gt;44&lt;/bar&gt; text &lt;!-- comment --&gt; &lt;?instruction ?&gt; &lt;/foo&gt;; trace(xml.children().length()); // 4 trace(xml.children()[0].toXMLString()); // &lt;bar&gt;44&lt;/bar&gt; trace(xml.children()[1].toXMLString()); // text trace(xml.children()[2].toXMLString()); // &lt;!-- comment --&gt; trace(xml.children()[3].toXMLString()); // &lt;?instruction ?&gt;"/>
<page href="XML.html#comments()" title="XML.comments()" text="comments Lists the properties of the XML object that contain XML comments. This example shows the use of the comments() method: XML.ignoreComments = false; var xml:XML = &lt;foo&gt; &lt;!-- example --&gt; &lt;!-- example2 --&gt; &lt;/foo&gt;; trace(xml.comments().length()); // 2 trace(xml.comments()[1].toXMLString()); // &lt;!-- example2 --&gt;"/>
<page href="XML.html#contains()" title="XML.contains()" text="contains Compares the XML object against the given value parameter. value A value to compare against the current XML object. This example shows the use of the contains() method: var xml:XML = &lt;order&gt; &lt;item&gt;Rice&lt;/item&gt; &lt;item&gt;Kung Pao Shrimp&lt;/item&gt; &lt;/order&gt;; trace(xml.item[0].contains(&lt;item&gt;Rice&lt;/item&gt;)); // true trace(xml.item[1].contains(&lt;item&gt;Kung Pao Shrimp&lt;/item&gt;)); // true trace(xml.item[1].contains(&lt;item&gt;MSG&lt;/item&gt;)); // false"/>
<page href="XML.html#copy()" title="XML.copy()" text="copy Returns a copy of the given XML object. The copy is a duplicate of the entire tree of nodes. The copied XML object has no parent and returns null if you attempt to call the parent() method. This example shows that the copy() method creates a new instance of an XML object. When you modify the copy, the original remains unchanged: var xml1:XML = &lt;foo /&gt;; var xml2:XML = xml1.copy(); xml2.appendChild(&lt;bar /&gt;); trace(xml1.bar.length()); // 0 trace(xml2.bar.length()); // 1"/>
<page href="XML.html#defaultSettings()" title="XML.defaultSettings()" text="defaultSettings Returns an object with the following properties set to the default values: ignoreComments, ignoreProcessingInstructions, ignoreWhitespace, prettyIndent, and prettyPrinting. The default values are as follows: ignoreComments = true ignoreProcessingInstructions = true ignoreWhitespace = true prettyIndent = 2 prettyPrinting = true Note: You do not apply this method to an instance of the XML class; you apply it to XML, as in the following code: var df:Object = XML.defaultSettings(). The following example shows: how to apply some custom settings (for including comments and processing instructions) prior to setting an XML object; how to then revert back to the default settings before setting another XML object; and then how to set the custom settings again (for setting any more XML objects): XML.ignoreComments = false; XML.ignoreProcessingInstructions = false; var customSettings:Object = XML.settings(); var xml1:XML = &lt;foo&gt; &lt;!-- comment --&gt; &lt;?instruction ?&gt; &lt;/foo&gt;; trace(xml1.toXMLString()); // &lt;foo&gt; // &lt;!-- comment --&gt; // &lt;?instruction ?&gt; // &lt;/foo&gt; XML.setSettings(XML.defaultSettings()); var xml2:XML = &lt;foo&gt; &lt;!-- comment --&gt; &lt;?instruction ?&gt; &lt;/foo&gt;; trace(xml2.toXMLString());"/>
<page href="XML.html#descendants()" title="XML.descendants()" text="descendants Returns all descendants (children, grandchildren, great-grandchildren, and so on) of the XML object that have the given name parameter. The name parameter is optional. The name parameter can be a QName object, a String data type or any other data type that is then converted to a String data type. To return all descendants, use the &quot;~~&quot; parameter. If no parameter is passed, the string &quot;~~&quot; is passed and returns all descendants of the XML object. name The name of the element to match. To return descendants with names that match ActionScript reserved words, use the descendants() method instead of the descendant (..) operator, as in the following example: var xml:XML = &lt;enrollees&gt; &lt;student id=&quot;239&quot;&gt; &lt;class name=&quot;Algebra&quot; /&gt; &lt;class name=&quot;Spanish 2&quot;/&gt; &lt;/student&gt; &lt;student id=&quot;206&quot;&gt; &lt;class name=&quot;Trigonometry&quot; /&gt; &lt;class name=&quot;Spanish 2&quot; /&gt; &lt;/student&gt; &lt;/enrollees&gt; trace(xml.descendants(&quot;class&quot;));"/>
<page href="XML.html#elements()" title="XML.elements()" text="elements Lists the elements of an XML object. An element consists of a start and an end tag; for example &lt;first&gt;&lt;/first&gt;. The name parameter is optional. The name parameter can be a QName object, a String data type, or any other data type that is then converted to a String data type. Use the name parameter to list a specific element. For example, the element &quot;first&quot; returns &quot;John&quot; in this example: &lt;first&gt;John&lt;/first&gt;. To list all elements, use the asterisk (~~) as the parameter. The asterisk is also the default parameter. Use the length() method with the asterisk parameter to output the total number of elements. For example, numElement = addressbook.elements(&quot;~~&quot;).length(). name The name of the element. An element's name is surrounded by angle brackets. For example, &quot;first&quot; is the name in this example: &lt;first&gt;&lt;/first&gt;. The following example shows that the elements() method returns a list of elements only — not comments, text properties, or processing instructions: var xml:XML = &lt;foo&gt; &lt;!-- comment --&gt; &lt;?instruction ?&gt; text &lt;a&gt;1&lt;/a&gt; &lt;b&gt;2&lt;/b&gt; &lt;/foo&gt;; trace(xml.elements(&quot;*&quot;).length()); // 2 trace(xml.elements(&quot;*&quot;)[0].toXMLString()); // &lt;a&gt;1&lt;/a&gt; trace(xml.elements(&quot;b&quot;).length()); // 1 trace(xml.elements(&quot;b&quot;)[0].toXMLString()); // &lt;b&gt;2&lt;/b&gt;"/>
<page href="XML.html#hasComplexContent()" title="XML.hasComplexContent()" text="hasComplexContent Checks to see whether the XML object contains complex content. An XML object contains complex content if it has child elements. XML objects that representing attributes, comments, processing instructions, and text nodes do not have complex content. However, an object that contains these can still be considered to contain complex content (if the object has child elements). The following example shows an XML object with one property named a that has simple content and one property named a that has complex content: var xml:XML = &lt;foo&gt; &lt;a&gt; text &lt;/a&gt; &lt;a&gt; &lt;b/&gt; &lt;/a&gt; &lt;/foo&gt;; trace(xml.a[0].hasComplexContent()); // false trace(xml.a[1].hasComplexContent()); // true trace(xml.a[0].hasSimpleContent()); // true trace(xml.a[1].hasSimpleContent()); // false"/>
<page href="XML.html#hasOwnProperty()" title="XML.hasOwnProperty()" text="hasOwnProperty Checks to see whether the object has the property specified by the p parameter. p The property to match. The following example uses the hasOwnProperty() method to ensure that a property (b) exists prior to evaluating an expression (b == &quot;11&quot;) that uses the property: var xml:XML = &lt;foo&gt; &lt;a /&gt; &lt;a&gt; &lt;b&gt;10&lt;/b&gt; &lt;/a&gt; &lt;a&gt; &lt;b&gt;11&lt;/b&gt; &lt;/a&gt; &lt;/foo&gt;; trace(xml.a.(hasOwnProperty(&quot;b&quot;) &amp;&amp; b == &quot;11&quot;)); If the last line in this example were the following, Flash Player would throw an exception since the first element named a does not have a property named b: trace(xml.a.(b == &quot;11&quot;));"/>
<page href="XML.html#hasSimpleContent()" title="XML.hasSimpleContent()" text="hasSimpleContent Checks to see whether the XML object contains simple content. An XML object contains simple content if it represents a text node, an attribute node, or an XML element that has no child elements. XML objects that represent comments and processing instructions do not contain simple content. The following example shows an XML object with one property named a that has simple content and one property named a that has complex content: var xml:XML = &lt;foo&gt; &lt;a&gt; text &lt;/a&gt; &lt;a&gt; &lt;b/&gt; &lt;/a&gt; &lt;/foo&gt;; trace(xml.a[0].hasComplexContent()); // false trace(xml.a[1].hasComplexContent()); // true trace(xml.a[0].hasSimpleContent()); // true trace(xml.a[1].hasSimpleContent()); // false"/>
<page href="XML.html#inScopeNamespaces()" title="XML.inScopeNamespaces()" text="inScopeNamespaces Lists the namespaces for the XML object, based on the object's parent."/>
<page href="XML.html#insertChildAfter()" title="XML.insertChildAfter()" text="insertChildAfter Inserts the given child2 parameter after the child1 parameter in this XML object and returns the resulting object. If the child1 parameter is null, the method inserts the contents of child2 before all children of the XML object (in other words, after none). If child1 is provided, but it does not exist in the XML object, the XML object is not modified and undefined is returned. If you call this method on an XML child that is not an element (text, attributes, comments, pi, and so on) undefined is returned. Use the delete (XML) operator to remove XML nodes. child1 child2 The object in the source object that you insert before child2. The object to insert. The following example appends an element to the end of the child elements of an XML object: var xml:XML = &lt;menu&gt; &lt;item&gt;burger&lt;/item&gt; &lt;item&gt;soda&lt;/item&gt; &lt;/menu&gt;; xml.insertChildAfter(xml.item[0], &lt;saleItem&gt;fries&lt;/saleItem&gt;); trace(xml); The trace() output is the following: &lt;menu&gt; &lt;item&gt;burger&lt;/item&gt; &lt;saleItem&gt;fries&lt;/saleItem&gt; &lt;item&gt;soda&lt;/item&gt; &lt;/menu&gt;"/>
<page href="XML.html#insertChildBefore()" title="XML.insertChildBefore()" text="insertChildBefore Inserts the given child2 parameter before the child1 parameter in this XML object and returns the resulting object. If the child1 parameter is null, the method inserts the contents of child2 after all children of the XML object (in other words, before none). If child1 is provided, but it does not exist in the XML object, the XML object is not modified and undefined is returned. If you call this method on an XML child that is not an element (text, attributes, comments, pi, and so on) undefined is returned. Use the delete (XML) operator to remove XML nodes. child1 child2 The object in the source object that you insert after child2. The object to insert. The following example appends an element to the end of the child elements of an XML object: var xml:XML = &lt;menu&gt; &lt;item&gt;burger&lt;/item&gt; &lt;item&gt;soda&lt;/item&gt; &lt;/menu&gt;; xml.insertChildBefore(xml.bar[0], &lt;saleItem&gt;fries&lt;/saleItem&gt;); trace(xml); The trace() output is the following: &lt;menu&gt; &lt;saleItem&gt;fries&lt;/saleItem&gt; &lt;item&gt;burger&lt;/item&gt; &lt;item&gt;soda&lt;/item&gt; &lt;/menu&gt;"/>
<page href="XML.html#length()" title="XML.length()" text="length For XML objects, this method always returns the integer 1. The length() method of the XMLList class returns a value of 1 for an XMLList object that contains only one value."/>
<page href="XML.html#localName()" title="XML.localName()" text="localName Gives the local name portion of the qualified name of the XML object. The following example illustrates the use of the localName() method: var xml:XML = &lt;soap:Envelope xmlns:soap=&quot;http://www.w3.org/2001/12/soap-envelope&quot; soap:encodingStyle=&quot;http://www.w3.org/2001/12/soap-encoding&quot;&gt; &lt;soap:Body xmlns:wx = &quot;http://example.com/weather&quot;&gt; &lt;wx:forecast&gt; &lt;wx:city&gt;Quito&lt;/wx:city&gt; &lt;/wx:forecast&gt; &lt;/soap:Body&gt; &lt;/soap:Envelope&gt;; trace(xml.localName()); // Envelope"/>
<page href="XML.html#name()" title="XML.name()" text="name Gives the qualified name for the XML object. The following example illustrates the use of the name() method to get the qualified name of an XML object: var xml:XML = &lt;soap:Envelope xmlns:soap=&quot;http://www.w3.org/2001/12/soap-envelope&quot; soap:encodingStyle=&quot;http://www.w3.org/2001/12/soap-encoding&quot;&gt; &lt;soap:Body xmlns:wx = &quot;http://example.com/weather&quot;&gt; &lt;wx:forecast&gt; &lt;wx:city&gt;Quito&lt;/wx:city&gt; &lt;/wx:forecast&gt; &lt;/soap:Body&gt; &lt;/soap:Envelope&gt;; trace(xml.name().localName); // Envelope trace(xml.name().uri); // &quot;http://www.w3.org/2001/12/soap-envelope&quot;"/>
<page href="XML.html#namespace()" title="XML.namespace()" text="namespace If no parameter is provided, gives the namespace associated with the qualified name of this XML object. If a prefix parameter is specified, the method returns the namespace that matches the prefix parameter and that is in scope for the XML object. If there is no such namespace, the method returns undefined. prefix The prefix you want to match. The following example uses the namespace() method to get the namespace of an XML object and assign it to a Namespace object named soap which is then used in identifying a property of the xml object (xml.soap::Body[0]): var xml:XML = &lt;soap:Envelope xmlns:soap=&quot;http://www.w3.org/2001/12/soap-envelope&quot; soap:encodingStyle=&quot;http://www.w3.org/2001/12/soap-encoding&quot;&gt; &lt;soap:Body xmlns:wx = &quot;http://example.com/weather&quot;&gt; &lt;wx:forecast&gt; &lt;wx:city&gt;Quito&lt;/wx:city&gt; &lt;/wx:forecast&gt; &lt;/soap:Body&gt; &lt;/soap:Envelope&gt;; var soap:Namespace = xml.namespace(); trace(soap.prefix); // soap trace(soap.uri); // http://www.w3.org/2001/12/soap-envelope var body:XML = xml.soap::Body[0]; trace(body.namespace().prefix); // soap trace(xml.namespace().uri); // http://www.w3.org/2001/12/soap-envelope trace(body.namespace(&quot;wx&quot;).uri); // &quot;http://example.com/weather&quot;"/>
<page href="XML.html#namespaceDeclarations()" title="XML.namespaceDeclarations()" text="namespaceDeclarations Lists namespace declarations associated with the XML object in the context of its parent. The following example outputs the namespace declarations of an XML object: var xml:XML = &lt;rdf:RDF xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns=&quot;http://purl.org/rss/1.0/&quot;&gt; &lt;!-- ... --&gt; &lt;/rdf:RDF&gt;; for (var i:uint = 0; i &lt; xml.namespaceDeclarations().length; i++) { var ns:Namespace = xml.namespaceDeclarations()[i]; var prefix:String = ns.prefix; if (prefix == &quot;&quot;) { prefix = &quot;(default)&quot;; } trace(prefix + &quot;:&quot; , ns.uri); } The trace() output is the following: rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# dc: http://purl.org/dc/elements/1.1/ (default): http://purl.org/rss/1.0/"/>
<page href="XML.html#nodeKind()" title="XML.nodeKind()" text="nodeKind Specifies the type of node: text, comment, processing-instruction, attribute, or element. This example traces all five node types: XML.ignoreComments = false; XML.ignoreProcessingInstructions = false; var xml:XML = &lt;example id=&quot;10&quot;&gt; &lt;!-- this is a comment --&gt; &lt;?test this is a pi ?&gt; and some text &lt;/example&gt;; trace(xml.nodeKind()); // element trace(xml.children()[0].nodeKind()); // comment trace(xml.children()[1].nodeKind()); // processing-instruction trace(xml.children()[2].nodeKind()); // text trace(xml.@id[0].nodeKind()); // attribute"/>
<page href="XML.html#normalize()" title="XML.normalize()" text="normalize For the XML object and all descendant XML objects, merges adjacent text nodes and eliminates empty text nodes. The following example shows the effect of calling the normalize() method: var xml:XML = &lt;body&gt;&lt;/body&gt;; xml.appendChild(&quot;hello&quot;); xml.appendChild(&quot; world&quot;); trace(xml.children().length()); // 2 xml.normalize(); trace(xml.children().length()); // 1"/>
<page href="XML.html#parent()" title="XML.parent()" text="parent Returns the parent of the XML object. If the XML object has no parent, the method returns undefined. The following example uses the parent() method to identify the parent element of a specific element in an XML structure: var xml:XML = &lt;body&gt; &lt;p id=&quot;p1&quot;&gt;Hello&lt;/p&gt; &lt;p id=&quot;p2&quot;&gt;Test: &lt;ul&gt; &lt;li&gt;1&lt;/li&gt; &lt;li&gt;2&lt;/li&gt; &lt;/ul&gt; &lt;/p&gt; &lt;/body&gt;; var node:XML = xml.p.ul.(li.contains(&quot;1&quot;))[0]; // == &lt;ul&gt; ... &lt;/ul&gt; trace(node.parent().@id); // p2"/>
<page href="XML.html#prependChild()" title="XML.prependChild()" text="prependChild Inserts a copy of the provided child object into the XML element before any existing XML properties for that element. Use the delete (XML) operator to remove XML nodes. value The object to insert. The following example uses the prependChild() method to add an element to the begining of a child list of an XML object: var xml:XML = &lt;body&gt; &lt;p&gt;hello&lt;/p&gt; &lt;/body&gt;; xml.prependChild(&lt;p&gt;world&lt;/p&gt;); trace(xml.p[0].toXMLString()); // &lt;p&gt;world&lt;/p&gt; trace(xml.p[1].toXMLString()); // &lt;p&gt;hello&lt;/p&gt;"/>
<page href="XML.html#processingInstructions()" title="XML.processingInstructions()" text="processingInstructions If a name parameter is provided, lists all the children of the XML object that contain processing instructions with that name. With no parameters, the method lists all the children of the XML object that contain any processing instructions. name The name of the processing instructions to match. The following example uses the processingInstructions() method to get an array of processing instructions for an XML object: XML.ignoreProcessingInstructions = false; var xml:XML = &lt;body&gt; foo &lt;?xml-stylesheet href=&quot;headlines.css&quot; type=&quot;text/css&quot; ?&gt; &lt;?instructionX ?&gt; &lt;/body&gt;; trace(xml.processingInstructions().length()); // 2 trace(xml.processingInstructions()[0].name()); // xml-stylesheet"/>
<page href="XML.html#propertyIsEnumerable()" title="XML.propertyIsEnumerable()" text="propertyIsEnumerable Checks whether the property p is in the set of properties that can be iterated in a for..in statement applied to the XML object. Returns true only if toString(p) == &quot;0&quot;. p The property that you want to check. The following example shows that, for an XML object, the propertyNameIsEnumerable() method returns a value of true only for the value 0; whereas for an XMLList object, the return value is true for each valid index value for the XMLList object: var xml:XML = &lt;body&gt; &lt;p&gt;Hello&lt;/p&gt; &lt;p&gt;World&lt;/p&gt; &lt;/body&gt;; trace(xml.propertyIsEnumerable(0)); // true trace(xml.propertyIsEnumerable(1)); // false for (var propertyName:String in xml) { trace(xml[propertyName]); } var list:XMLList = xml.p; trace(list.propertyIsEnumerable(0)); // true trace(list.propertyIsEnumerable(1)); // true trace(list.propertyIsEnumerable(2)); // false for (var propertyName:String in list) { trace(list[propertyName]); }"/>
<page href="XML.html#removeNamespace()" title="XML.removeNamespace()" text="removeNamespace Removes the given namespace for this object and all descendants. The removeNamespaces() method does not remove a namespace if it is referenced by the object's qualified name or the qualified name of the object's attributes. ns The namespace to remove. The following example shows how to remove a namespace declaration from an XML object: var xml:XML = &lt;rdf:RDF xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns=&quot;http://purl.org/rss/1.0/&quot;&gt; &lt;!-- ... --&gt; &lt;/rdf:RDF&gt;; trace(xml.namespaceDeclarations().length); // 3 trace(xml.namespaceDeclarations()[0] is String); // var dc:Namespace = xml.namespace(&quot;dc&quot;); xml.removeNamespace(dc); trace(xml.namespaceDeclarations().length); // 2"/>
<page href="XML.html#replace()" title="XML.replace()" text="replace Replaces the properties specified by the propertyName parameter with the given value parameter. If no properties match propertyName, the XML object is left unmodified. propertyName value Can be a numeric value, an unqualified name for a set of XML elements, a qualified name for a set of XML elements, or the asterisk wildcard (&quot;*&quot;). Use an unqualified name to identify XML elements in the default namespace. The replacement value. This can be an XML object, an XMLList object, or any value that can be converted with toString(). The following example illustrates calling the replace() method with an integer as the first parameter: var xml:XML = &lt;body&gt; &lt;p&gt;Hello&lt;/p&gt; &lt;p&gt;World&lt;/p&gt; &lt;hr/&gt; &lt;/body&gt;; xml.replace(1, &lt;p&gt;Bob&lt;/p&gt;); trace(xml); This results in the following trace() output: &lt;body&gt; &lt;p&gt;Hello&lt;/p&gt; &lt;p&gt;Bob&lt;/p&gt; &lt;hr/&gt; &lt;/body&gt;"/>
<page href="XML.html#setChildren()" title="XML.setChildren()" text="setChildren Replaces the child properties of the XML object with the specified set of XML properties, provided in the value parameter. value The replacement XML properties. Can be a single XML object or an XMLList object. The following example illustrates calling the setChildren() method, first using an XML object as the parameter, and then using an XMLList object as the parameter: var xml:XML = &lt;body&gt; &lt;p&gt;Hello&lt;/p&gt; &lt;p&gt;World&lt;/p&gt; &lt;/body&gt;; var list:XMLList = xml.p; xml.setChildren(&lt;p&gt;hello&lt;/p&gt;); trace(xml); // &lt;body&gt; // &lt;p&gt;hello&lt;/p&gt; // &lt;/body&gt; xml.setChildren(list); trace(xml); // &lt;body&gt; // &lt;p&gt;Hello&lt;/p&gt; // &lt;p&gt;World&lt;/p&gt; // &lt;/body&gt;"/>
<page href="XML.html#setLocalName()" title="XML.setLocalName()" text="setLocalName Changes the local name of the XML object to the given name parameter. name The replacement name for the local name. The following example uses the setLocalName() method to change the local name of an XML element: var xml:XML = &lt;ns:item xmlns:ns=&quot;http://example.com&quot;&gt; toothbrush &lt;/ns:item&gt;; xml.setLocalName(&quot;orderItem&quot;); trace(xml.toXMLString()); // &lt;ns:orderItem xmlns:ns=&quot;http://example.com&quot;&gt;toothbrush&lt;/ns:orderItem&gt;"/>
<page href="XML.html#setName()" title="XML.setName()" text="setName Sets the name of the XML object to the given qualified name or attribute name. name The new name for the object. The following example uses the setName() method to change the name of an XML element: var xml:XML = &lt;item&gt; toothbrush &lt;/item&gt;; xml.setName(&quot;orderItem&quot;); trace(xml.toXMLString()); // &lt;orderItem&gt;toothbrush&lt;/orderItem&gt;"/>
<page href="XML.html#setNamespace()" title="XML.setNamespace()" text="setNamespace Sets the namespace associated with the XML object. ns The new namespace. The following example uses the soap namespace defined in one XML object and applies it to the namespace of another XML object (xml2): var xml1:XML = &lt;soap:Envelope xmlns:soap=&quot;http://www.w3.org/2001/12/soap-envelope&quot; soap:encodingStyle=&quot;http://www.w3.org/2001/12/soap-encoding&quot;&gt; &lt;!-- ... --&gt; &lt;/soap:Envelope&gt;; var ns:Namespace = xml1.namespace(&quot;soap&quot;); var xml2:XML = &lt;Envelope&gt; &lt;Body/&gt; &lt;/Envelope&gt;; xml2.setNamespace(ns); trace(xml2);"/>
<page href="XML.html#setSettings()" title="XML.setSettings()" text="setSettings Sets values for the following XML properties: ignoreComments, ignoreProcessingInstructions, ignoreWhitespace, prettyIndent, and prettyPrinting. The following are the default settings, which are applied if no setObj parameter is provided: XML.ignoreComments = true XML.ignoreProcessingInstructions = true XML.ignoreWhitespace = true XML.prettyIndent = 2 XML.prettyPrinting = true Note: You do not apply this method to an instance of the XML class; you apply it to XML, as in the following code: XML.setSettings(). rest An object with each of the following properties: ignoreComments ignoreProcessingInstructions ignoreWhitespace prettyIndent prettyPrinting The following example shows: how to apply some custom settings (for including comments and processing instructions) prior to setting an XML object; how to then revert back to the default settings before setting another XML object; and then how to set the custom settings again (for setting any more XML objects): XML.ignoreComments = false; XML.ignoreProcessingInstructions = false; var customSettings:Object = XML.settings(); var xml1:XML = &lt;foo&gt; &lt;!-- comment --&gt; &lt;?instruction ?&gt; &lt;/foo&gt;; trace(xml1.toXMLString()); // &lt;foo&gt; // &lt;!-- comment --&gt; // &lt;?instruction ?&gt; // &lt;/foo&gt; XML.setSettings(XML.defaultSettings()); var xml2:XML = &lt;foo&gt; &lt;!-- comment --&gt; &lt;?instruction ?&gt; &lt;/foo&gt;; trace(xml2.toXMLString());"/>
<page href="XML.html#settings()" title="XML.settings()" text="settings Retrieves the following properties: ignoreComments, ignoreProcessingInstructions, ignoreWhitespace, prettyIndent, and prettyPrinting. The following example shows: how to apply some custom settings (for including comments and processing instructions) prior to setting an XML object; how to then revert back to the default settings before setting another XML object; and then how to set the custom settings again (for setting any more XML objects): XML.ignoreComments = false; XML.ignoreProcessingInstructions = false; var customSettings:Object = XML.settings(); var xml1:XML = &lt;foo&gt; &lt;!-- comment --&gt; &lt;?instruction ?&gt; &lt;/foo&gt;; trace(xml1.toXMLString()); // &lt;foo&gt; // &lt;!-- comment --&gt; // &lt;?instruction ?&gt; // &lt;/foo&gt; XML.setSettings(XML.defaultSettings()); var xml2:XML = &lt;foo&gt; &lt;!-- comment --&gt; &lt;?instruction ?&gt; &lt;/foo&gt;; trace(xml2.toXMLString());"/>
<page href="XML.html#text()" title="XML.text()" text="text Returns an XMLList object of all XML properties of the XML object that represent XML text nodes. The following example uses the text() method to get the text nodes of an XML object: var xml:XML = &lt;body&gt; text1 &lt;hr/&gt; text2 &lt;/body&gt;; trace(xml.text()[0]); // text1 trace(xml.text()[1]); // text2"/>
<page href="XML.html#toString()" title="XML.toString()" text="toString Returns a string representation of the XML object. The rules for this conversion depend on whether the XML object has simple content or complex content: If the XML object has simple content, toString() returns the String contents of the XML object with the following stripped out: the start tag, attributes, namespace declarations, and end tag. If the XML object has complex content, toString() returns an XML encoded String representing the entire XML object, including the start tag, attributes, namespace declarations, and end tag. To return the entire XML object every time, use toXMLString(). The following example shows what the toString() method returns when the XML object has simple content: var test:XML = &lt;type name=&quot;Joe&quot;&gt;example&lt;/type&gt;; trace(test.toString()); //example"/>
<page href="XML.html#toXMLString()" title="XML.toXMLString()" text="toXMLString Returns a string representation of the XML object. Unlike the toString() method, the toXMLString() method always returns the start tag, attributes, and end tag of the XML object, regardless of whether the XML object has simple content or complex content. (The toString() method strips out these items for XML objects that contain simple content.) The following example shows the difference between using the toString() method (which is applied to all parameters of a trace() method, by default) and using the toXMLString() method: var xml:XML = &lt;p&gt;hello&lt;/p&gt;; trace(xml); // hello trace(xml.toXMLString()); // &lt;p&gt;hello&lt;/p&gt;"/>
<page href="XML.html#valueOf()" title="XML.valueOf()" text="valueOf Returns the XML object. The following example shows that the value returned by the valueOf() method is the same as the source XML object: var xml:XML = &lt;p&gt;hello&lt;/p&gt;; trace(xml.valueOf() === xml); // true"/>
<page href="XML.html#ignoreComments" title="XML.ignoreComments" text="ignoreComments Determines whether XML comments are ignored when XML objects parse the source XML data. By default, the comments are ignored (true). To include XML comments, set this property to false. The ignoreComments property is used only during the XML parsing, not during the call to any method such as myXMLObject.child(~~).toXMLString(). If the source XML includes comment nodes, they are kept or discarded during the XML parsing. This example shows the effect of setting XML.ignoreComments to false and to true: XML.ignoreComments = false; var xml1:XML = &lt;foo&gt; &lt;!-- comment --&gt; &lt;/foo&gt;; trace(xml1.toXMLString()); // &lt;foo&gt;&lt;!-- comment --&gt;&lt;/foo&gt; XML.ignoreComments = true; var xml2:XML = &lt;foo&gt; &lt;!-- example --&gt; &lt;/foo&gt;; trace(xml2.toXMLString()); // &lt;foo/&gt;"/>
<page href="XML.html#ignoreProcessingInstructions" title="XML.ignoreProcessingInstructions" text="ignoreProcessingInstructions Determines whether XML processing instructions are ignored when XML objects parse the source XML data. By default, the processing instructions are ignored (true). To include XML processing instructions, set this property to false. The ignoreProcessingInstructions property is used only during the XML parsing, not during the call to any method such as myXMLObject.child(~~).toXMLString(). If the source XML includes processing instructions nodes, they are kept or discarded during the XML parsing. This example shows the effect of setting XML.ignoreProcessingInstructions to false and to true: XML.ignoreProcessingInstructions = false; var xml1:XML = &lt;foo&gt; &lt;?exampleInstruction ?&gt; &lt;/foo&gt;; trace(xml1.toXMLString()); // &lt;foo&gt;&lt;?exampleInstruction ?&gt;&lt;/foo&gt; XML.ignoreProcessingInstructions = true; var xml2:XML = &lt;foo&gt; &lt;?exampleInstruction ?&gt; &lt;/foo&gt;; trace(xml2.toXMLString()); // &lt;foo/&gt;"/>
<page href="XML.html#ignoreWhitespace" title="XML.ignoreWhitespace" text="ignoreWhitespace Determines whether white space characters at the beginning and end of text nodes are ignored during parsing. By default, white space is ignored (true). If a text node is 100% white space and the ignoreWhitespace property is set to true, then the node is not created. To show white space in a text node, set the ignoreWhitespace property to false. This example shows the effect of setting XML.ignoreWhitespace to false and to true: XML.ignoreWhitespace = false; var xml1:XML = &lt;foo&gt; &lt;/foo&gt;; trace(xml1.children().length()); // 1 XML.ignoreWhitespace = true; var xml2:XML = &lt;foo&gt; &lt;/foo&gt;; trace(xml2.children().length()); // 0"/>
<page href="XML.html#prettyIndent" title="XML.prettyIndent" text="prettyIndent Determines the amount of indentation applied by the toString() and toXMLString() methods when the XML.prettyPrinting property is set to true. Indentation is applied with the space character, not the tab character. The default value is 2. This example shows the effect of setting the XML.prettyIndent static property: var xml:XML = &lt;foo&gt;&lt;bar/&gt;&lt;/foo&gt;; XML.prettyIndent = 0; trace(xml.toXMLString()); XML.prettyIndent = 1; trace(xml.toXMLString()); XML.prettyIndent = 2; trace(xml.toXMLString());"/>
<page href="XML.html#prettyPrinting" title="XML.prettyPrinting" text="prettyPrinting Determines whether the toString() and toXMLString() methods normalize white space characters between some tags. The default value is true. This example shows the effect of setting XML.prettyPrinting static property: var xml:XML = &lt;foo&gt;&lt;bar/&gt;&lt;/foo&gt;; XML.prettyPrinting = false; trace(xml.toXMLString()); XML.prettyPrinting = true; trace(xml.toXMLString());"/>
<page href="Object.html" title="Object class" text="Object The Object class is at the root of the ActionScript class hierarchy. Objects are created by constructors using the new operator syntax, and can have properties assigned to them dynamically. Objects can also be created by assigning an object literal, as in: var obj:Object = {a:&quot;foo&quot;, b:&quot;bar&quot;} All classes that don't declare an explicit base class extend the built-in Object class. You can use the Object class to create associative arrays. 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 using the Object data type 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: John trace(myAssocArray[&quot;lname&quot;]); // Output: Public myAssocArray.initial = &quot;Q&quot;; trace(myAssocArray.initial); // Output: Q ActionScript 3.0 has two types of inheritance: class inheritance and prototype inheritance: Class inheritance - is the primary inheritance mechanism and supports inheritance of fixed properties. A fixed property is a variable, constant or method declared as part of a class definition. Every class definition is now represented by a special class object that stores information about the class. Prototype inheritance - is the only inheritance mechanism in previous versions of ActionScript and serves as an alternate form of inheritance in ActionScript 3.0. Each class has an associated prototype object, and the properties of the prototype object are shared by all instances of the class. When a class instance is created, it has a reference to its class's prototype object, which serves as a link between the instance and its associated class prototype object. At run time, when a property is not found on a class instance, the delegate, which is the class prototype object, is checked for that property. If the prototype object does not contain the property, the process continues with the prototype object's delegate checking in consecutively higher levels in the hierarchy until Flash Player finds the property. Both class inheritance and prototype inheritance can exist simultaneously, as shown in the following example: class A { var x = 1 prototype.px = 2 } dynamic class B extends A { var y = 3 prototype.py = 4 } var b = new B() b.x // 1 via class inheritance b.px // 2 via prototype inheritance from A.prototype b.y // 3 b.py // 4 via prototype inheritance from B.prototype B.prototype.px = 5 b.px // now 5 because B.prototype hides A.prototype b.px = 6 b.px // now 6 because b hides B.prototype Using functions instead of classes, you can construct custom prototype inheritance trees. With classes, the prototype inheritance tree mirrors the class inheritance tree. However, since the prototype objects are dynamic, you can add and delete prototype-based properties at run time."/>
<page href="Object.html#Object()" title="Object.Object()" text="Object Creates an Object object and stores a reference to the object's constructor method in the object's constructor property."/>
<page href="Object.html#hasOwnProperty()" title="Object.hasOwnProperty()" text="hasOwnProperty Indicates 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. The following types of properties cause this method to return true for objects that are instances of a class (as opposed to class objects): Fixed instance properties—variables, constants, or methods defined by the object's class that are not static; Inherited fixed instance properties—variables, constants, or methods inherited by the object's class; Dynamic properties—properties added to an object after it is instantiated (outside of its class definition). To add dynamic properties, the object's defining class must be declared with the dynamic keyword. The following types of properties cause this method to return false for objects that are instances of a class: Static properties—variables, constants, or methods defined with the static keyword in an object's defining class or any of its superclasses; Prototype properties—properties defined on a prototype object that is part of the object's prototype chain. In ActionScript 3.0, the prototype chain is not used for class inheritance, but still exists as an alternative form of inheritance. For example, an instance of the Array class can access the valueOf() method because it exists on Object.prototype, which is part of the prototype chain for the Array class. Although you can use valueOf() on an instance of Array, the return value of hasOwnProperty(&quot;valueOf&quot;) for that instance is false. ActionScript 3.0 also has class objects, which are direct representations of class definitions. When called on class objects, the hasOwnProperty() method returns true only if a property is a static property defined on that class object. For example, if you create a subclass of Array named CustomArray, and define a static property in CustomArray named foo, a call to CustomArray.hasOwnProperty(&quot;foo&quot;) returns true. For the static property DESCENDING defined in the Array class, however, a call to CustomArray.hasOwnProperty(&quot;DESCENDING&quot;) returns false. Note: Methods of the Object class are dynamically created on Object's prototype. To redefine this method in a subclass of Object, do not use the override keyword. For example, A subclass of Object implements function hasOwnProperty():Boolean instead of using an override of the base class. name The property of the object."/>
<page href="Object.html#isPrototypeOf()" title="Object.isPrototypeOf()" text="isPrototypeOf Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. This method returns true if the object is in the prototype chain of the object specified by the theClass parameter. The method returns false if the target object is absent from the prototype chain of the theClass object, and also if the theClass parameter is not an object. Note: Methods of the Object class are dynamically created on Object's prototype. To redefine this method in a subclass of Object, do not use the override keyword. For example, A subclass of Object implements function isPrototypeOf():Boolean instead of using an override of the base class. theClass The class to which the specified object may refer."/>
<page href="Object.html#propertyIsEnumerable()" title="Object.propertyIsEnumerable()" text="propertyIsEnumerable Indicates 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's prototype chain. Properties that you create are enumerable, but built-in properties are generally not enumerable. Note: Methods of the Object class are dynamically created on Object's prototype. To redefine this method in a subclass of Object, do not use the override keyword. For example, A subclass of Object implements function propertyIsEnumerable():Boolean instead of using an override of the base class. name The property of the object."/>
<page href="Object.html#setPropertyIsEnumerable()" title="Object.setPropertyIsEnumerable()" text="setPropertyIsEnumerable Sets the availability of a dynamic property for loop operations. The property must exist on the target object because this method does not check the target object's prototype chain. name isEnum The property of the object. If set to false, the dynamic property does not show up in for..in loops, and the method propertyIsEnumerable() returns false."/>
<page href="Object.html#toString()" title="Object.toString()" text="toString Returns the string representation of the specified object. Note: Methods of the Object class are dynamically created on Object's prototype. To redefine this method in a subclass of Object, do not use the override keyword. For example, A subclass of Object implements function toString():String instead of using an override of the base class."/>
<page href="Object.html#valueOf()" title="Object.valueOf()" text="valueOf Returns the primitive value of the specified object. If this object does not have a primitive value, the object itself is returned. Note: Methods of the Object class are dynamically created on Object's prototype. To redefine this method in a subclass of Object, do not use the override keyword. For example, A subclass of Object implements function valueOf():Object instead of using an override of the base class."/>
<page href="Object.html#constructor" title="Object.constructor" text="constructor A reference to the class object or constructor function for a given object instance. If an object is an instance of a class, the constructor property holds a reference to the class object. If an object is created with a constructor function, the constructor property holds a reference to the constructor function. Do not confuse a constructor function with a constructor method of a class. A constructor function is a Function object used to create objects, and is an alternative to using the class keyword for defining classes. If you use the class keyword to define a class, the class's prototype object is assigned a property named constructor that holds a reference to the class object. An instance of the class inherits this property from the prototype object. For example, the following code creates a new class, A, and a class instance named myA: dynamic class A {} trace(A.prototype.constructor); // [class A] trace(A.prototype.constructor == A); // true var myA:A = new A(); trace(myA.constructor == A); // true Advanced users may choose to use the function keyword instead of the class keyword to define a Function object that can be used as a template for creating objects. Such a function is called a constructor function because you can use it in conjunction with the new operator to create objects. If you use the function keyword to create a constructor function, its prototype object is assigned a property named constructor that holds a reference to the constructor function. If you then use the constructor function to create an object, the object inherits the constructor property from the constructor function's prototype object. For example, the following code creates a new constructor function, f, and an object named myF: function f() {} trace(f.prototype.constructor); // function Function() {} trace(f.prototype.constructor == f); // true var myF = new f(); trace(myF.constructor == f); // true Note: The constructor property is writable, which means that user code can change its value with an assignment statement. Changing the value of the constructor property is not recommended, but if you write code that depends on the value of the constructor property, you should ensure that the value is not reset. The value can be changed only when the property is accessed through the prototype object (for example, className.prototype.constructor)."/>
<page href="Object.html#prototype" title="Object.prototype" text="prototype A reference to the prototype object of a class or function object. The prototype property is automatically created and attached to any class or function object that you create. This property is static in that it is specific to the class or function that you create. For example, if you create a 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 class cannot directly access the prototype property. A class's prototype object is a special instance of that class that provides a mechanism for sharing state across all instances of a class. At run time, when a property is not found on a class instance, the delegate, which is the class prototype object, is checked for that property. If the prototype object does not contain the property, the process continues with the prototype object's delegate checking in consecutively higher levels in the hierarchy until Flash Player finds the property. Note: In ActionScript 3.0, prototype inheritance is not the primary mechanism for inheritance. Class inheritance, which drives the inheritance of fixed properties in class definitions, is the primary inheritance mechanism in ActionScript 3.0."/>
<page href="ArgumentError.html" title="ArgumentError class" text="ArgumentError The ArgumentError class represents an error that occurs when the arguments supplied in a function do not match the arguments defined for that function. This error occurs, for example, when a function is called with the wrong number of arguments, an argument of the incorrect type, or an invalid argument."/>
<page href="ArgumentError.html#ArgumentError()" title="ArgumentError.ArgumentError()" text="ArgumentError Creates an ArgumentError object. message A string associated with the error."/>
<page href="VerifyError.html" title="VerifyError class" text="VerifyError The VerifyError class represents an error that occurs when a malformed or corrupted SWF file is encountered."/>
<page href="VerifyError.html#VerifyError()" title="VerifyError.VerifyError()" text="VerifyError Creates a new VerifyError object. message Contains the message associated with the VerifyError object."/>
<page href="flash/text/Font.html" title="Font class" text="Font The Font class is used to manage embedded fonts in SWF files. Embedded fonts are represented as a subclass of the Font class. The Font class is currently useful only to find out information about embedded fonts; you cannot alter a font by using this class. You cannot use the Font class to load external fonts, or to create an instance of a Font object by itself. Use the Font class as an abstract base class."/>
<page href="flash/text/Font.html#enumerateFonts()" title="Font.enumerateFonts()" text="enumerateFonts Specifies whether to provide a list of the currently available embedded fonts. enumerateDeviceFonts Indicates whether you want to limit the list to only the currently available embedded fonts. If this is set to true then a list of all fonts, both device fonts and embedded fonts, is returned. If this is set to false then only a list of embedded fonts is returned. This example first calls the static method Font.enumerateFonts() to get a list of all device and embedded fonts. Then it sorts the resulting Array of Font objects by the fontName property. Next the example shows how to call the Font.enumerateFonts() method with the enumerateDeviceFonts parameter set to false. The resulting Array only includes embedded Font objects. (If you run this code within an application that does not contain any embedded fonts, the embeddedFonts array will be empty.) import flash.text.Font; var allFonts:Array = Font.enumerateFonts(true); allFonts.sortOn(&quot;fontName&quot;, Array.CASEINSENSITIVE); var embeddedFonts:Array = Font.enumerateFonts(false); embeddedFonts.sortOn(&quot;fontName&quot;, Array.CASEINSENSITIVE);"/>
<page href="flash/text/Font.html#hasGlyphs()" title="Font.hasGlyphs()" text="hasGlyphs Specifies whether a provided string can be displayed using the currently assigned font. str The string to test against the current font."/>
<page href="flash/text/Font.html#registerFont()" title="Font.registerFont()" text="registerFont Registers a font class in the global font list. font The class you want to add to the global font list."/>
<page href="flash/text/Font.html#fontName" title="Font.fontName" text="fontName The name of an embedded font."/>
<page href="flash/text/Font.html#fontStyle" title="Font.fontStyle" text="fontStyle The style of the font. This value can be any of the values defined in the FontStyle class."/>
<page href="flash/text/Font.html#fontType" title="Font.fontType" text="fontType The type of the font. This value can be any of the constants defined in the FontType class."/>
<page href="flash/text/StyleSheet.html" title="StyleSheet class" text="StyleSheet The StyleSheet class lets you create a StyleSheet object that contains text formatting rules for font size, color, and other styles. You can then apply styles defined by a style sheet to a TextField object that contains HTML- or XML-formatted text. The text in the TextField object is automatically formatted according to the tag styles defined by the StyleSheet object. You can use text styles to define new formatting tags, redefine built-in HTML tags, or create style classes that you can apply to certain HTML tags. To apply styles to a TextField object, assign the StyleSheet object to a TextField object's styleSheet property. Note: A text field with a style sheet is not editable. In other words, a text field with the type property set to TextFieldType.INPUT applies the StyleSheet to the default text for the text field, but the content will no longer be editable by the user. Consider using the TextFormat class to assign styles to input text fields. Flash Player supports a subset of properties in the original CSS1 specification (www.w3.org/TR/REC-CSS1). The following table shows the supported Cascading Style Sheet (CSS) properties and values, as well as their corresponding ActionScript property names. (Each ActionScript property name is derived from the corresponding CSS property name; if the name contains a hyphen, the hyphen is omitted and the subsequent character is capitalized.) CSS property ActionScript property Usage and supported values color color Only hexadecimal color values are supported. Named colors (such as blue) are not supported. Colors are written in the following format: #FF0000. display display Supported values are inline, block, and none. font-family fontFamily A comma-separated list of fonts to use, in descending order of desirability. Any font family name can be used. If you specify a generic font name, it is converted to an appropriate device font. The following font conversions are available: mono is converted to _typewriter, sans-serif is converted to _sans, and serif is converted to _serif. font-size fontSize Only the numeric part of the value is used. Units (px, pt) are not parsed; pixels and points are equivalent. font-style fontStyle Recognized values are normal and italic. font-weight fontWeight Recognized values are normal and bold. kerning kerning Recognized values are true and false. Kerning is supported for embedded fonts only. Certain fonts, such as Courier New, do not support kerning. The kerning property is only supported in SWF files created in Windows, not in SWF files created on the Macintosh. However, these SWF files can be played in non-Windows versions of Flash Player and the kerning still applies. leading leading The amount of space that is uniformly distributed between lines. The value specifies the number of pixels that are added after each line. A negative value condenses the space between lines. Only the numeric part of the value is used. Units (px, pt) are not parsed; pixels and points are equivalent. letter-spacing letterSpacing The amount of space that is uniformly distributed between characters. The value specifies the number of pixels that are added after each character. A negative value condenses the space between characters. Only the numeric part of the value is used. Units (px, pt) are not parsed; pixels and points are equivalent. margin-left marginLeft Only the numeric part of the value is used. Units (px, pt) are not parsed; pixels and points are equivalent. margin-right marginRight Only the numeric part of the value is used. Units (px, pt) are not parsed; pixels and points are equivalent. text-align textAlign Recognized values are left, center, right, and justify. text-decoration textDecoration Recognized values are none and underline. text-indent textIndent Only the numeric part of the value is used. Units (px, pt) are not parsed; pixels and points are equivalent. You can use the StyleSheet class to perform low-level text rendering. However, in Flex, you typically use the Label, Text, TextArea, and TextInput controls to process text."/>
<page href="flash/text/StyleSheet.html#StyleSheet()" title="StyleSheet.StyleSheet()" text="StyleSheet Creates a new StyleSheet object."/>
<page href="flash/text/StyleSheet.html#clear()" title="StyleSheet.clear()" text="clear Removes all styles from the style sheet object."/>
<page href="flash/text/StyleSheet.html#getStyle()" title="StyleSheet.getStyle()" text="getStyle Returns a copy of the style object associated with the style named styleName. If there is no style object associated with styleName, null is returned. styleName A string that specifies the name of the style to retrieve. Please see the parseCSS() or transform() method's example for illustrations of how to use the getStyle() method."/>
<page href="flash/text/StyleSheet.html#parseCSS()" title="StyleSheet.parseCSS()" text="parseCSS Parses the CSS in CSSText and loads the style sheet with it. If a style in CSSText is already in styleSheet, the properties in styleSheet are retained, and only the ones in CSSText are added or changed in styleSheet. To extend the native CSS parsing capability, you can override this method by creating a subclass of the StyleSheet class. CSSText The CSS text to parse (a string). In the following example, when a user clicks on the text file, CSS styles, loaded from a file, are applied to the content. In the constructor, a multiline text field is created and its content is set to an HTML-formatted string. (Note that the HTML heading and span tags will not be rendered before CSS style is applied.) A URLRequest object is created to identify the location of the CSS file, which for this example is in the same directory as the SWF file. The file is loaded with a URLLoader object. There are two event listeners added for the loader URLLoader object. If an IO error occurs, the errorHandler() method is invoked, which displays an error message in the text field. Once all the data is received and placed in the data property of the loader URLLoader object, the loaderCompleteHandler() method is invoked, which parses the CSS styles from the data loaded from the file and fills the sheet StyleSheet object with them. When the user clicks on the text field, the clickHandler() method is called. The if statement in the clickHandler() method checks to make sure the file loading was finished before applying the style sheet to the text field. In order for the style sheet to take effect, the htmlText property must be reassigned with the content after the style sheet is assigned to the text field. The CSS font-family and the color property values for the heading tag also are appended to the content of the text field. (The values of these properties will be &quot;undefined&quot; if style sheet values are not in effect.) The following is an example of a content of the CSS file that can be used with this example. Before running this example, create a text file, copy the following CSS content into it, then save it with the file name test.css and place it in the same directory as the SWF file. p { font-family: Times New Roman, Times, _serif; font-size: 14; font-Style: italic; margin-left: 10; } h1 { font-family: Arial, Helvetica, _sans; font-size: 20; font-weight: bold; } .bluetext { color: #0000CC; } package { import flash.display.Sprite; import flash.net.URLLoader; import flash.net.URLRequest; import flash.text.StyleSheet; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.events.IOErrorEvent; import flash.events.Event; import flash.events.MouseEvent; public class StyleSheet_parseCSSExample extends Sprite { private var loader:URLLoader = new URLLoader(); private var field:TextField = new TextField(); private var exampleText:String = &quot;&lt;h1&gt;This is a headline&lt;/h1&gt;&quot; + &quot;&lt;p&gt;This is a line of text. &lt;span class='bluetext'&gt;&quot; + &quot;This line of text is colored blue.&lt;/span&gt;&lt;/p&gt;&quot;; private var sheet:StyleSheet = new StyleSheet(); private var cssReady:Boolean = false; public function StyleSheet_parseCSSExample() { field.x = 10; field.y = 10; field.background = true; field.multiline = true; field.autoSize = TextFieldAutoSize.LEFT; field.htmlText = exampleText; field.addEventListener(MouseEvent.CLICK, clickHandler); addChild(field); var req:URLRequest = new URLRequest(&quot;test.css&quot;); loader.load(req); loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler); loader.addEventListener(Event.COMPLETE, loaderCompleteHandler); } public function errorHandler(e:IOErrorEvent):void { field.htmlText = &quot;Couldn't load the style sheet file.&quot;; } public function loaderCompleteHandler(event:Event):void { sheet.parseCSS(loader.data); cssReady = true; } public function clickHandler(e:MouseEvent):void { if (cssReady) { field.styleSheet = sheet; field.htmlText = exampleText; var style:Object = sheet.getStyle(&quot;h1&quot;); field.htmlText += &quot;&lt;p&gt;Headline font-family is: &quot; + style.fontFamily + &quot;&lt;/p&gt;&quot;; field.htmlText += &quot;&lt;p&gt;Headline color is: &quot; + style.color + &quot;&lt;/p&gt;&quot;; } else { field.htmlText = &quot;Couldn't apply the CSS styles.&quot;; } } } }"/>
<page href="flash/text/StyleSheet.html#setStyle()" title="StyleSheet.setStyle()" text="setStyle Adds a new style with the specified name to the style sheet object. If the named style does not already exist in the style sheet, it is added. If the named style already exists in the style sheet, it is replaced. If the styleObject parameter is null, the named style is removed. Flash Player creates a copy of the style object that you pass to this method. For a list of supported styles, see the table in the description for the StyleSheet class. styleName styleObject A string that specifies the name of the style to add to the style sheet. An object that describes the style, or null."/>
<page href="flash/text/StyleSheet.html#transform()" title="StyleSheet.transform()" text="transform Extends the CSS parsing capability. Advanced developers can override this method by extending the StyleSheet class. formatObject An object that describes the style, containing style rules as properties of the object, or null. This example uses the transform() method to apply a style from a CSS file to a TextFormat object for a text field. CSS styles are used usually to format HTML content. However, by using transform() method of a StyleSheet object, specific CSS styles can be assigned to a TextFormat object and then applied to any text field. The URLRequest and URLLoader objects are used to load the CSS file. An event listener is added for the Event.COMPLETE event, which occurs once all the data is received and placed in the data property of the loader URLLoader object. The loaderCompleteHandler() method then parses the CSS from the data loaded from the file and fills the sheet StyleSheet object with the styles. The getStyle() method of the style sheet retrieves the HTML paragraph styles, which are then assigned to the cssFormat TextFormat object using style sheet's transform() method. Finally, the default text format of the inputField text field is set to the new cssFormat text format. package { import flash.display.Sprite; import flash.net.URLLoader; import flash.net.URLRequest; import flash.text.StyleSheet; import flash.text.TextField; import flash.text.TextFormat; import flash.text.TextFieldType; import flash.events.IOErrorEvent; import flash.events.Event; public class StyleSheet_transformExample extends Sprite { private var loader:URLLoader = new URLLoader(); private var inputField:TextField = new TextField(); private var sheet:StyleSheet = new StyleSheet(); public function StyleSheet_transformExample() { inputField.x = 10; inputField.y = 10; inputField.background = true; inputField.width = 300; inputField.height = 200; inputField.wordWrap = true; inputField.multiline = true; inputField.type = TextFieldType.INPUT; addChild(inputField); var req:URLRequest = new URLRequest(&quot;test.css&quot;); loader.load(req); loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler); loader.addEventListener(Event.COMPLETE, loaderCompleteHandler); } public function errorHandler(e:IOErrorEvent):void { inputField.htmlText = &quot;Couldn't load the style sheet file.&quot;; } public function loaderCompleteHandler(event:Event):void { var cssFormat:TextFormat = new TextFormat(); sheet.parseCSS(loader.data); var style:Object = sheet.getStyle(&quot;p&quot;); cssFormat = sheet.transform(style); inputField.defaultTextFormat = cssFormat; } } }"/>
<page href="flash/text/StyleSheet.html#styleNames" title="StyleSheet.styleNames" text="styleNames An array that contains the names (as strings) of all of the styles registered in this style sheet."/>
<page href="flash/text/FontType.html" title="FontType class" text="FontType The FontType class contains the enumerated constants &quot;embedded&quot; and &quot;device&quot; for the fontType property of the Font class."/>
<page href="flash/text/FontType.html#DEVICE" title="FontType.DEVICE" text="DEVICE Indicates that this is a device font. Flash Player uses the fonts installed on the system that is running the SWF file. Using device fonts results in a smaller movie size, because font data is not included in the file. Device fonts are often a good choice for displaying text at small point sizes, because anti-aliased text can be blurry at small sizes. Device fonts are also a good choice for large blocks of text, such as scrolling text. Text fields that use device fonts may not be displayed the same across different systems and platforms, because Flash Player uses the fonts that are installed on the system. For the same reason, device fonts are not anti-aliased and may appear jagged at large point sizes."/>
<page href="flash/text/FontType.html#EMBEDDED" title="FontType.EMBEDDED" text="EMBEDDED Indicates that this is an embedded font. Font outlines are embedded in the published SWF file. Text fields that use embedded fonts are always displayed in the chosen font, whether or not that font is installed on the playback system. Also, text fields that use embedded fonts are always anti-aliased (smoothed) by Flash Player. You can select the amount of anti-aliasing you want by using the TextField.antiAliasType property. One drawback to embedded fonts is that they increase the size of the SWF file."/>
<page href="flash/text/StaticText.html" title="StaticText class" text="StaticText This class represents StaticText objects on the display list. You cannot create a StaticText object using ActionScript. Only the authoring tool can create a StaticText object. An attempt to create a new StaticText object generates an ArgumentError. To create a reference to an existing static text field in ActionScript 3.0, you can iterate over the items in the display list. For example, the following snippet checks to see if the display list contains a static text field and assigns the field to a variable: var i:uint; for (i = 0; i &lt; this.numChildren; i++) { var displayitem:DisplayObject = this.getChildAt(i); if (displayitem instanceof StaticText) { trace(&quot;a static text field is item &quot; + i + &quot; on the display list&quot;); var myFieldLabel:StaticText = StaticText(displayitem); trace(&quot;and contains the text: &quot; + myFieldLabel.text); } }"/>
<page href="flash/text/StaticText.html#text" title="StaticText.text" text="text Returns the current text of the static text field. The authoring tool may export multiple text field objects comprising the complete text. For example, for vertical text, the authoring tool will create one text field per character."/>
<page href="flash/text/TextColorType.html" title="TextColorType class" text="TextColorType The TextColorType class provides color values for the flash.text.TextRenderer class."/>
<page href="flash/text/TextColorType.html#DARK_COLOR" title="TextColorType.DARK_COLOR" text="DARK_COLOR Used in the colorType parameter in the setAdvancedAntiAliasingTable() method. Use the syntax TextColorType.DARK_COLOR."/>
<page href="flash/text/TextColorType.html#LIGHT_COLOR" title="TextColorType.LIGHT_COLOR" text="LIGHT_COLOR Used in the colorType parameter in the setAdvancedAntiAliasingTable() method. Use the syntax TextColorType.LIGHT_COLOR."/>
<page href="flash/text/GridFitType.html" title="GridFitType class" text="GridFitType The GridFitType class defines values for grid fitting in the TextField class."/>
<page href="flash/text/GridFitType.html#NONE" title="GridFitType.NONE" text="NONE Doesn't set grid fitting. Horizontal and vertical lines in the glyphs are not forced to the pixel grid. This constant is used in setting the gridFitType property of the TextField class. This is often a good setting for animation or for large font sizes. Use the syntax GridFitType.NONE."/>
<page href="flash/text/GridFitType.html#PIXEL" title="GridFitType.PIXEL" text="PIXEL Fits strong horizontal and vertical lines to the pixel grid. This constant is used in setting the gridFitType property of the TextField class. This setting only works for left-justified text fields and acts like the GridFitType.SUBPIXEL constant in static text. This setting generally provides the best readability for left-aligned text. Use the syntax GridFitType.PIXEL."/>
<page href="flash/text/GridFitType.html#SUBPIXEL" title="GridFitType.SUBPIXEL" text="SUBPIXEL Fits strong horizontal and vertical lines to the sub-pixel grid on LCD monitors. (Red, green, and blue are actual pixels on an LCD screen.) This is often a good setting for right-aligned or center-aligned dynamic text, and it is sometimes a useful tradeoff for animation vs. text quality. This constant is used in setting the gridFitType property of the TextField class. Use the syntax GridFitType.SUBPIXEL."/>
<page href="flash/text/TextField.html" title="TextField class" text="TextField The TextField class is used to create display objects for text display and input. All dynamic and input text fields in a SWF file are instances of the TextField class. You can use the TextField class to perform low-level text rendering. However, in Flex, you typically use the Label, Text, TextArea, and TextInput controls to process text. 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, use the TextField() constructor. 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. ActionScript provides several ways to format your text at runtime. The TextFormat class lets you set character and paragraph formatting for TextField objects. You can apply Cascading Style Sheets (CSS) styles to text fields by using the TextField.styleSheet property and the StyleSheet class. You can use CSS to style built-in HTML tags, define new formatting tags, or apply styles. You can assign HTML formatted text, which might optionally use CSS styles, directly to a text field. HTML text that you assign to a text field can contain embedded media (movie clips, SWF files, GIF files, PNG files, and JPEG files). The text wraps around the embedded media in the same way that a web browser wraps text around media embedded in an HTML document. Flash Player supports a subset of HTML tags that you can use to format text. See the list of supported HTML tags in the description of the htmlText property."/>
<page href="flash/text/TextField.html#TextField()" title="TextField.TextField()" text="TextField Creates a new TextField instance. After you create the TextField instance, call the addChild() or addChildAt() method of the parent DisplayObjectContainer object to add the TextField instance to the display list. The default size for a text field is 100 x 100 pixels."/>
<page href="flash/text/TextField.html#appendText()" title="TextField.appendText()" text="appendText Appends the string specified by the newText parameter to the end of the text of the text field. This method is more efficient than an addition assignment (+=) on a text property (such as someTextField.text += moreText), particularly for a text field that contains a significant amount of content. newText The string to append to the existing text. The following example displays the time if it's not the weekend or the text, &quot;It's the weekend,&quot; if it is. It also counts the number of characters up to a certain position and the number of lines in the text field. The outputText text field is set to automatically fit the text and to resize as a left-justified text using autoSize property. The outputText.text property writes the first line of the content and the method appendText() appends the rest of the content. (It is not necessary to start with the text property. The appendText() method could also be used to append text from the outset.) Setting the text property a second time will overwrite the original text. Use += operator to append content with the text property. The if statement checks if the date is Saturday (6) or Sunday (0). If it's not, the toLocaleTimeString() method returns the local time, which is appended to the text field's content. The text field's length property is used to read the number of characters until right before the function is called, and the property numLines is used to count the number of lines in the text field. Note that the empty lines are counted in the number of lines and the empty spaces and line breaks (\n) are counted in determining the content length. package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFieldAutoSize; public class TextField_appendTextExample extends Sprite { public function TextField_appendTextExample() { var outputText:TextField = new TextField(); var today:Date = new Date(); outputText.x = 10; outputText.y = 10; outputText.background = true; outputText.autoSize = TextFieldAutoSize.LEFT; outputText.text = &quot;WHAT TIME IS IT?&quot; + &quot;\n\n&quot;; if((today.day == 0) || (today.day == 6)) { outputText.appendText(&quot;It's the weekend.&quot;); outputText.appendText(&quot;\n\n&quot;); } else { outputText.appendText(&quot;The time is: &quot;); outputText.appendText(today.toLocaleTimeString() + &quot;.\n\n&quot;); } outputText.appendText(&quot;Number of characters including line breaks and spaces so far: &quot;); outputText.appendText(outputText.length.toString() + &quot;\n&quot;); outputText.appendText(&quot;Number of lines in the outputText: &quot;); outputText.appendText(outputText.numLines.toString()); this.addChild(outputText); } } }"/>
<page href="flash/text/TextField.html#getCharBoundaries()" title="TextField.getCharBoundaries()" text="getCharBoundaries Returns a rectangle that is the bounding box of the character. charIndex The zero-based index value for the character (for example, the first position is 0, the second position is 1, and so on). In the following example the getCharBoundaries() method is used to mark (put a spotlight on) a character that is selected by the user. The class defines the spotlight Shape object that will be used to draw a rectangle around each character that is selected. When the user clicks on the myTextField text field, the clickHandler() method is invoked. In the clickHandler() method, the getCharIndexAtPoint() method gets the clicked character's index based on the localX and localY coordinates of the mouse click, which is relative to the containing Sprite. The getCharIndexAtPoint() method returns -1 if the point (mouse click) was not over any character. Since the text field could be larger than the text, the returned integer (index) is checked to make sure the user has clicked on a character. The index integer is also used by getCharBoundaries() to get a Rectangle object that holds the boundary of the character. The clear() method clears any previously displayed spotlight Shape object. A new rectangle the size of the character's width and height boundaries is produced at the location of the character (offset from the (10, 10) coordinates) using the returned frame rectangle's x and y coordinates. To put the spotlight on the character, the spotlight Shape object is filled with color yellow and the opacity is set to 35 percent, so the character can be seen. Note that spaces are also considered a character. package { import flash.display.Sprite; import flash.events.MouseEvent; import flash.text.TextField; import flash.geom.Rectangle; import flash.events.MouseEvent; import flash.text.TextFieldAutoSize; import flash.display.Shape; public class TextField_getCharBoundariesExample extends Sprite { private var myTextField:TextField = new TextField(); private var spotlight:Shape = new Shape(); public function TextField_getCharBoundariesExample() { myTextField.x = 10; myTextField.y = 10; myTextField.border = true; myTextField.selectable = false; myTextField.autoSize = TextFieldAutoSize.LEFT; myTextField.text = &quot;Selected a character from this text by clicking on it.&quot; myTextField.addEventListener(MouseEvent.CLICK, clickHandler); this.addChild(myTextField); this.addChild(spotlight); } private function clickHandler (e:MouseEvent):void { var index:int = myTextField.getCharIndexAtPoint(e.localX, e.localY); if (index != -1) { var frame:Rectangle = myTextField.getCharBoundaries(index); spotlight.graphics.clear(); spotlight.graphics.beginFill(0xFFFF00, .35); spotlight.graphics.drawRect((frame.x + 10), (frame.y + 10), frame.width, frame.height); spotlight.graphics.endFill(); } } } }"/>
<page href="flash/text/TextField.html#getCharIndexAtPoint()" title="TextField.getCharIndexAtPoint()" text="getCharIndexAtPoint Returns the zero-based index value of the character at the point specified by the x and y parameters. x y The x coordinate of the character. The y coordinate of the character. In the following example, when a user clicked on a character, the character is echoed in another text field above the text. The first text field holds the text the user is going to select. In order to make sure the text is clicked but not selected, selectable property is set to false. When the user clicks on the firstTextField text field, the clickHandler() method is invoked. In the clickHandler() method, the getCharIndexAtPoint() method returns the character's index based on the localX and localY coordinates of the mouse click. Since the text field could be larger than the text, the return integer (index) is checked to make sure the user has clicked on a character. (The getCharIndexAtPoint() method returns -1, if the point (mouse click) was not over a character.) The mouse coordinates is used to set the coordinates of the new text field where the echoed character will appear. The color of the character in the second text field is set to red. Finally the text of the second field is set to the selected character, which is retrieved using the charAt() method. Note that using the text property instead of the appendText() method will overwrite the character in the second text field, instead of appending it. package { import flash.display.Sprite; import flash.events.MouseEvent; import flash.text.TextField; import flash.geom.Rectangle; import flash.events.MouseEvent; import flash.text.TextFieldAutoSize; public class TextField_getCharIndexAtPointExample extends Sprite { private var firstTextField:TextField = new TextField(); private var secondTextField:TextField = new TextField(); public function TextField_getCharIndexAtPointExample() { firstTextField.x = 100; firstTextField.y = 100; firstTextField.width = 260; firstTextField.height = 20; firstTextField.border = true; firstTextField.background = true; firstTextField.selectable = false; firstTextField.text = &quot;Selected a character from this text by clicking on it.&quot; firstTextField.addEventListener(MouseEvent.CLICK, clickHandler); this.addChild(firstTextField); this.addChild(secondTextField); } private function clickHandler (e:MouseEvent):void { var index:int = firstTextField.getCharIndexAtPoint(e.localX, e.localY); if (index != -1) { secondTextField.x = mouseX; secondTextField.y = 70; secondTextField.border = true; secondTextField.selectable = false; secondTextField.background = true; secondTextField.textColor = 0xFF0000; secondTextField.autoSize = TextFieldAutoSize.LEFT; secondTextField.text = firstTextField.text.charAt(index); } } } }"/>
<page href="flash/text/TextField.html#getFirstCharInParagraph()" title="TextField.getFirstCharInParagraph()" text="getFirstCharInParagraph Given a character index, returns the index of the first character in the same paragraph. charIndex The zero-based index value of the character (for example, the first character is 0, the second character is 1, and so on). In the following example, paragraph formatting is applied to the text field content. When the user clicks on a paragraph, the text of the paragraph will be aligned right and when the user clicks on the paragraph again, it will return to the original (default) format (left-align). In the constructor, the myTextField text field is set to text wrap. The getTextFormat method returns the original format of the first character of the content of the text field, which is placed in the originalFormat TextFormat object. A new TextFormat object (newFormat) is also defined and its align property is assigned to right-justified. When the user clicks on the text field, the clickHandler() method is invoked. In the clickHandler() method, the getCharIndexAtPoint() method returns the character's index based on the localX and localY coordinates of the mouse click. The first if statement checks to see if the use has clicked on a character. Using the clickIndex integer returned by the getCharIndexAtPoint() method, the getFirstCharInParagraph() method returns the index of the first character in the paragraph the user has clicked. The index of the last character in the paragraph is determined by adding the length of the paragraph (using getParagraphLength() method) to the index of the first character in the paragraph, minus the last character (\n). The second if statement checks the format of the first character in the paragraph. If its alignment value is the same as the original format (left-justified), the new format is applied to all the characters in the paragraph. Otherwise, the format of the paragraph is set back to the original format. Alignment, along with formatting like indent, bullet, tab stop, left and right margin are formats that are meant for paragraphs. Note that once word wrap or line break is used, the formatting will only apply to the first line of the paragraph if endIndex argument is not defined for the setTextFormat() method. package { import flash.display.Sprite; import flash.text.TextField; import flash.events.MouseEvent; import flash.text.TextFormat; import flash.text.TextFormatAlign; public class TextField_getFirstCharInParagraphExample extends Sprite { private var myTextField:TextField = new TextField(); private var originalFormat:TextFormat = new TextFormat(); private var newFormat:TextFormat = new TextFormat(); public function TextField_getFirstCharInParagraphExample() { myTextField.x = 10; myTextField.y = 10; myTextField.border = true; myTextField.wordWrap = true; myTextField.width = 300; myTextField.height = 300; myTextField.background = true; myTextField.appendText(&quot;The TextField class is used to create display objects for &quot; + &quot;text display and input. All dynamic and input text fields in a SWF file &quot; + &quot;are instances of the TextField class. You can use the TextField class &quot; + &quot;to perform low-level text rendering. However, in Flex, you typically use &quot; + &quot;the Label, Text, TextArea, and TextInput controls to process text. &quot; + &quot;You can give a text field an instance name in the Property inspector &quot; + &quot;and use the methods and properties of the TextField class to manipulate it with ActionScript. &quot; + &quot;TextField instance names are displayed in the Movie Explorer and in the Insert &quot; + &quot;Target Path dialog box in the Actions panel.\n\n&quot; + &quot;To create a text field dynamically, use the TextField constructor.\n\n&quot; + &quot;The methods of the TextField class let you set, select, and manipulate &quot; + &quot;text in a dynamic or input text field that you create during authoring or at runtime.\n\n&quot;); originalFormat = myTextField.getTextFormat(0); newFormat.align = TextFormatAlign.RIGHT; myTextField.addEventListener(MouseEvent.CLICK, clickHandler); this.addChild(myTextField); } private function clickHandler(e:MouseEvent):void { var clickIndex:int = myTextField.getCharIndexAtPoint(e.localX, e.localY); if(clickIndex != -1) { var paragraphFirstIndex:int = myTextField.getFirstCharInParagraph(clickIndex); var paragraphEndIndex:int = paragraphFirstIndex + ((myTextField.getParagraphLength(clickIndex) - 1)); if (myTextField.getTextFormat(paragraphFirstIndex).align == originalFormat.align) { myTextField.setTextFormat(newFormat, paragraphFirstIndex, paragraphEndIndex); }else { myTextField.setTextFormat(originalFormat, paragraphFirstIndex, paragraphEndIndex); } } } } } The character index specified is out of range."/>
<page href="flash/text/TextField.html#getImageReference()" title="TextField.getImageReference()" text="getImageReference Returns a DisplayObject reference for the given id, for an image or SWF file that has been added to an HTML-formatted text field by using an &lt;img&gt; tag. The &lt;img&gt; tag is in the following format: &lt;img src = 'filename.jpg' id = 'instanceName' &gt; id The id to match (in the id attribute of the &lt;img&gt; tag). In the following example, when the text field is clicked, the image in the field is set to 25 percent opacity and it rotates 90 degrees from its original rotation. The image will continue to rotate with each subsequent click. The image (image.jpg) is included via the HTML. (Here it is assumed that an image file is in the same directory as the SWF file.) An id attribute needs to be defined for the img tag in order to access the image using getImageReference() method. The htmlText property is used to include HTML-formatted string content. When the user clicks on the myTextField text field, the clickHandler() method is invoked. In the clickHandler() method, the getImageReference() method returns a reference to the image as a DisplayObject. This reference can be used to manipulate the image, like any DisplayObject object. Here, the alpha (transparency) and rotation properties are set. The transform property can also be used to access the display object's matrix, color transform, and pixel bounds. Note also that flash.display.DisplayObject needs to be imported. package { import flash.display.Sprite; import flash.text.TextField; import flash.events.Event; import flash.events.MouseEvent; import flash.display.DisplayObject; import flash.text.TextFieldAutoSize; public class TextField_getImageReferenceExample extends Sprite { private var myTextField:TextField = new TextField(); public function TextField_getImageReferenceExample() { var myText1:String = &quot;&lt;p&gt;Here is an image we want to mainpulate: &lt;img src='image.jpg' id='testimage'&gt;&lt;/p&gt;&quot;; myTextField.x = 10; myTextField.y = 10; myTextField.width = 250; myTextField.height = 250; myTextField.background = true; myTextField.border = true; myTextField.border = true; myTextField.multiline = true; myTextField.htmlText = myText1; myTextField.addEventListener(MouseEvent.CLICK, clickHandler); this.addChild(myTextField); } private function clickHandler(e:MouseEvent):void { var imageRef:DisplayObject = myTextField.getImageReference(&quot;testimage&quot;); imageRef.rotation += 90; imageRef.x = 125; imageRef.y = 125; imageRef.alpha = 0.25; } } }"/>
<page href="flash/text/TextField.html#getLineIndexAtPoint()" title="TextField.getLineIndexAtPoint()" text="getLineIndexAtPoint Returns the zero-based index value of the line at the point specified by the x and y parameters. x y The x coordinate of the line. The y coordinate of the line. In the following example, when a user selects a line from the Shakespeare's sonnet, it is copied (appended) into a new text field. In the constructor, the poem text field is set not to wrap (since it's a poem). The autoSize property also is used to set the text to automatically fit and to have it resize as a left-justified text. The poemCopy text field is placed under the poem text field. When a user clicks on some line of the poem, the clickHandler() method is invoked. In clickHandler() method, the getLineIndexAtPoint() method returns the line index of where the user has clicked based on the localX and localY coordinates of the mouse click. (Since the original poem fits the size of the text field here, it is not necessary to check for out of range error (RangeError) thrown by getCharIndexAtPoint() method.) The line index is then used to get the content of the line as a string with the getLineText() method, which is then appended to the poemCopy text field content. The copying can go on continuously but after a point, the text will be outside of the range of the viewable poemCopy text field. package { import flash.display.Sprite; import flash.text.TextField; import flash.events.MouseEvent; import flash.text.TextFormat; import flash.text.TextFieldAutoSize; public class TextField_getLineIndexAtPointExample extends Sprite { private var poem:TextField = new TextField(); private var poemCopy:TextField = new TextField(); public function TextField_getLineIndexAtPointExample() { poem.border = true; poem.autoSize = TextFieldAutoSize.LEFT; poem.x = 10; poem.wordWrap = false; poemCopy.height = 250; poemCopy.width = 270; poemCopy.y = 230; poemCopy.x = 10; poemCopy.background = true; poemCopy.border = true; poemCopy.wordWrap = false; poem.appendText(&quot;Let me not to the marriage of true minds\n&quot; + &quot;Admit impediments. love is not love\n&quot; + &quot;Which alters when it alteration finds\n&quot; + &quot;Or bends with the remover to remove:\n&quot; + &quot;O no! it is an ever-fixed mark\n&quot; + &quot;That looks on tempests and is never shaken;\n&quot; + &quot;It is the star to every wandering bark,\n&quot; + &quot;Whose worth's unknown, although his height be taken.\n&quot; + &quot;Love's not Time's fool, though rosy lips and cheeks\n&quot; + &quot;Within his bending sickle's compass come:\n&quot; + &quot;Love alters not with his brief hours and weeks,\n&quot; + &quot;But bears it out even to the edge of doom.\n&quot; + &quot;If this be error and upon me proved,\n&quot; + &quot;I never writ, nor no man ever loved.&quot;); poem.addEventListener(MouseEvent.CLICK, clickHandler); this.addChild(poem); this.addChild(poemCopy); } private function clickHandler(e:MouseEvent):void { var index:int = poem.getLineIndexAtPoint(e.localX, e.localY); var s:String; s = poem.getLineText(index); poemCopy.appendText(s + &quot;\n&quot;); } } }"/>
<page href="flash/text/TextField.html#getLineIndexOfChar()" title="TextField.getLineIndexOfChar()" text="getLineIndexOfChar Returns the zero-based index value of the line containing the character specified by the charIndex parameter. charIndex The zero-based index value of the character (for example, the first character is 0, the second character is 1, and so on). In the following example, the getLineIndexOfChar() method returns the line numbers for the 100th and 500th characters in the text field. The myTextField text field is defined to wrap and resize as a left-justified text. The getLineIndexOfChar() method returns the line index for the specified character indexes (100 and 500). This information is then appended after the paragraph. Note that since line index begins with 0, the line index (index) is increased by 1 to get the line number. Also if the display is resized the line number may change but the information here will stay the same since the method is only invoked once. package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFieldAutoSize; public class TextField_getLineIndexOfCharExample extends Sprite { public function TextField_getLineIndexOfCharExample() { var myTextField:TextField = new TextField(); myTextField.x = 10; myTextField.y = 10; myTextField.width = 200; myTextField.background = true; myTextField.border = true; myTextField.wordWrap = true; myTextField.autoSize = TextFieldAutoSize.LEFT; myTextField.appendText(&quot;The TextField class is used to create display objects for &quot; + &quot;text display and input. All dynamic and input text fields in a SWF file&quot; + &quot;are instances of the TextField class. You can use the TextField class &quot; + &quot;to perform low-level text rendering. However, in Flex, you typically use &quot; + &quot;the Label, Text, TextArea, and TextInput controls to process text. &quot; + &quot;You can give a text field an instance name in the Property inspector &quot; + &quot;and use the methods and properties of the TextField class to manipulate it with ActionScript. &quot; + &quot;TextField instance names are displayed in the Movie Explorer and in the Insert &quot; + &quot;Target Path dialog box in the Actions panel.\n\n&quot;); var index:int = myTextField.getLineIndexOfChar(100); myTextField.appendText(&quot;100th character is in line: &quot; + (index + 1) + &quot;\n&quot;); index = myTextField.getLineIndexOfChar(500); myTextField.appendText(&quot;500th character is in line: &quot; + (index + 1)); this.addChild(myTextField); } } } The character index specified is out of range."/>
<page href="flash/text/TextField.html#getLineLength()" title="TextField.getLineLength()" text="getLineLength Returns the number of characters in a specific text line. lineIndex The line number for which you want the length. In the following example, once the user selects a line, its line length (number of characters) is displayed in a separate text field. As an illustration, myTextField text field, which displays the text that will be counted, is set to INPUT, meaning users can actually change the lines or add lines between the lines or at the end. (There is an empty line created by using line break (\n) at the end of the last line.) The countLines text field, where the result of counting the line length is displayed, is set below myTextField text field and its text is not selectable. When the user clicks on a line in the myTextField text field, the clickHandler() method is invoked. In the clickHandler() method, the getLineIndexAtPoint() method returns the line index of where the user clicked, by using the localX and localY coordinates of the mouse click. The if statement checks to see if the use has clicked on a character. If so, the getLineLength() method, using the index of line, returns the number of characters in the line. Note that the empty lines between the lines include the second line break (\n) and have a count of 1 character, while the line after the last line has a 0 count. Spaces also count as one character. The users can write a new line or changes a line and get the character count of the line by clicking on it. If text wrap is used and the screen is resized, the line index could change. package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFieldType; import flash.events.Event; import flash.events.MouseEvent; public class TextField_getLineLengthExample extends Sprite { private var myTextField:TextField = new TextField(); private var countLines:TextField = new TextField(); public function TextField_getLineLengthExample() { myTextField.x = 10; myTextField.y = 10; myTextField.width = 350; myTextField.height = 150; myTextField.background = true; myTextField.border = true; myTextField.type = TextFieldType.INPUT; myTextField.appendText(&quot;Click on the lines to count its number of characters:\n\n&quot;); myTextField.appendText(&quot;This is a short line.\n&quot;); myTextField.appendText(&quot;This is a longer line than the last line.\n\n&quot;); myTextField.appendText(&quot;This one is even longer than the one before. It has two sentences.\n&quot;); this.addChild(myTextField); countLines.border = true; countLines.x = 10; countLines.y = 180; countLines.height = 30; countLines.width = 200; countLines.background = true; countLines.selectable = false; this.addChild(countLines); myTextField.addEventListener(MouseEvent.CLICK, clickHandler); } private function clickHandler(e:MouseEvent):void { var index:int = myTextField.getLineIndexAtPoint(e.localX, e.localY); if (index != -1) { var lenght:int = myTextField.getLineLength(index); countLines.text = &quot;Number of characters in the line is: &quot; + lenght.toString(); } } } } The line number specified is out of range."/>
<page href="flash/text/TextField.html#getLineMetrics()" title="TextField.getLineMetrics()" text="getLineMetrics Returns metrics information about a given text line. lineIndex The line number for which you want metrics information. The following example displays some line metrics values for two differently formatted lines of text. The text appended is two lines from the Song of Myself by Walt Whitman. A new TextFormat object (newFormat) is used to set the format of the second line. The first line holds the default format. The getLineMetrics() method returns a TextLineMetrics object for a specific line. (Line index begins with 0.) Using metrics1 and metrics2 TextLineMetrics objects for the line one and two, respectively, the ascent, descent, height, and weight value of the line are retrieved and displayed. The result numbers are converted to string but not rounded. Note that this value is for the line and not a specific character. It reflects the range of characters for a line. For example, if a line has different characters with different height formats, the character with the highest height will determine the value. This also means that if one of the character's format is changes, some of the metrics values could also change. package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextLineMetrics; import flash.text.TextFieldAutoSize; import flash.text.AntiAliasType; import flash.text.TextFormat; public class TextField_getLineMetricsExample extends Sprite { public function TextField_getLineMetricsExample() { var myTextField:TextField = new TextField(); var newFormat:TextFormat = new TextFormat(); myTextField.x = 10; myTextField.y = 10; myTextField.background = true; myTextField.wordWrap = false; myTextField.autoSize = TextFieldAutoSize.LEFT; myTextField.appendText(&quot;A child said What is the grass? fetching it to me with full hands;\n&quot;); myTextField.appendText(&quot;How could I answer the child? I do not know what it is any more than he.\n\n&quot;); newFormat.size = 14; newFormat.font = &quot;Arial&quot;; newFormat.italic = true; myTextField.setTextFormat(newFormat, 67, 139); var metrics1:TextLineMetrics = myTextField.getLineMetrics(0); myTextField.appendText(&quot;Metrics ascent for the line 1 is: &quot; + metrics1.ascent.toString() + &quot;\n&quot;); myTextField.appendText(&quot;Metrics descent is: &quot; + metrics1.descent.toString() + &quot;\n&quot;); myTextField.appendText(&quot;Metrics height is: &quot; + metrics1.height.toString() + &quot;\n&quot;); myTextField.appendText(&quot;Metrics width is: &quot; + metrics1.width.toString() + &quot;\n\n&quot;); var metrics2:TextLineMetrics = myTextField.getLineMetrics(1); myTextField.appendText(&quot;Metrics ascent for the line 2 is: &quot; + metrics2.ascent.toString() + &quot;\n&quot;); myTextField.appendText(&quot;Metrics descent is: &quot; + metrics2.descent.toString() + &quot;\n&quot;); myTextField.appendText(&quot;Metrics height is: &quot; + metrics2.height.toString() + &quot;\n&quot;); myTextField.appendText(&quot;Metrics width is: &quot; + metrics2.width.toString() + &quot;\n&quot;); addChild(myTextField); } } } The line number specified is out of range."/>
<page href="flash/text/TextField.html#getLineOffset()" title="TextField.getLineOffset()" text="getLineOffset Returns the character index of the first character in the line that the lineIndex parameter specifies. lineIndex The zero-based index value of the line (for example, the first line is 0, the second line is 1, and so on). The following example checks for the first character of the line 4, which will change if the screen (and the text field) is resized. The myTextField text field is set to word wrap. The countField text field will display the first character of line 4. When the user clicks on the myTextField text field, the clickHandler() method is invoked. In the clickHandler() method, the getLineOffset() method returns the index of the first character in the line index 3, which is the fourth line of the text. (First line has a 0 index.) The charAt() method is used to get the character using the index of the first character of the fourth line. The countField text field content is updated with this information using the text property of the countField text field. Using the countField.text property means that each time after the click the content of the countField text field will be overwritten. If the user resizes the display, the content will wrap and the first character of the line 4 could change. By clicking again on the myTextField field, the content of countField text field is updated with the new first character for the fourth line. package { import flash.display.Sprite; import flash.text.TextField; import flash.events.MouseEvent; public class TextField_getLineOffsetExample extends Sprite { private var myTextField:TextField = new TextField(); private var countField:TextField = new TextField(); public function TextField_getLineOffsetExample() { myTextField.x = 10; myTextField.y = 10; myTextField.width = 150; myTextField.height = 300; myTextField.background = true; myTextField.border = true; myTextField.wordWrap = true; countField.height = 20; countField.width = 200; countField.x = 10; countField.y = 320; countField.selectable = false; myTextField.appendText(&quot;The TextField class is used to create display objects for &quot; + &quot;text display and input. All dynamic and input text fields in a SWF file &quot; + &quot;are instances of the TextField class. You can use the TextField class &quot; + &quot;to perform low-level text rendering. However, in Flex, you typically use &quot; + &quot;the Label, Text, TextArea, and TextInput controls to process text. &quot; + &quot;You can give a text field an instance name in the Property inspector &quot; + &quot;and use the methods and properties of the TextField class to manipulate it with ActionScript.&quot;); myTextField.addEventListener(MouseEvent.CLICK, clickHandler); this.addChild(myTextField); this.addChild(countField); } private function clickHandler(e:MouseEvent):void { var c:String; var index:int; index = myTextField.getLineOffset(3); c = myTextField.text.charAt(index); countField.text = &quot;The first character of line 4 is: &quot; + c; } } } The line number specified is out of range."/>
<page href="flash/text/TextField.html#getLineText()" title="TextField.getLineText()" text="getLineText Returns the text of the line specified by the lineIndex parameter. lineIndex The zero-based index value of the line (for example, the first line is 0, the second line is 1, and so on). In the following example, the line numbers of all the instances of the word &quot;love&quot; used in Shakespeare's sonnet are found and displayed. The poem text field is set to fit automatically the text and to resize as a left-justified text. The wordWrap property is set to false, so the lines of the poem would not wrap, though normally when using the autoSize property, this should not be a problem. The for loop iterates through the lines of the sonnet using the property numLines of the text field. The getLineText() method returns the content of the line as a string. (Note that the numLines property returns the number of lines starting with line 1, while for the getLineText() method the line number begins with 0.) Using the regular expression pattern (/love/i), the if statement looks for any substring of the word in upper or lowercase. If the pattern is found, the search method returns the index of the first matching substring, otherwise it returns -1 (if there is no match). The line number where &quot;love&quot; was found ((i + 1)) is then placed in the string lineResult. The string method converts the number argument ((i + 1)) to a string as long as there is another argument that is a string (&quot; &quot;). The line result of the search will include lines with the words &quot;loved&quot; or &quot;Love's.&quot; If the string &quot;Love was found in lines:&quot; was appended before the for loop, the word &quot;Love&quot; in this line would also have been included. package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.utils.Timer; import flash.events.TimerEvent; public class TextField_getLineTextExample extends Sprite { public function TextField_getLineTextExample() { var poem:TextField = new TextField(); var lineResult:String = &quot;&quot;; var pattern:RegExp = /love/i; poem.x = 10; poem.y = 10; poem.background = true; poem.wordWrap = false; poem.autoSize = TextFieldAutoSize.LEFT; poem.text = &quot;Let me not to the marriage of true minds\n&quot; + &quot;Admit impediments. love is not love\n&quot; + &quot;Which alters when it alteration finds\n&quot; + &quot;Or bends with the remover to remove:\n&quot; + &quot;O no! it is an ever-fixed mark\n&quot; + &quot;That looks on tempests and is never shaken;\n&quot; + &quot;It is the star to every wandering bark,\n&quot; + &quot;Whose worth's unknown, although his height be taken.\n&quot; + &quot;Love's not Time's fool, though rosy lips and cheeks\n&quot; + &quot;Within his bending sickle's compass come:\n&quot; + &quot;Love alters not with his brief hours and weeks,\n&quot; + &quot;But bears it out even to the edge of doom.\n&quot; + &quot;If this be error and upon me proved,\n&quot; + &quot;I never writ, nor no man ever loved.\n\n&quot;; for (var i:int = 0; i &lt; poem.numLines; i++) { var s:String = poem.getLineText(i); if(s.search(pattern) != -1) { lineResult += (i + 1) + &quot; &quot;; } } poem.appendText(&quot;Love was found in lines: &quot; + lineResult); this.addChild(poem); } } } The line number specified is out of range."/>
<page href="flash/text/TextField.html#getParagraphLength()" title="TextField.getParagraphLength()" text="getParagraphLength Given a character index, returns the length of the paragraph containing the given character. The length is relative to the first character in the paragraph (as returned by getFirstCharInParagraph()), not to the character index passed in. charIndex The zero-based index value of the character (for example, the first character is 0, the second character is 1, and so on). In the following example, when a user selects a paragraph, the paragraph's length and number of &quot;s&quot; characters in the paragraph are displayed in a separate text field. The myTextField text field displays the paragraphs that the user will select. When the user click on the text field, the MouseEvent.CLICK event is dispatched, and the clickHandler() method is called. The paragraph length and number of &quot;s&quot; characters will appear in countField text field, which is placed below myTextField text field. In the clickHandler() method, the getCharIndexAtPoint() method returns the character's index based on the localX and localY coordinates of the mouse click. The first if statement checks to see if the use has clicked on a character. The getFirstCharInParagraph() method, uses this index to return the index of the first character in the same paragraph. The paragraph length returned by getParagraphLength() method is used with the index of the first character in the paragraph to determine the index for the end of the paragraph. A for loop iterates through the paragraph looking for the number of &quot;s&quot; characters. package { import flash.display.Sprite; import flash.text.TextField; import flash.events.MouseEvent; public class TextField_getParagraphLengthExample extends Sprite { private var myTextField:TextField = new TextField(); private var countField:TextField = new TextField(); public function TextField_getParagraphLengthExample() { myTextField.x = 10; myTextField.y = 10; myTextField.background = true; myTextField.border = true; myTextField.wordWrap = true; myTextField.width = 300; myTextField.height = 280; myTextField.appendText(&quot;The TextField class is used to create display objects for &quot; + &quot;text display and input. All dynamic and input text fields in a SWF file&quot; + &quot;are instances of the TextField class. You can use the TextField class &quot; + &quot;to perform low-level text rendering. However, in Flex, you typically use &quot; + &quot;the Label, Text, TextArea, and TextInput controls to process text. &quot; + &quot;You can give a text field an instance name in the Property inspector &quot; + &quot;and use the methods and properties of the TextField class to manipulate it with ActionScript. &quot; + &quot;TextField instance names are displayed in the Movie Explorer and in the Insert &quot; + &quot;Target Path dialog box in the Actions panel.\n\n&quot; + &quot;To create a text field dynamically, use the TextField() constructor.\n\n&quot; + &quot;The methods of the TextField class let you set, select, and manipulate &quot; + &quot;text in a dynamic or input text field that you create during authoring or at runtime.&quot;); myTextField.addEventListener(MouseEvent.CLICK, clickHandler); countField.x = 10; countField.y = 300; countField.height = 50; countField.width = 250; countField.background = true; countField.selectable = false; this.addChild(myTextField); this.addChild(countField); } private function clickHandler(e:MouseEvent):void { var index:int = myTextField.getCharIndexAtPoint(e.localX, e.localY); if(index != -1) { var beginParag:int = myTextField.getFirstCharInParagraph(index); var paragLength:int = myTextField.getParagraphLength(index); var endParag:int = beginParag + paragLength; var sCount:uint = 0; for (var i:int = beginParag; i &lt;= endParag; i++) { if ((myTextField.text.charAt(i) == &quot;s&quot;) || (myTextField.text.charAt(i) == &quot;S&quot;)) { sCount++; } countField.text = &quot;Paragraph length is: &quot; + paragLength.toString() + &quot;\n&quot; + &quot;Number of 's' characters in the paragraph: &quot; + sCount.toString(); } } } } } The character index specified is out of range."/>
<page href="flash/text/TextField.html#getTextFormat()" title="TextField.getTextFormat()" text="getTextFormat Returns a TextFormat object that contains formatting information for the range of text that the beginIndex and endIndex parameters specify. Only properties that are common to the entire text specified are set in the resulting TextFormat object. Any property that is mixed, meaning that it has different values at different points in the text, has a value of null. If you do not specify values for these parameters, this method is applied to all the text in the text field. The following table describes three possible usages: Usage Description 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 that is mixed, meaning that it has different values at different points in the text, has a value of null. my_textField.getTextFormat(beginIndex:Number) Returns a TextFormat object containing a copy of the text format of the character at the beginIndex position. my_textField.getTextFormat(beginIndex:Number,endIndex:Number) Returns a TextFormat object containing formatting information for the span of text from beginIndex to endIndex-1. Only properties that are common to all of the text in the specified range are set in the resulting TextFormat object. Any property that is mixed (that is, has different values at different points in the range) has its value set to null. beginIndex endIndex Optional; an integer that specifies the starting location of a range of text within the text field. Optional; an integer that specifies the position of the first character after the desired text span. As designed, if you specify beginIndex and endIndex values, the text from beginIndex to endIndex-1 is read. Please see the getFirstCharInParagraph() or setTextFormat() method's example for illustrations of how to use the getTextFormat() method. The beginIndex or endIndex specified is out of range."/>
<page href="flash/text/TextField.html#replaceSelectedText()" title="TextField.replaceSelectedText()" text="replaceSelectedText Replaces the current selection with the contents of the value 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. You can use the replaceSelectedText() method to insert and delete text without disrupting the character and paragraph formatting of the rest of the text. Note: This method will not work if a style sheet is applied to the text field. value The string to replace the currently selected text. In the following example, the user erases some text from the first text field by selecting it and replaces a selected text in the second text field with &quot;NEW TEXT&quot; string. Two different TextField objects are created and event listeners are added for the MouseEvent.MOUSE_UP events. Mouse up occurs when the user releases the mouse, an event that normally happens after a selection of text is made. Note that the default setting for a text field is for its text to be selected. In the mouseHandler1() method, when a user release a mouse in the myTextField1 text field, the text is erased by replacing it with an empty string. This can continue until all the text is erased. In the mouseHandler2() method, when a user selects some text in myTextField2 text field, properties selectionBeginIndex and selectionEndIndex are checked to see if any character was selected. (The selectionBeginIndex and selectionEndIndex properties don't have the same value if some text were selected.) The selected text is then replaced with &quot;NEW TEXT&quot; string. This can continue until all the original text of the second text field is replaced with the &quot;NEW TEXT&quot; string. package { import flash.display.Sprite; import flash.text.TextField; import flash.events.MouseEvent; public class TextField_replaceSelectedTextExample extends Sprite { private var myTextField1:TextField = new TextField(); private var myTextField2:TextField = new TextField(); public function TextField_replaceSelectedTextExample() { myTextField1.x = 10; myTextField1.width = 300; myTextField1.height = 50; myTextField1.background = true; myTextField1.border = true; myTextField1.text = &quot;Select the text you want to remove from the line.&quot;; myTextField2.x = 10; myTextField2.y = 60; myTextField2.width = 300; myTextField2.height = 50; myTextField2.background = true; myTextField2.border = true; myTextField2.text = &quot;Select the text you want to replace with NEW TEXT.&quot;; myTextField1.addEventListener(MouseEvent.MOUSE_UP, mouseHandler1); myTextField2.addEventListener(MouseEvent.MOUSE_UP, mouseHandler2); this.addChild(myTextField1); this.addChild(myTextField2); } private function mouseHandler1(e:MouseEvent):void { myTextField1.replaceSelectedText(&quot;&quot;); } private function mouseHandler2(e:MouseEvent):void { if(myTextField2.selectionBeginIndex != myTextField2.selectionEndIndex) { myTextField2.replaceSelectedText(&quot;NEW TEXT&quot;); } } } } This method cannot be used on a text field with a style sheet."/>
<page href="flash/text/TextField.html#replaceText()" title="TextField.replaceText()" text="replaceText Replaces the range of characters that the beginIndex and endIndex parameters specify with the contents of the newText parameter. As designed, the text from beginIndex to endIndex-1 is replaced. Note: This method will not work if a style sheet is applied to the text field. beginIndex endIndex newText The zero-based index value for the start position of the replacement range. The zero-based index position of the first character after the desired text span. The text to use to replace the specified range of characters. The following example uses the replaceText() method to delete, replace and insert some text into a text field. The outputText text field is set to automatically fit the text and to resize as a left-justified text. With the first replaceText() method call, the first line (&quot;This is the wrong heading&quot;) is replaced with &quot;THIS IS THE HEADING FOR EVERYONE.&quot; With the second method call, the text &quot;CORRECT&quot; is inserted between &quot;THE&quot; and &quot;HEADING.&quot; With the third method call, the words &quot;FOR EVERYONE&quot; are deleted. Note that with each call to the method appendText(), the current text's begin and end index are changed. Here, only the final text (after the changes have been made) will display. package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFieldAutoSize; public class TextField_replaceTextExample extends Sprite { public function TextField_replaceTextExample() { var outputText:TextField = new TextField(); outputText.x = 10; outputText.y = 10; outputText.background = true; outputText.autoSize = TextFieldAutoSize.LEFT; outputText.appendText(&quot;This is the wrong heading&quot;); outputText.appendText(&quot;\n\n&quot;); outputText.appendText(&quot;This is the body of the text.&quot;); outputText.replaceText(0, 25, &quot;THIS IS THE HEADING FOR EVERYONE&quot;); outputText.replaceText(12, 12, &quot;CORRECT &quot;); outputText.replaceText(27, 40, &quot;&quot;); this.addChild(outputText); } } } This method cannot be used on a text field with a style sheet."/>
<page href="flash/text/TextField.html#setSelection()" title="TextField.setSelection()" text="setSelection Sets as selected the text designated by the index values of the first and last characters, which are specified with the beginIndex and endIndex parameters. If the two parameter values are the same, this method sets the insertion point, just as if you set the caretIndex property. beginIndex endIndex The zero-based index value of the first character in the selection (for example, the first character is 0, the second character is 1, and so on). The zero-based index value of the last character in the selection. In the following example, when the user clicks anywhere in the text field a predefined range of text will be selected (highlighting the words &quot;TEXT IN ALL CAPS&quot;). Two event listeners for the myTextField text field respond to the user's mouse clicks or mouse up events. Mouse up will occur when the user releases the mouse, an event that normally happens after a selection of text is made. Note that the default setting for a text field is for its text to be selected. When some text is clicked, clickHandler() method is invoked. When some text is selected and the mouse is released, mouseUpHandler() method is invoked. In both clickHandler() and mouseUpHandler() methods, the setSelection() method sets only the characters between indexes 54 and 70 (TEXT IN ALL CAPS) to be selected. package { import flash.display.Sprite; import flash.events.MouseEvent; import flash.text.TextField; import flash.text.TextFieldAutoSize; public class TextField_setSelectionExample extends Sprite { private var myTextField:TextField = new TextField(); public function TextField_setSelectionExample() { myTextField.autoSize = TextFieldAutoSize.LEFT; myTextField.text = &quot;No matter where you click on this text field only the TEXT IN ALL CAPS is selected.&quot;; myTextField.addEventListener(MouseEvent.CLICK, clickHandler); myTextField.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler); this.addChild(myTextField); } private function clickHandler(event:MouseEvent):void { myTextField.setSelection(54, 70); } private function mouseUpHandler(event:MouseEvent):void { myTextField.setSelection(54, 70); } } }"/>
<page href="flash/text/TextField.html#setTextFormat()" title="TextField.setTextFormat()" text="setTextFormat Applies the text formatting that the format parameter specifies to the specified text in a text field. The value of format must be a TextFormat object that specifies the desired text formatting changes. Only the non-null properties of format are applied to the text field. Any property of format that is set to null is not applied. By default, all of the properties of a newly created TextFormat object are set to null. Note: This method will not work if a style sheet is applied to the text field. The setTextFormat() method changes the text formatting applied to a range of characters or to the entire body of text in a text field. To apply the properties of format to all text in the text field, do not specify values for beginIndex and endIndex. To apply the properties of the format to a range of text, specify values for the beginIndex and the endIndex parameters. You can use the length property to determine the index values. The two types of formatting information in a TextFormat object are character level formatting 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. Any text inserted manually by the user, or replaced by means of the replaceSelectedText() method, receives the text field's default formatting for new text, and not the formatting specified for the text insertion point. To set a text field's default formatting for new text, use defaultTextFormat. format beginIndex endIndex A TextFormat object that contains character and paragraph formatting information. Optional; an integer that specifies the zero-based index position specifying the first character of the desired range of text. Optional; an integer that specifies the first character after the desired text span. As designed, if you specify beginIndex and endIndex values, the text from beginIndex to endIndex-1 is updated. Usage Description my_textField.setTextFormat(textFormat:TextFormat) Applies the properties of textFormat to all text in the text field. my_textField.setTextFormat(textFormat:TextFormat, beginIndex:int) Applies the properties of textFormat to the text starting with the beginIndex position. my_textField.setTextFormat(textFormat:TextFormat, beginIndex:int, endIndex:int) Applies the properties of the textFormat parameter to the span of text from the beginIndex position to the endIndex-1 position. Notice that any text inserted manually by the user, or replaced by means of the replaceSelectedText() method, receives the text field's default formatting for new text, and not the formatting specified for the text insertion point. To set a text field's default formatting for new text, use the defaultTextFormat property. In the following example, when the text is clicked, a defined range of text, &quot;TEXT IN ALL CAPS,&quot; switches format between the default text format and the new format. An event listener for the myTextField text field is added to respond to the mouse clicks by invoking the clickHandler() method. In the clickHandler() method, the getTextFormat() method returns the current format of a character (index 55) from the intended range of the text, which is then placed in the currentTextFormat TextFormat object. The if statement checks the currentTextFormat text format to see if the character in the range is using the new format (font point is set to 18). If not, the new format changes the size to 18 point, color to red, and applies underline and italics to the range of text between 54-70 (TEXT IN ALL CAPS). If the character in the range is using the new format, the format of the range is set back to the default (original) format of the text field. package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFormat; import flash.text.TextFieldAutoSize; import flash.events.MouseEvent; public class TextField_setTextFormatExample extends Sprite { private var myTextField:TextField = new TextField(); private var newFormat:TextFormat = new TextFormat(); public function TextField_setTextFormatExample() { myTextField.autoSize = TextFieldAutoSize.LEFT; myTextField.selectable = false; myTextField.background = true; myTextField.text = &quot;No matter where you click on this text field only the TEXT IN ALL CAPS changes format.&quot;; myTextField.addEventListener(MouseEvent.CLICK, clickHandler); newFormat.color = 0xFF0000; newFormat.size = 18; newFormat.underline = true; newFormat.italic = true; this.addChild(myTextField); } private function clickHandler(event:MouseEvent):void { var currentTextFormat:TextFormat = myTextField.getTextFormat(55); if(currentTextFormat.size != 18) { myTextField.setTextFormat(newFormat, 54, 70); } else { myTextField.setTextFormat(myTextField.defaultTextFormat); } } } } This method cannot be used on a text field with a style sheet."/>
<page href="flash/text/TextField.html#alwaysShowSelection" title="TextField.alwaysShowSelection" text="alwaysShowSelection When set to true and the text field is not in focus, Flash Player highlights the selection in the text field in gray. When set to false and the text field is not in focus, Flash Player does not highlight the selection in the text field. Compile and run the following file. When you run the file, drag to select text in each of the two text fields, and notice the difference in selection highlighting when you select text in the two text fields (changing focus): package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFieldType; public class TextField_alwaysShowSelection extends Sprite { public function TextField_alwaysShowSelection() { var label1:TextField = createTextField(0, 20, 200, 20); label1.text = &quot;This text is selected.&quot;; label1.setSelection(0, 9); label1.alwaysShowSelection = true; var label2:TextField = createTextField(0, 50, 200, 20); label2.text = &quot;Drag to select some of this text.&quot;; } private function createTextField(x:Number, y:Number, width:Number, height:Number):TextField { var result:TextField = new TextField(); result.x = x; result.y = y; result.width = width; result.height = height; addChild(result); return result; } } }"/>
<page href="flash/text/TextField.html#antiAliasType" title="TextField.antiAliasType" text="antiAliasType The type of anti-aliasing used for this text field. Use flash.text.AntiAliasType constants for this property. You can control this setting only if the font is embedded (with the embedFonts property set to true). The default setting is flash.text.AntiAliasType.NORMAL. To set values for this property, use the following string values: String value Description flash.text.AntiAliasType.NORMAL Applies the regular text anti-aliasing. This matches the type of anti-aliasing that Flash Player 7 and earlier versions used. flash.text.AntiAliasType.ADVANCED Applies advanced anti-aliasing, which makes text more legible. (This feature became available in Flash Player 8.) Advanced anti-aliasing allows for high-quality rendering of font faces at small sizes. It is best used with applications that have a lot of small text. Advanced anti-aliasing is not recommended for fonts that are larger than 48 points."/>
<page href="flash/text/TextField.html#autoSize" title="TextField.autoSize" text="autoSize Controls automatic sizing and alignment of text fields. Acceptable values for the TextFieldAutoSize constants: TextFieldAutoSize.NONE (the default), TextFieldAutoSize.LEFT, TextFieldAutoSize.RIGHT, and TextFieldAutoSize.CENTER. If autoSize is set to TextFieldAutoSize.NONE (the default) no resizing occurs. If autoSize is set to TextFieldAutoSize.LEFT, the text is treated as left-justified text, meaning that the left margin of the text field remains fixed and any resizing of a single line of the text field is on the right margin. If the text includes a line break (for example, &quot;\n&quot; or &quot;\r&quot;), the bottom is also resized to fit the next line of text. If wordWrap is also set to true, only the bottom of the text field is resized and the right side remains fixed. If autoSize is set to TextFieldAutoSize.RIGHT, the text is treated as right-justified text, meaning that the right margin of the text field remains fixed and any resizing of a single line of the text field is on the left margin. If the text includes a line break (for example, &quot;\n&quot; or &quot;\r&quot;), the bottom is also resized to fit the next line of text. If wordWrap is also set to true, only the bottom of the text field is resized and the left side remains fixed. If autoSize is set to TextFieldAutoSize.CENTER, the text is treated as center-justified text, meaning that any resizing of a single line of the text field is equally distributed to both the right and left margins. If the text includes a line break (for example, &quot;\n&quot; or &quot;\r&quot;), the bottom is also resized to fit the next line of text. If wordWrap is also set to true, only the bottom of the text field is resized and the left and right sides remain fixed. The autoSize specified is not a member of flash.text.TextFieldAutoSize."/>
<page href="flash/text/TextField.html#background" title="TextField.background" text="background Specifies whether 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. Use the backgroundColor property to set the background color of a text field."/>
<page href="flash/text/TextField.html#backgroundColor" title="TextField.backgroundColor" text="backgroundColor The color of the text field background. The default value is 0xFFFFFF (white). This property can be retrieved or set, even if there currently is no background, but the color is visible only if the text field has the background property set to true."/>
<page href="flash/text/TextField.html#border" title="TextField.border" text="border Specifies whether the text field has a border. If true, the text field has a border. If false, the text field has no border. Use the borderColor property to set the border color."/>
<page href="flash/text/TextField.html#borderColor" title="TextField.borderColor" text="borderColor The color of the text field border. The default value is 0x000000 (black). This property can be retrieved or set, even if there currently is no border, but the color is visible only if the text field has the border property set to true."/>
<page href="flash/text/TextField.html#bottomScrollV" title="TextField.bottomScrollV" text="bottomScrollV An integer (1-based index) that indicates the bottommost line that is currently visible in the specified text field. Think of the text field as a window onto a block of text. The scrollV property is the 1-based index of the topmost visible line in the window. All the text between the lines indicated by scrollV and bottomScrollV is currently visible in the text field."/>
<page href="flash/text/TextField.html#caretIndex" title="TextField.caretIndex" text="caretIndex The index of the insertion point (caret) position. If no insertion point is displayed, the value is the position the insertion point would be if you restored focus to the field (typically where the insertion point last was, or 0 if the field has not had focus). Selection span indexes are zero-based (for example, the first position is 0, the second position is 1, and so on). In this example, a TextField instance is created and populated with text. An event listener is assigned so that when the user clicks on the TextField, the printCursorPosition method is called. In that case, the values of the caretIndex, selectionBeginIndex, and selectionEndIndex properties are output. Run this example and try clicking in the TextField to select text. Then click in the field without selecting text. When you click in the text without making a selection, the caretIndex property indicates where the insertion point occurs, and the selectionBeginIndex and selectionEndIndex properties equal the caretIndex property value. package { import flash.display.Sprite; import flash.events.MouseEvent; import flash.text.TextField; import flash.text.TextFieldType; public class TextField_caretIndex extends Sprite { public function TextField_caretIndex() { var tf:TextField = createTextField(10, 10, 100, 100); tf.wordWrap = true; tf.type = TextFieldType.INPUT; tf.text = &quot;Click in this text field. Compare the difference between clicking without selecting versus clicking and selecting text.&quot;; tf.addEventListener(MouseEvent.CLICK, printCursorPosition); } private function printCursorPosition(event:MouseEvent):void { var tf:TextField = TextField(event.target); trace(&quot;caretIndex:&quot;, tf.caretIndex); trace(&quot;selectionBeginIndex:&quot;, tf.selectionBeginIndex); trace(&quot;selectionEndIndex:&quot;, tf.selectionEndIndex); } private function createTextField(x:Number, y:Number, width:Number, height:Number):TextField { var result:TextField = new TextField(); result.x = x; result.y = y; result.width = width; result.height = height; addChild(result); return result; } } }"/>
<page href="flash/text/TextField.html#condenseWhite" title="TextField.condenseWhite" text="condenseWhite A Boolean value that specifies whether extra white space (spaces, line breaks, and so on) in a text field with HTML text should be removed. The default value is false. The condenseWhite property only affects text set with the htmlText property, not the text property. If you set text with the text property, condenseWhite is ignored. If you set condenseWhite 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. Set the condenseWhite property before setting the htmlText property. The following shows the difference between setting the condenseWhite setting to false and setting it to true: package { import flash.display.Sprite; import flash.text.TextField; public class TextField_condenseWhite extends Sprite { public function TextField_condenseWhite() { var tf1:TextField = createTextField(0, 0, 200, 50); tf1.condenseWhite = false; tf1.htmlText = &quot;keep on\n\ttruckin'&quot;; var tf2:TextField = createTextField(0, 120, 200, 50); tf2.condenseWhite = true; tf2.htmlText = &quot;keep on\n\ttruckin'&quot;; } private function createTextField(x:Number, y:Number, width:Number, height:Number):TextField { var result:TextField = new TextField(); result.x = x; result.y = y; result.width = width; result.height = height; result.border = true; addChild(result); return result; } } }"/>
<page href="flash/text/TextField.html#defaultTextFormat" title="TextField.defaultTextFormat" text="defaultTextFormat Specifies the format applied to newly inserted text, such as text inserted with the replaceSelectedText() method or text entered by a user. When you access the defaultTextFormat property, the returned TextFormat object has all of its properties defined. No property is null. Note: You can't set this property if a style sheet is applied to the text field. This method cannot be used on a text field with a style sheet."/>
<page href="flash/text/TextField.html#displayAsPassword" title="TextField.displayAsPassword" text="displayAsPassword Specifies whether the text field is a password text field. If the value of this property is true, the text field is treated as a password text field and hides the input characters using asterisks instead of the actual characters. If false, the text field is not treated as a password text field. When password mode is enabled, the Cut and Copy commands and their corresponding keyboard shortcuts will not function. This security mechanism prevents an unscrupulous user from using the shortcuts to discover a password on an unattended computer."/>
<page href="flash/text/TextField.html#embedFonts" title="TextField.embedFonts" text="embedFonts Specifies whether to render by using embedded font outlines. If false, Flash Player renders the text field by using device fonts. If you set the embedFonts property to true for a text field, you must specify a font for that text by using the font property of a TextFormat object applied to the text field. If the specified font is not embedded in the SWF file, the text is not displayed."/>
<page href="flash/text/TextField.html#gridFitType" title="TextField.gridFitType" text="gridFitType The type of grid fitting used for this text field. This property applies only if the flash.text.AntiAliasType property of the text field is set to flash.text.AntiAliasType.ADVANCED. The type of grid fitting used determines whether Flash Player forces strong horizontal and vertical lines to fit to a pixel or subpixel grid, or not at all. For the flash.text.GridFitType property, you can use the following string values: String value Description flash.text.GridFitType.NONE Specifies no grid fitting. Horizontal and vertical lines in the glyphs are not forced to the pixel grid. This setting is usually good for animation or for large font sizes. flash.text.GridFitType.PIXEL Specifies that strong horizontal and vertical lines are fit to the pixel grid. This setting works only for left-aligned text fields. To use this setting, the flash.dispaly.AntiAliasType property of the text field must be set to flash.text.AntiAliasType.ADVANCED. This setting generally provides the best legibility for left-aligned text. flash.text.GridFitType.SUBPIXEL Specifies that strong horizontal and vertical lines are fit to the subpixel grid on an LCD monitor. To use this setting, the flash.text.AntiAliasType property of the text field must be set to flash.text.AntiAliasType.ADVANCED. The flash.text.GridFitType.SUBPIXEL setting is often good for right-aligned or centered dynamic text, and it is sometimes a useful trade-off for animation versus text quality."/>
<page href="flash/text/TextField.html#htmlText" title="TextField.htmlText" text="htmlText Contains the HTML representation of the text field's contents. Flash Player supports the following HTML tags: Tag Description Anchor tag The &lt;a&gt; tag creates a hypertext link and supports the following attributes: target: Specifies the name of the target window where you load the page. Options include _self, _blank, _parent, and _top. The _self option 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. href: Specifies a URL or an ActionScript link event.The URL can be either absolute or relative to the location of the SWF file that is loading the page. An example of an absolute reference to a URL is http://www.adobe.com; an example of a relative reference is /index.html. Absolute URLs must be prefixed with http://; otherwise, Flash treats them as relative URLs. You can use the link event to cause the link to execute an ActionScript function in a SWF file instead of opening a URL. To specify a link event, use the event scheme instead of the http scheme in your href attribute. An example is href=&quot;event:myText&quot; instead of href=&quot;http://myURL&quot;; when the user clicks a hypertext link that contains the event scheme, the text field dispatches a link TextEvent with its text property set to &quot;myText&quot;. You can then create an ActionScript function that executes whenever the link TextEvent is dispatched. You can also define a:link, a:hover, and a:active styles for anchor tags by using style sheets. Bold tag The &lt;b&gt; tag renders text as bold. A bold typeface must be available for the font used. Break tag The &lt;br&gt; tag creates a line break in the text field. You must set the text field to be a multiline text field to use this tag. Font tag The &lt;font&gt; tag specifies a font or list of fonts to display the text.The font tag supports the following attributes: color: Only hexadecimal color (#FFFFFF) values are supported. face: Specifies the name of the font to use. As shown in the following example, you can specify a list of comma-delimited font names, in which case Flash Player selects the first available font. If the specified font is not installed on the user's computer system or isn't embedded in the SWF file, Flash Player selects a substitute font. size: Specifies the size of the font. You can use absolute pixel sizes, such as 16 or 18, or relative point sizes, such as +2 or -4. Image tag The &lt;img&gt; tag lets you embed external image files (JPEG, GIF, PNG), SWF files, and movie clips inside text fields. Text automatically flows around images you embed in text fields. To use this tag, you must set the text field to be multiline and to wrap text. The &lt;img&gt; tag supports the following attributes: src: Specifies the URL to an image or SWF file, or the linkage identifier for a movie clip symbol in the library. This attribute is required; all other attributes are optional. External files (JPEG, GIF, PNG, and SWF files) do not show until they are downloaded completely. width: The width of the image, SWF file, or movie clip being inserted, in pixels. height: The height of the image, SWF file, or movie clip being inserted, in pixels. align: Specifies the horizontal alignment of the embedded image within the text field. Valid values are left and right. The default value is left. hspace: Specifies the amount of horizontal space that surrounds the image where no text appears. The default value is 8. vspace: Specifies the amount of vertical space that surrounds the image where no text appears. The default value is 8. id: Specifies the name for the movie clip instance (created by Flash Player) that contains the embedded image file, SWF file, or movie clip. This is useful if you want to control the embedded content with ActionScript. checkPolicyFile: Specifies that Flash Player will check for a cross-domain policy file on the server associated with the image's domain. If a cross-domain policy file exists, SWF files in the domains listed in the file can access the data of the loaded image, for instance by calling the BitmapData.draw() method with this image as the source parameter. For more information, see the &quot;Flash Player Security&quot; chapter in Programming ActionScript 3.0. Flash displays media embedded in a text field at full size. To specify the dimensions of the media you are embedding, use the &lt;img&gt; tag's height and width attributes. In general, an image embedded in a text field appears on the line following the &lt;img&gt; tag. However, when the &lt;img&gt; tag is the first character in the text field, the image appears on the first line of the text field. Italic tag The &lt;i&gt; tag displays the tagged text in italics. An italic typeface must be available for the font used. List item tag The &lt;li&gt; tag places a bullet in front of the text that it encloses. Note: Because Flash Player does not recognize ordered and unordered list tags (&lt;ol&gt; and &lt;ul&gt;, they do not modify how your list is rendered. All lists are unordered and all list items use bullets. Paragraph tag The &lt;p&gt; tag creates a new paragraph. You must set the text field to be a multiline text field to use this tag. The &lt;p&gt; tag supports the following attributes: align: Specifies alignment of text within the paragraph; valid values are left, right, justify, and center. class: Specifies a CSS style class defined by a flash.text.StyleSheet object. Span tag The &lt;span&gt; tag is available only for use with CSS text styles. It supports the following attribute: class: Specifies a CSS style class defined by a flash.text.StyleSheet object. Text format tag The &lt;textformat&gt; tag lets you use a subset of paragraph formatting properties of the TextFormat class within text fields, including line leading, indentation, margins, and tab stops. You can combine &lt;textformat&gt; tags with the built-in HTML tags. The &lt;textformat&gt; tag has the following attributes: blockindent: Specifies the block indentation in points; corresponds to TextFormat.blockIndent. indent: Specifies the indentation from the left margin to the first character in the paragraph; corresponds to TextFormat.indent. Both positive and negative numbers are acceptable. leading: Specifies the amount of leading (vertical space) between lines; corresponds to TextFormat.leading. Both positive and negative numbers are acceptable. leftmargin: Specifies the left margin of the paragraph, in points; corresponds to TextFormat.leftMargin. rightmargin: Specifies the right margin of the paragraph, in points; corresponds to TextFormat.rightMargin. tabstops: Specifies custom tab stops as an array of non-negative integers; corresponds to TextFormat.tabStops. Underline tag The &lt;u&gt; tag underlines the tagged text. Flash Player supports the following HTML entities: Entity Description &amp;lt; &lt; (less than) &amp;gt; &gt; (greater than) &amp;amp; &amp; (ampersand) &amp;quot; &quot; (double quotes) &amp;apos; ' (apostrophe, single quote) Flash also supports explicit character codes, such as &amp;#38; (ASCII ampersand) and &amp;#x20AC; (Unicode € symbol). The following example creates a TextField called tf1, and assigns an HTML-formatted String to its text property. When its htmlText property is traced, the output is the HTML-formatted String, with additional tags (such as &lt;P&gt; and &lt;FONT&gt;) automatically added by Flash Player. When the value of the text property is traced, the unformatted string without HTML tags is displayed. By way of comparison, the same steps are performed on another TextField object named tf2, with the addition that a StyleSheet object is assigned to tf2's styleSheet property before its htmlText property is set. In that case, when the htmlText property is traced, it only includes the exact HTML text that was originally assigned to the htmlText property, showing that no additional tags were added by Flash Player. package { import flash.display.Sprite; import flash.text.StyleSheet; import flash.text.TextField; public class TextField_text extends Sprite { public function TextField_text() { var tf1:TextField = createTextField(10, 10, 400, 22); tf1.htmlText = &quot;&lt;b&gt;Lorem ipsum dolor sit amet.&lt;/b&gt;&quot;; // htmlText: &lt;P ALIGN=&quot;LEFT&quot;&gt;&lt;FONT FACE=&quot;Times New Roman&quot; SIZE=&quot;12&quot; COLOR=&quot;#000000&quot; LETTERSPACING=&quot;0&quot; KERNING=&quot;0&quot;&gt;&lt;b&gt;Lorem ipsum dolor sit amet.&lt;/b&gt;&lt;/FONT&gt;&lt;/P&gt; trace(&quot;htmlText: &quot; + tf1.htmlText); // text: Lorem ipsum dolor sit amet. trace(&quot;text: &quot; + tf1.text); var tf2:TextField = createTextField(10, 50, 400, 22); tf2.styleSheet = new StyleSheet(); tf2.htmlText = &quot;&lt;b&gt;Lorem ipsum dolor sit amet.&lt;/b&gt;&quot;; // htmlText: &lt;b&gt;Lorem ipsum dolor sit amet.&lt;/b&gt; trace(&quot;htmlText: &quot; + tf2.htmlText); // text: Lorem ipsum dolor sit amet. trace(&quot;text: &quot; + tf2.text); } private function createTextField(x:Number, y:Number, width:Number, height:Number):TextField { var result:TextField = new TextField(); result.x = x; result.y = y; result.width = width; result.height = height; addChild(result); return result; } } }"/>
<page href="flash/text/TextField.html#length" title="TextField.length" text="length The number of characters in a text field. A character such as tab (\t) counts as one character."/>
<page href="flash/text/TextField.html#maxChars" title="TextField.maxChars" text="maxChars The maximum number of characters that the text field can contain, as entered by a user. A script can 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 0, a user can enter an unlimited amount of text."/>
<page href="flash/text/TextField.html#maxScrollH" title="TextField.maxScrollH" text="maxScrollH The maximum value of scrollH."/>
<page href="flash/text/TextField.html#maxScrollV" title="TextField.maxScrollV" text="maxScrollV The maximum value of scrollV."/>
<page href="flash/text/TextField.html#mouseWheelEnabled" title="TextField.mouseWheelEnabled" text="mouseWheelEnabled A Boolean value that indicates whether Flash Player should automatically scroll multiline text fields when the user clicks a text field and rolls the mouse wheel. By default, this value is true. This property is useful if you want to prevent mouse wheel scrolling of text fields, or implement your own text field scrolling."/>
<page href="flash/text/TextField.html#multiline" title="TextField.multiline" text="multiline Indicates 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."/>
<page href="flash/text/TextField.html#numLines" title="TextField.numLines" text="numLines Defines the number of text lines in a multiline text field. If wordWrap property is set to true, the number of lines increases when text wraps."/>
<page href="flash/text/TextField.html#restrict" title="TextField.restrict" text="restrict Indicates the set of characters that a user can enter into the text field. If the value of the restrict property is null, you can enter any character. If the value of the restrict property is an empty string, you cannot enter any character. If the value of the restrict property is a string of characters, you can enter only characters in the string into the text field. The string is scanned from left to right. You can specify a range by using the hyphen (-) character. This only restricts user interaction; a script may put any text into the text field. This property does not synchronize with the Embed font options in the Property inspector. If the string begins with a caret (^) character, all characters are initially accepted and succeeding characters in the string are excluded from the set of accepted characters. If the string does not begin with a caret (^) character, no characters are initially accepted and succeeding characters in the string are included in the set of accepted characters. The following example allows only uppercase characters, spaces, and numbers to be entered into a text field: my_txt.restrict = &quot;A-Z 0-9&quot;; The following example includes all characters, but excludes lowercase letters: my_txt.restrict = &quot;^a-z&quot;; You can use a backslash to enter a ^ or - verbatim. The accepted backslash sequences are \-, \^ or \\. The backslash must be an actual character in the string, so when specified in ActionScript, a double backslash must be used. For example, the following code includes only the dash (-) and caret (^): my_txt.restrict = &quot;\\-\\^&quot;; The ^ may be used anywhere in the string to toggle between including characters and excluding characters. The following code includes only uppercase letters, but excludes the uppercase letter Q: my_txt.restrict = &quot;A-Z^Q&quot;; You can use the u escape sequence to construct restrict strings. The following code includes only the characters from ASCII 32 (space) to ASCII 126 (tilde). my_txt.restrict = &quot;\u0020-\u007E&quot;;"/>
<page href="flash/text/TextField.html#scrollH" title="TextField.scrollH" text="scrollH The current horizontal scrolling position. If the scrollH property is 0, the text is not horizontally scrolled. This property value is an integer that represents the horizontal position in pixels. The units of horizontal scrolling are pixels, whereas the units of vertical scrolling are lines. Horizontal scrolling is measured in pixels because most fonts you typically use are proportionally spaced; that is, the characters can have different widths. Flash Player performs vertical scrolling by line because users usually want to see a complete line of text rather than a partial line. Even if a line uses multiple fonts, the height of the line adjusts to fit the largest font in use. Note: The scrollH property is zero-based, not 1-based like the scrollV vertical scrolling property."/>
<page href="flash/text/TextField.html#scrollV" title="TextField.scrollV" text="scrollV The vertical position of text in a text field. The scrollV property is useful for directing users to a specific paragraph in a long passage, or creating scrolling text fields. The units of vertical scrolling are lines, whereas the units of horizontal scrolling are pixels. If the first line displayed is the first line in the text field, scrollV is set to 1 (not 0). Horizontal scrolling is measured in pixels because most fonts are proportionally spaced; that is, the characters can have different widths. Flash performs vertical scrolling by line because users usually want to see a complete line of text rather than 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."/>
<page href="flash/text/TextField.html#selectable" title="TextField.selectable" text="selectable A Boolean value that indicates whether the text field is selectable. The value true indicates that 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, the user 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 with the Copy command. If selectable is set to true, the text in the text field can be selected with the mouse or keyboard, and the text can be copied with the Copy command. You can select text this way even if the text field is a dynamic text field instead of an input text field."/>
<page href="flash/text/TextField.html#selectionBeginIndex" title="TextField.selectionBeginIndex" text="selectionBeginIndex The zero-based character index value of the first character in the current selection. For example, the first character is 0, the second character is 1, and so on. If no text is selected, this property is the value of caretIndex. In this example, a TextField instance is created and populated with text. An event listener is assigned so that when the user clicks on the TextField, the printCursorPosition method is called. In that case, the values of the caretIndex, selectionBeginIndex, and selectionEndIndex properties are output. Run this example and try clicking in the TextField to select text. Then click in the field without selecting text. When you click in the text without making a selection, the caretIndex property indicates where the insertion point occurs, and the selectionBeginIndex and selectionEndIndex properties equal the caretIndex property value. package { import flash.display.Sprite; import flash.events.MouseEvent; import flash.text.TextField; import flash.text.TextFieldType; public class TextField_caretIndex extends Sprite { public function TextField_caretIndex() { var tf:TextField = createTextField(10, 10, 100, 100); tf.wordWrap = true; tf.type = TextFieldType.INPUT; tf.text = &quot;Click in this text field. Compare the difference between clicking without selecting versus clicking and selecting text.&quot;; tf.addEventListener(MouseEvent.CLICK, printCursorPosition); } private function printCursorPosition(event:MouseEvent):void { var tf:TextField = TextField(event.target); trace(&quot;caretIndex:&quot;, tf.caretIndex); trace(&quot;selectionBeginIndex:&quot;, tf.selectionBeginIndex); trace(&quot;selectionEndIndex:&quot;, tf.selectionEndIndex); } private function createTextField(x:Number, y:Number, width:Number, height:Number):TextField { var result:TextField = new TextField(); result.x = x; result.y = y; result.width = width; result.height = height; addChild(result); return result; } } }"/>
<page href="flash/text/TextField.html#selectionEndIndex" title="TextField.selectionEndIndex" text="selectionEndIndex The zero-based character index value of the last character in the current selection. For example, the first character is 0, the second character is 1, and so on. If no text is selected, this property is the value of caretIndex. In this example, a TextField instance is created and populated with text. An event listener is assigned so that when the user clicks on the TextField, the printCursorPosition method is called. In that case, the values of the caretIndex, selectionBeginIndex, and selectionEndIndex properties are output. Run this example and try clicking in the TextField to select text. Then click in the field without selecting text. When you click in the text without making a selection, the caretIndex property indicates where the insertion point occurs, and the selectionBeginIndex and selectionEndIndex properties equal the caretIndex property value. package { import flash.display.Sprite; import flash.events.MouseEvent; import flash.text.TextField; import flash.text.TextFieldType; public class TextField_caretIndex extends Sprite { public function TextField_caretIndex() { var tf:TextField = createTextField(10, 10, 100, 100); tf.wordWrap = true; tf.type = TextFieldType.INPUT; tf.text = &quot;Click in this text field. Compare the difference between clicking without selecting versus clicking and selecting text.&quot;; tf.addEventListener(MouseEvent.CLICK, printCursorPosition); } private function printCursorPosition(event:MouseEvent):void { var tf:TextField = TextField(event.target); trace(&quot;caretIndex:&quot;, tf.caretIndex); trace(&quot;selectionBeginIndex:&quot;, tf.selectionBeginIndex); trace(&quot;selectionEndIndex:&quot;, tf.selectionEndIndex); } private function createTextField(x:Number, y:Number, width:Number, height:Number):TextField { var result:TextField = new TextField(); result.x = x; result.y = y; result.width = width; result.height = height; addChild(result); return result; } } }"/>
<page href="flash/text/TextField.html#sharpness" title="TextField.sharpness" text="sharpness The sharpness of the glyph edges in this text field. This property applies only if the flash.text.AntiAliasType property of the text field is set to flash.text.AntiAliasType.ADVANCED. The range for sharpness is a number from -400 to 400. If you attempt to set sharpness to a value outside that range, Flash sets the property to the nearest value in the range (either -400 or 400)."/>
<page href="flash/text/TextField.html#styleSheet" title="TextField.styleSheet" text="styleSheet Attaches a style sheet to the text field. For information on creating style sheets, see the StyleSheet class and Programming ActionScript 3.0. You can change the style sheet associated with a text field at any time. If you change the style sheet in use, the text field is redrawn with the new style sheet. You can set the style sheet to null or undefined to remove the style sheet. If the style sheet in use is removed, the text field is redrawn without a style sheet. Note: If the style sheet is removed, the contents of both TextField.text and TextField.htmlText change to incorporate the formatting previously applied by the style sheet. To preserve the original TextField.htmlText contents without the formatting, save the value in a variable before removing the style sheet."/>
<page href="flash/text/TextField.html#text" title="TextField.text" text="text A string that is the current text in the text field. Lines are separated by the carriage return character ('\r', ASCII 13). This property contains unformatted text in the text field, without HTML tags. To get the text in HTML form, use the htmlText property. The following example creates a TextField called tf1, and assigns an HTML-formatted String to its text property. When its htmlText property is traced, the output is the HTML-formatted String, with additional tags (such as &lt;P&gt; and &lt;FONT&gt;) automatically added by Flash Player. When the value of the text property is traced, the unformatted string without HTML tags is displayed. By way of comparison, the same steps are performed on another TextField object named tf2, with the addition that a StyleSheet object is assigned to tf2's styleSheet property before its htmlText property is set. In that case, when the htmlText property is traced, it only includes the exact HTML text that was originally assigned to the htmlText property, showing that no additional tags were added by Flash Player. package { import flash.display.Sprite; import flash.text.StyleSheet; import flash.text.TextField; public class TextField_text extends Sprite { public function TextField_text() { var tf1:TextField = createTextField(10, 10, 400, 22); tf1.htmlText = &quot;&lt;b&gt;Lorem ipsum dolor sit amet.&lt;/b&gt;&quot;; // htmlText: &lt;P ALIGN=&quot;LEFT&quot;&gt;&lt;FONT FACE=&quot;Times New Roman&quot; SIZE=&quot;12&quot; COLOR=&quot;#000000&quot; LETTERSPACING=&quot;0&quot; KERNING=&quot;0&quot;&gt;&lt;b&gt;Lorem ipsum dolor sit amet.&lt;/b&gt;&lt;/FONT&gt;&lt;/P&gt; trace(&quot;htmlText: &quot; + tf1.htmlText); // text: Lorem ipsum dolor sit amet. trace(&quot;text: &quot; + tf1.text); var tf2:TextField = createTextField(10, 50, 400, 22); tf2.styleSheet = new StyleSheet(); tf2.htmlText = &quot;&lt;b&gt;Lorem ipsum dolor sit amet.&lt;/b&gt;&quot;; // htmlText: &lt;b&gt;Lorem ipsum dolor sit amet.&lt;/b&gt; trace(&quot;htmlText: &quot; + tf2.htmlText); // text: Lorem ipsum dolor sit amet. trace(&quot;text: &quot; + tf2.text); } private function createTextField(x:Number, y:Number, width:Number, height:Number):TextField { var result:TextField = new TextField(); result.x = x; result.y = y; result.width = width; result.height = height; addChild(result); return result; } } }"/>
<page href="flash/text/TextField.html#textColor" title="TextField.textColor" text="textColor The color of the text in a text field, in hexadecimal format. 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. For example, black is 0x000000; white is 0xFFFFFF. The following ActionScript creates a TextField object and changes its textColor property to red (0xFF0000). package { import flash.display.Sprite; import flash.text.TextField; public class TextField_textColor extends Sprite { public function TextField_textColor() { var tf:TextField = createTextField(10, 10, 100, 300); tf.text = &quot;This will be red text&quot;; tf.textColor = 0xFF0000; } private function createTextField(x:Number, y:Number, width:Number, height:Number):TextField { var result:TextField = new TextField(); result.x = x; result.y = y; result.width = width; result.height = height; addChild(result); return result; } } }"/>
<page href="flash/text/TextField.html#textHeight" title="TextField.textHeight" text="textHeight The height of the text in pixels. The following example creates a TextField object and assigns text to it. The trace statements display the values of the textWidth and textHeight properties. For comparison, the width and height properties are also displayed. (Note that the values you see for textHeight and textWidth might vary depending on the font that is used on your machine). package { import flash.display.Sprite; import flash.text.TextField; public class TextField_textHeight extends Sprite { public function TextField_textHeight() { var tf:TextField = createTextField(10, 10, 100, 150); tf.text = &quot;Sample text&quot;; trace(&quot;textWidth: &quot; + tf.textWidth); // textWidth: 55.75 trace(&quot;textHeight: &quot; + tf.textHeight); // textHeight: 13.450000000000001 trace(&quot;width: &quot; + tf.width); // width: 100 trace(&quot;height: &quot; + tf.height); // height: 150 } private function createTextField(x:Number, y:Number, width:Number, height:Number):TextField { var result:TextField = new TextField(); result.x = x; result.y = y; result.width = width; result.height = height; result.border = true; result.background = true; addChild(result); return result; } } }"/>
<page href="flash/text/TextField.html#textWidth" title="TextField.textWidth" text="textWidth The width of the text in pixels. The following example creates a TextField object and assigns text to it. The trace statements display the values of the textWidth and textHeight properties. For comparison, the width and height properties are also displayed. (Note that the values you see for textHeight and textWidth might vary depending on the font that is used on your machine). package { import flash.display.Sprite; import flash.text.TextField; public class TextField_textHeight extends Sprite { public function TextField_textHeight() { var tf:TextField = createTextField(10, 10, 100, 150); tf.text = &quot;Sample text&quot;; trace(&quot;textWidth: &quot; + tf.textWidth); // textWidth: 55.75 trace(&quot;textHeight: &quot; + tf.textHeight); // textHeight: 13.450000000000001 trace(&quot;width: &quot; + tf.width); // width: 100 trace(&quot;height: &quot; + tf.height); // height: 150 } private function createTextField(x:Number, y:Number, width:Number, height:Number):TextField { var result:TextField = new TextField(); result.x = x; result.y = y; result.width = width; result.height = height; result.border = true; result.background = true; addChild(result); return result; } } }"/>
<page href="flash/text/TextField.html#thickness" title="TextField.thickness" text="thickness The thickness of the glyph edges in this text field. This property applies only when flash.text.AntiAliasType is set to flash.text.AntiAliasType.ADVANCED. The range for thickness is a number from -200 to 200. If you attempt to set thickness to a value outside that range, the property is set to the nearest value in the range (either -200 or 200)."/>
<page href="flash/text/TextField.html#type" title="TextField.type" text="type The type of the text field. Either one of the following TextFieldType constants: TextFieldType.DYNAMIC, which specifies a dynamic text field, which a user cannot edit, or TextFieldType.INPUT, which specifies an input text field, which a user can edit. The following example creates two text fields: tfDynamic and tfInput. Text is entered into both text fields. However, tfDynamic has its type property set to TextFieldType.DYNAMIC, and tfInput has its type property set to TextFieldType.INPUT, so the user can modify the text in tfInput but can only view the text in tfDynamic. package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFieldType; public class TextField_type extends Sprite { public function TextField_type() { var tfDynamic:TextField = createTextField(10, 10, 100, 20); tfDynamic.type = TextFieldType.DYNAMIC; tfDynamic.text = &quot;hello&quot;; var tfInput:TextField = createTextField(10, 45, 100, 20); tfInput.type = TextFieldType.INPUT; tfInput.text = &quot;world&quot;; } private function createTextField(x:Number, y:Number, width:Number, height:Number):TextField { var result:TextField = new TextField(); result.x = x; result.y = y; result.width = width; result.height = height; result.background = true; result.border = true; addChild(result); return result; } } } The type specified is not a member of flash.text.TextFieldType."/>
<page href="flash/text/TextField.html#useRichTextClipboard" title="TextField.useRichTextClipboard" text="useRichTextClipboard Specifies whether to copy and paste the text formatting along with the text. When set to true, Flash Player will also copy and paste formatting (such as alignment, bold, and italics) when you copy and paste between text fields. Both the origin and destination text fields for the copy and paste procedure must have useRichTextClipboard set to true. The default value is false."/>
<page href="flash/text/TextField.html#wordWrap" title="TextField.wordWrap" text="wordWrap A Boolean value that indicates whether 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. The default value is false. This example demonstrates the difference between setting the wordWrap property to true and setting it to false. Two TextField instances are created whose contents are too large for their widths. The wordWrap property of the first (named tfWrap) is set to true; it is set to false for the second (tfNoWrap). package { import flash.display.Sprite; import flash.text.TextField; public class TextField_wordWrap extends Sprite { public function TextField_wordWrap() { var tfWrap:TextField = createTextField(10, 10, 100, 100); tfWrap.wordWrap = true; tfWrap.text = &quot;(wordWrap = true):\nThis is very long text that will certainly extend beyond the width of this text field&quot;; var tfNoWrap:TextField = createTextField(10, 150, 100, 100); tfNoWrap.wordWrap = false; tfNoWrap.text = &quot;(wordWrap = false):\nThis is very long text that will certainly extend beyond the width of this text field&quot;; } private function createTextField(x:Number, y:Number, width:Number, height:Number):TextField { var result:TextField = new TextField(); result.x = x; result.y = y; result.width = width; result.height = height; result.background = true; result.border = true; addChild(result); return result; } } }"/>
<page href="flash/text/TextField.html#event:change" title="TextField.change" text="change Dispatched after a control's value is modified. Contrast this with the textInput event, which is dispatched before the value is modified. Unlike the W3C DOM Event Model version of the change event, which dispatches the event only after the control loses focus, the ActionScript 3.0 version of the change event is dispatched any time the control changes. For example, if a user types text into a text field, a change event is dispatched after every keystroke. In the following example, the input of the user is immediately copied (echoed) into another text field with a different text format. Two text fields are created, one for the user input and the other (headingTextField) for the copy of the user input. A TextFormat object is also created and assigned to the default text format of the headingTextField text field. When the content of the text field is changed, the changeHandler() method is invoked, which assigns the text of the inputTextField text field to the headingTextField text field. (If the method was called for the TextEvent.TEXT_INPUT event instead of the Event.CHANGE event, the content of the user input will be copied only after the user has made another input.) package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFieldType; import flash.text.TextFormat; import flash.text.TextFormatAlign; import flash.events.Event; import flash.events.TextEvent; public class TextField_Event_changeExample extends Sprite { private var inputTextField:TextField = new TextField(); private var headingTextField:TextField = new TextField(); private var newFormat:TextFormat = new TextFormat(); public function TextField_Event_changeExample() { headingTextField.x = 10; headingTextField.y = 10; headingTextField.height = 30; headingTextField.width = 400; headingTextField.background = true; headingTextField.backgroundColor = 0xF5F5DC; headingTextField.selectable = false; inputTextField.x = 10; inputTextField.y = 70; inputTextField.height = 20; inputTextField.width = 230; inputTextField.background = true; inputTextField.border = true; inputTextField.maxChars = 40; inputTextField.wordWrap = true; inputTextField.type = TextFieldType.INPUT; inputTextField.addEventListener(Event.CHANGE, changeHandler); newFormat.bold = true; newFormat.size = 18; newFormat.color = 0xFF0000; newFormat.align = TextFormatAlign.CENTER; headingTextField.defaultTextFormat = newFormat; this.addChild(inputTextField); this.addChild(headingTextField); } private function changeHandler(e:Event):void { headingTextField.text = inputTextField.text; } } }"/>
<page href="flash/text/TextField.html#event:link" title="TextField.link" text="link Dispatched when a user clicks a hyperlink in an HTML-enabled text field, where the URL begins with &quot;event:&quot;. The remainder of the URL after &quot;event:&quot; will be placed in the text property of the LINK event. Note: The default behavior, adding the text to the text field, occurs only when Flash Player generates the event, which in this case happens when a user attempts to input text. You cannot put text into a text field by sending it textInput events. In the following example, the playMP3() function is defined. A TextField object named list is created and populated with HTML text. The text &quot;Track 1&quot; and &quot;Track 2&quot; are links inside the text field. The playMP3() function is called when the user clicks either link. The name of the MP3 file, which follows the string &quot;event:&quot; in the href attribute of the HTML tag, is passed to the linkHandler() method as the text property of the link event object. package { import flash.display.Sprite; import flash.errors.IOError; import flash.events.IOErrorEvent; import flash.events.TextEvent; import flash.media.Sound; import flash.media.SoundChannel; import flash.net.URLRequest; import flash.text.TextField; import flash.text.TextFieldAutoSize; public class TextField_event_link extends Sprite { private var myMP3:Sound; public function TextField_event_link() { myMP3 = new Sound(); var list:TextField = new TextField(); list.autoSize = TextFieldAutoSize.LEFT; list.multiline = true; list.htmlText = &quot;&lt;a href=\&quot;event:track1.mp3\&quot;&gt;Track 1&lt;/a&gt;&lt;br&gt;&quot;; list.htmlText += &quot;&lt;a href=\&quot;event:track2.mp3\&quot;&gt;Track 2&lt;/a&gt;&lt;br&gt;&quot;; addEventListener(TextEvent.LINK, linkHandler); addChild(list); } private function playMP3(mp3:String):void { try { myMP3.load(new URLRequest(mp3)); myMP3.play(); } catch(err:Error) { trace(err.message); } myMP3.addEventListener(IOErrorEvent.IO_ERROR, errorHandler); } private function linkHandler(linkEvent:TextEvent):void { playMP3(linkEvent.text); } private function errorHandler(errorEvent:IOErrorEvent):void { trace(errorEvent.text); } } }"/>
<page href="flash/text/TextField.html#event:scroll" title="TextField.scroll" text="scroll Dispatched by a TextField object after the user scrolls."/>
<page href="flash/text/TextField.html#event:textInput" title="TextField.textInput" text="textInput Flash Player dispatches the textInput event when a user enters one or more characters of text. A number of different text input methods can generate this event, including standard keyboards, input method editors (IMEs), voice or speech recognition systems, and even the act of pasting plain text with no formatting or style information."/>
<page href="flash/text/TextFormat.html" title="TextFormat class" text="TextFormat The 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. The properties of the TextFormat class apply to device and embedded fonts. However, for embedded fonts, bold and italic text actually require specific fonts. If you want to display bold or italic text with an embedded font, you need to embed the bold and italic variations of that font. You must use the constructor new TextFormat() to create a TextFormat object before setting its properties. The TextFormat properties are null by default because if you don't provide values for the properties, Flash Player uses its own default formatting. The default formatting that Flash Player uses for each property (if property's value is null) is as follows: align = &quot;left&quot; blockIndent = 0 bold = false bullet = false color = 0x000000 font = &quot;Times New Roman&quot; (default font is Times on Mac OS X) indent = 0 italic = false kerning = false leading = 0 leftMargin = 0 letterSpacing = 0 rightMargin = 0 size = 12 tabStops = [] (empty array) target = &quot;&quot; (empty string) underline = false url = &quot;&quot; (empty string) The default formatting for each property is also described in each property description."/>
<page href="flash/text/TextFormat.html#TextFormat()" title="TextFormat.TextFormat()" text="TextFormat 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. font size color bold italic underline url target align leftMargin rightMargin indent leading The name of a font for text as a string. An integer that indicates the point size. 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. A Boolean value that indicates whether the text is boldface. A Boolean value that indicates whether the text is italicized. A Boolean value that indicates whether the text is underlined. The URL to which the text in this text format hyperlinks. If url is an empty string, the text does not have a hyperlink. 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. The alignment of the paragraph, as a TextFormatAlign value. Indicates the left margin of the paragraph, in pixels. Indicates the right margin of the paragraph, in pixels. An integer that indicates the indentation from the left margin to the first character in the paragraph. A number that indicates the amount of leading vertical space between lines. In the following example, the user can select different text formatting options from a list that will be applied to the content of another text field. If the user clicks on the text field's content, the formatting reverts to the default (original) format. The formatTextField text field lists all the TextField class property options (with the exception of kerning) in a separate line. When a user clicks on some line in the formatTextField text field, the formatTextFieldClickHandler() method is triggered. The formatTextFieldClickHandler() method calls the TextField.getLineIndexAtPoint() method to get the index of the line that was clicked, and then calls the TextField.getLineText() method to get the content of the line. The switch statement then checks the content of the line and sets a property of the newformat TextFormat object accordingly. The setTextFormat() method then sets the text format of the contentTextField text field to the new format. By clicking on different formatTextField lines, the users can apply a number of different formatting to the contentTextField text field. (Note that the tab setting is an array that defines a separate tab stop for each tab in the line. If the url or target line is selected, the user must click on contentTextField text field to active the link and have the content of the target URL (flex home page) display. The default value of the target property is &quot;_self&quot; which means the content will be displayed in the current window if the user selects the url line. For target property to work, a URL needs to be already set in the url property. If the user clicks on the contentTextField text field, the contentTextFieldClickHandler() method is triggered, which sets the field's format as well as the newFormat TextFormat object to the default (original) text field format. This will clear all the formatting changes the user has made. package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFormat; import flash.text.TextFieldAutoSize; import flash.events.MouseEvent; import flash.text.TextFormatAlign; public class TextFormat_constructorExample extends Sprite { private var contentTextField:TextField = new TextField(); private var formatTextField:TextField = new TextField(); private var newFormat:TextFormat = new TextFormat(); public function TextFormat_constructorExample() { contentTextField.x = 10; contentTextField.y = 10; contentTextField.background = true; contentTextField.border = true; contentTextField.multiline = true; contentTextField.wordWrap = true; contentTextField.selectable = false; contentTextField.width = 250; contentTextField.height = 120; contentTextField.htmlText = &quot;&lt;p&gt;The TextFormat class represents character formatting &quot; + &quot;information. Use the TextFormat class to create specific text formatting &quot; + &quot;for text fields.&quot; + &quot; &lt;/p&gt;&lt;br&gt;&quot; + &quot;\tTab One&quot; + &quot;\tTab Two&lt;br&gt;&quot;; formatTextField.x = 10; formatTextField.y = 140; formatTextField.background = true; formatTextField.border = true; formatTextField.autoSize = TextFieldAutoSize.LEFT; formatTextField.text = &quot;align: right\n&quot; + &quot;blockIndent: 10 pixels\n&quot; + &quot;bold:\n&quot; + &quot;bullet:\n&quot; + &quot;color: red\n&quot; + &quot;font: Arial\n&quot; + &quot;indent: 20 pixels\n&quot; + &quot;italic:\n&quot; + &quot;leading: 5 spaces\n&quot; + &quot;leftMargin: 20 pixels\n&quot; + &quot;letterSpacing: 4 pixels\n&quot; + &quot;rightMargin: 20 pixels\n&quot; + &quot;size: 16 point\n&quot; + &quot;target: new window\n&quot; + &quot;tabStops: 50 and 150 pixel\n&quot; + &quot;underline:\n&quot; + &quot;url: Adobe Flex page\n&quot;; formatTextField.addEventListener(MouseEvent.CLICK, formatTextFieldClickHandler); contentTextField.addEventListener(MouseEvent.CLICK, contentTextFieldClickHandler); this.addChild(contentTextField); this.addChild(formatTextField); } private function formatTextFieldClickHandler(e:MouseEvent):void { var value:String= &quot;&quot;; var i:uint = 0; var index:int = formatTextField.getLineIndexAtPoint(e.localX, e.localY); var line:String = formatTextField.getLineText(index);; line = line.substr(0, (line.indexOf(&quot;:&quot;))); switch(line) { case &quot;align&quot;: newFormat.align = TextFormatAlign.RIGHT; break; case &quot;blockIndent&quot;: newFormat.blockIndent = 10; break; case &quot;bold&quot;: newFormat.bold = true; break; case &quot;bullet&quot;: newFormat.bullet = true; break; case &quot;color&quot;: newFormat.color = 0xFF0000; break; case &quot;font&quot;: newFormat.font = &quot;Arial&quot;; break; case &quot;indent&quot;: newFormat.indent = 20; break; case &quot;italic&quot;: newFormat.italic = true; break; case &quot;leading&quot;: newFormat.leading = 5; break; case &quot;leftMargin&quot;: newFormat.leftMargin = 20; break; case &quot;letterSpacing&quot;: newFormat.letterSpacing = 4; break; case &quot;rightMargin&quot;: newFormat.rightMargin = 20; break; case &quot;size&quot;: newFormat.size = 16; break; case &quot;tabStops&quot;: newFormat.tabStops = [50, 150]; break; case &quot;target&quot;: newFormat.url = &quot;http://www.adobe.com/products/flex/&quot;; newFormat.target = &quot;_blank&quot;; break; case &quot;underline&quot;: newFormat.underline = true; break; case &quot;url&quot;: newFormat.url = &quot;http://www.adobe.com/products/flex/&quot;; break; } contentTextField.setTextFormat(newFormat); } private function contentTextFieldClickHandler(e:MouseEvent):void { contentTextField.setTextFormat(contentTextField.defaultTextFormat); newFormat = contentTextField.defaultTextFormat; } } }"/>
<page href="flash/text/TextFormat.html#align" title="TextFormat.align" text="align Indicates the alignment of the paragraph. Valid values are TextFormatAlign constants. Please see the TextFormat() constructor example for an illustration of how to use this property. The align specified is not a member of flash.text.TextFormatAlign."/>
<page href="flash/text/TextFormat.html#blockIndent" title="TextFormat.blockIndent" text="blockIndent Indicates the block indentation in pixels. 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 (block indentation is 0). Please see the TextFormat() constructor example for an illustration of how to use this property."/>
<page href="flash/text/TextFormat.html#bold" title="TextFormat.bold" text="bold Specifies whether the text is boldface. The default value is null, which means no boldface is used. If the value is true, then the text is boldface. Please see the TextFormat() constructor example for an illustration of how to use this property."/>
<page href="flash/text/TextFormat.html#bullet" title="TextFormat.bullet" text="bullet 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, which means no bulleted list is used. Please see the TextFormat() constructor example for an illustration of how to use this property."/>
<page href="flash/text/TextFormat.html#color" title="TextFormat.color" text="color Indicates the color of the text. A number containing three 8-bit RGB components; for example, 0xFF0000 is red, and 0x00FF00 is green. The default value is null, which means that Flash Player uses the color black (0x000000). Please see the TextFormat() constructor example for an illustration of how to use this property."/>
<page href="flash/text/TextFormat.html#font" title="TextFormat.font" text="font The name of the font for text in this text format, as a string. The default value is null, which means that Flash Player uses Times New Roman font for the text. Please see the TextFormat() constructor example for an illustration of how to use this property."/>
<page href="flash/text/TextFormat.html#indent" title="TextFormat.indent" text="indent Indicates the indentation from the left margin to the first character in the paragraph. The default value is null, which indicates that no indentation is used. Please see the TextFormat() constructor example for an illustration of how to use this property."/>
<page href="flash/text/TextFormat.html#italic" title="TextFormat.italic" text="italic Indicates whether text in this text format is italicized. The default value is null, which means no italics are used. Please see the TextFormat() constructor example for an illustration of how to use this property."/>
<page href="flash/text/TextFormat.html#kerning" title="TextFormat.kerning" text="kerning A Boolean value that indicates whether kerning is enabled (true) or disabled (false). Kerning adjusts the pixels between certain character pairs to improve readability, and should be used only when necessary, such as with headings in large fonts. Kerning is supported for embedded fonts only. Certain fonts such as Verdana and monospaced fonts, such as Courier New, do not support kerning. The default value is null, which means that kerning is not enabled."/>
<page href="flash/text/TextFormat.html#leading" title="TextFormat.leading" text="leading An integer representing the amount of vertical space (called leading) between lines. The default value is null, which indicates that the amount of leading used is 0. Please see the TextFormat() constructor example for an illustration of how to use this property."/>
<page href="flash/text/TextFormat.html#leftMargin" title="TextFormat.leftMargin" text="leftMargin The left margin of the paragraph, in pixels. The default value is null, which indicates that the left margin is 0 pixels. Please see the TextFormat() constructor example for an illustration of how to use this property."/>
<page href="flash/text/TextFormat.html#letterSpacing" title="TextFormat.letterSpacing" text="letterSpacing A number representing the amount of space that is uniformly distributed between all characters. The value specifies the number of pixels that are added to the advance after each character. The default value is null, which means that 0 pixels of letter spacing is used. You can use decimal values such as 1.75. Please see the TextFormat() constructor example for an illustration of how to use this property."/>
<page href="flash/text/TextFormat.html#rightMargin" title="TextFormat.rightMargin" text="rightMargin The right margin of the paragraph, in pixels. The default value is null, which indicates that the right margin is 0 pixels. Please see the TextFormat() constructor example for an illustration of how to use this property."/>
<page href="flash/text/TextFormat.html#size" title="TextFormat.size" text="size The point size of text in this text format. The default value is null, which means that a point size of 12 is used. Please see the TextFormat() constructor example for an illustration of how to use this property."/>
<page href="flash/text/TextFormat.html#tabStops" title="TextFormat.tabStops" text="tabStops Specifies 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). Please see the TextFormat() constructor example for an illustration of how to use this property."/>
<page href="flash/text/TextFormat.html#target" title="TextFormat.target" text="target Indicates 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. Please see the TextFormat() constructor example for an illustration of how to use this property."/>
<page href="flash/text/TextFormat.html#underline" title="TextFormat.underline" text="underline 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 underlining is not used. Please see the TextFormat() constructor example for an illustration of how to use this property."/>
<page href="flash/text/TextFormat.html#url" title="TextFormat.url" text="url Indicates the target URL for the text in this text format. If the url property is an empty string, the text does not have a hyperlink. The default value is null, which indicates that the text does not have a hyperlink. Note: The text with the assigned text format must be set with the htmlText property for the hyperlink to work. Please see the TextFormat() constructor example for an illustration of how to use this property."/>
<page href="flash/text/TextFieldType.html" title="TextFieldType class" text="TextFieldType The TextFieldType class is an enumeration of constant values used in setting the type property of the TextField class."/>
<page href="flash/text/TextFieldType.html#DYNAMIC" title="TextFieldType.DYNAMIC" text="DYNAMIC Used to specify a dynamic TextField."/>
<page href="flash/text/TextFieldType.html#INPUT" title="TextFieldType.INPUT" text="INPUT Used to specify an input TextField."/>
<page href="flash/text/TextRenderer.html" title="TextRenderer class" text="TextRenderer The TextRenderer class provides functionality for the advanced anti-aliasing capability of embedded fonts. Advanced anti-aliasing allows font faces to render at very high quality at small sizes. Use advanced anti-aliasing with applications that have a lot of small text. Adobe does not recommend using advanced anti-aliasing for very large fonts (larger than 48 points). Advanced anti-aliasing is available in Flash Player 8 and later only. To set advanced anti-aliasing on a text field, set the antiAliasType property of the TextField instance. Advanced anti-aliasing provides continuous stroke modulation (CSM), which is continuous modulation of both stroke weight and edge sharpness. As an advanced feature, you can use the setAdvancedAntiAliasingTable() method to define settings for specific typefaces and font sizes."/>
<page href="flash/text/TextRenderer.html#setAdvancedAntiAliasingTable()" title="TextRenderer.setAdvancedAntiAliasingTable()" text="setAdvancedAntiAliasingTable Sets a custom continuous stroke modulation (CSM) lookup table for a font. Flash Player attempts to detect the best CSM for your font. If you are not satisfied with the CSM that the Flash Player provides, you can customize your own CSM by using the setAdvancedAntiAliasingTable() method. fontName fontStyle colorType advancedAntiAliasingTable The name of the font for which you are applying settings. The font style indicated by using one of the values from the flash.text.FontStyle class. This value determines whether the stroke is dark or whether it is light. Use one of the values from the flash.text.TextColorType class. An array of one or more CSMSettings objects for the specified font. Each object contains the following properties: fontSize insideCutOff outsideCutOff The advancedAntiAliasingTable array can contain multiple entries that specify CSM settings for different font sizes. The fontSize is the size, in pixels, for which the settings apply. Advanced anti-aliasing uses adaptively sampled distance fields (ADFs) to represent the outlines that determine a glyph. Flash Player uses an outside cutoff value (outsideCutOff), below which densities are set to zero, and an inside cutoff value (insideCutOff), above which densities are set to a maximum density value (such as 255). Between these two cutoff values, the mapping function is a linear curve ranging from zero at the outside cutoff to the maximum density at the inside cutoff. Adjusting the outside and inside cutoff values affects stroke weight and edge sharpness. The spacing between these two parameters is comparable to twice the filter radius of classic anti-aliasing methods; a narrow spacing provides a sharper edge, while a wider spacing provides a softer, more filtered edge. When the spacing is zero, the resulting density image is a bi-level bitmap. When the spacing is very wide, the resulting density image has a watercolor-like edge. Typically, users prefer sharp, high-contrast edges at small point sizes, and softer edges for animated text and larger point sizes. The outside cutoff typically has a negative value, and the inside cutoff typically has a positive value, and their midpoint typically lies near zero. Adjusting these parameters to shift the midpoint toward negative infinity increases the stroke weight; shifting the midpoint toward positive infinity decreases the stroke weight. Make sure that the outside cutoff value is always less than or equal to the inside cutoff value."/>
<page href="flash/text/TextRenderer.html#displayMode" title="TextRenderer.displayMode" text="displayMode Controls the rendering of advanced anti-aliased text. The visual quality of text is very subjective, and while Flash Player tries to use the best settings for various conditions, designers may choose a different look or feel for their text. Also, using displayMode allows a designer to override Flash Player's subpixel choice and create visual consistency independent of the user's hardware. Use the values in the TextDisplayMode class to set this property."/>
<page href="flash/text/TextRenderer.html#maxLevel" title="TextRenderer.maxLevel" text="maxLevel The adaptively sampled distance fields (ADFs) quality level for advanced anti-aliasing. The only acceptable values are 3, 4, and 7. Advanced anti-aliasing uses ADFs to represent the outlines that determine a glyph. The higher the quality, the more cache space is required for ADF structures. A value of 3 takes the least amount of memory and provides the lowest quality. Larger fonts require more cache space; at a font size of 64 pixels, the quality level increases from 3 to 4 or from 4 to 7 unless, the level is already set to 7."/>
<page href="flash/text/TextLineMetrics.html" title="TextLineMetrics class" text="TextLineMetrics The TextLineMetrics class contains information about the text position and measurements of a line of text within a text field. All measurements are in pixels. Objects of this class are returned by the flash.text.TextField.getLineMetrics() method. For measurements related to the text field containing the line of text (for example, the &quot;Text Field height&quot; measurement in the diagram), see flash.text.TextField. The following diagram indicates the points and measurements of a text field and the line of text the field contains:"/>
<page href="flash/text/TextLineMetrics.html#TextLineMetrics()" title="TextLineMetrics.TextLineMetrics()" text="TextLineMetrics Creates a TextLineMetrics object. The TextLineMetrics object contains information about the text metrics of a line of text in a text field. Objects of this class are returned by the flash.text.TextField.getLineMetrics() method. See the diagram in the overview for this class for the properties in context. x width height ascent descent leading The left position of the first character in pixels. The width of the text of the selected lines (not necessarily the complete text) in pixels. The height of the text of the selected lines (not necessarily the complete text) in pixels. The length from the baseline to the top of the line height in pixels. The length from the baseline to the bottom depth of the line in pixels. The measurement of the vertical distance between the lines of text."/>
<page href="flash/text/TextLineMetrics.html#ascent" title="TextLineMetrics.ascent" text="ascent The ascent value of the text is the length from the baseline to the top of the line height in pixels. See the &quot;Ascent&quot; measurement in the overview diagram for this class."/>
<page href="flash/text/TextLineMetrics.html#descent" title="TextLineMetrics.descent" text="descent The descent value of the text is the length from the baseline to the bottom depth of the line in pixels. See the &quot;Descent&quot; measurement in the overview diagram for this class."/>
<page href="flash/text/TextLineMetrics.html#height" title="TextLineMetrics.height" text="height The height value of the text of the selected lines (not necessarily the complete text) in pixels. The height of the text line does not include the gutter height. See the &quot;Line height&quot; measurement in the overview diagram for this class."/>
<page href="flash/text/TextLineMetrics.html#leading" title="TextLineMetrics.leading" text="leading The leading value is the measurement of the vertical distance between the lines of text. See the &quot;Leading&quot; measurement in the overview diagram for this class."/>
<page href="flash/text/TextLineMetrics.html#width" title="TextLineMetrics.width" text="width The width value is the width of the text of the selected lines (not necessarily the complete text) in pixels. The width of the text line is not the same as the width of the text field. The width of the text line is relative to the text field width, minus the gutter width of 4 pixels (2 pixels on each side). See the &quot;Text Line width&quot; measurement in the overview diagram for this class."/>
<page href="flash/text/TextLineMetrics.html#x" title="TextLineMetrics.x" text="x The x value is the left position of the first character in pixels. This value includes the margin, indent (if any), and gutter widths. See the &quot;Text Line x-position&quot; in the overview diagram for this class."/>
<page href="flash/text/CSMSettings.html" title="CSMSettings class" text="CSMSettings The CSMSettings class contains properties for use with the TextRenderer.setAdvancedAntiAliasingTable() method to provide continuous stroke modulation (CSM). CSM is the continuous modulation of both stroke weight and edge sharpness."/>
<page href="flash/text/CSMSettings.html#CSMSettings()" title="CSMSettings.CSMSettings()" text="CSMSettings Creates a new CSMSettings object which stores stroke values for custom anti-aliasing settings. fontSize insideCutoff outsideCutoff The size, in pixels, for which the settings apply. The inside cutoff value, above which densities are set to a maximum density value (such as 255). The outside cutoff value, below which densities are set to zero."/>
<page href="flash/text/CSMSettings.html#fontSize" title="CSMSettings.fontSize" text="fontSize The size, in pixels, for which the settings apply. The advancedAntiAliasingTable array passed to the setAdvancedAntiAliasingTable() method can contain multiple entries that specify CSM settings for different font sizes. Using this property, you can specify the font size to which the other settings apply."/>
<page href="flash/text/CSMSettings.html#insideCutoff" title="CSMSettings.insideCutoff" text="insideCutoff The inside cutoff value, above which densities are set to a maximum density value (such as 255)."/>
<page href="flash/text/CSMSettings.html#outsideCutoff" title="CSMSettings.outsideCutoff" text="outsideCutoff The outside cutoff value, below which densities are set to zero."/>
<page href="flash/text/FontStyle.html" title="FontStyle class" text="FontStyle The FontStyle class provides values for the TextRenderer class."/>
<page href="flash/text/FontStyle.html#BOLD" title="FontStyle.BOLD" text="BOLD Defines the bold style of a font for the fontStyle parameter in the setAdvancedAntiAliasingTable() method. Use the syntax FontStyle.BOLD."/>
<page href="flash/text/FontStyle.html#BOLD_ITALIC" title="FontStyle.BOLD_ITALIC" text="BOLD_ITALIC Defines the combined bold and italic style of a font for the fontStyle parameter in the setAdvancedAntiAliasingTable() method. Use the syntax FontStyle.BOLD_ITALIC."/>
<page href="flash/text/FontStyle.html#ITALIC" title="FontStyle.ITALIC" text="ITALIC Defines the italic style of a font for the fontStyle parameter in the setAdvancedAntiAliasingTable() method. Use the syntax FontStyle.ITALIC."/>
<page href="flash/text/FontStyle.html#REGULAR" title="FontStyle.REGULAR" text="REGULAR Defines the plain style of a font for the fontStyle parameter in the setAdvancedAntiAliasingTable() method. Use the syntax FontStyle.REGULAR."/>
<page href="flash/text/AntiAliasType.html" title="AntiAliasType class" text="AntiAliasType The AntiAliasType class provides values for anti-aliasing in the flash.text.TextField class."/>
<page href="flash/text/AntiAliasType.html#ADVANCED" title="AntiAliasType.ADVANCED" text="ADVANCED Sets anti-aliasing to advanced anti-aliasing. Advanced anti-aliasing allows font faces to be rendered at very high quality at small sizes. It is best used with applications that have a lot of small text. Advanced anti-aliasing is not recommended for very large fonts (larger than 48 points). This constant is used for the antiAliasType property in the TextField class. Use the syntax AntiAliasType.ADVANCED."/>
<page href="flash/text/AntiAliasType.html#NORMAL" title="AntiAliasType.NORMAL" text="NORMAL Sets anti-aliasing to the anti-aliasing that is used in Flash Player 7 and earlier. This setting is recommended for applications that do not have a lot of text. This constant is used for the antiAliasType property in the TextField class. Use the syntax AntiAliasType.NORMAL."/>
<page href="flash/text/TextDisplayMode.html" title="TextDisplayMode class" text="TextDisplayMode The TextDisplayMode class contains values that control the subpixel anti-aliasing of the advanced anti-aliasing system."/>
<page href="flash/text/TextDisplayMode.html#CRT" title="TextDisplayMode.CRT" text="CRT Forces Flash Player to display grayscale anti-aliasing. While this setting avoids text coloring, some users may think it appears blurry."/>
<page href="flash/text/TextDisplayMode.html#DEFAULT" title="TextDisplayMode.DEFAULT" text="DEFAULT Allows Flash Player to choose LCD or CRT mode."/>
<page href="flash/text/TextDisplayMode.html#LCD" title="TextDisplayMode.LCD" text="LCD Forces Flash Player to use LCD subpixel anti-aliasing. Depending on the font and the hardware, this setting can result in much higher resolution text or text coloring."/>
<page href="flash/text/TextFieldAutoSize.html" title="TextFieldAutoSize class" text="TextFieldAutoSize The TextFieldAutoSize class is an enumeration of constant values used in setting the autoSize property of the TextField class."/>
<page href="flash/text/TextFieldAutoSize.html#CENTER" title="TextFieldAutoSize.CENTER" text="CENTER Specifies that the text is to be treated as center-justified text. Any resizing of a single line of a text field is equally distributed to both the right and left sides."/>
<page href="flash/text/TextFieldAutoSize.html#LEFT" title="TextFieldAutoSize.LEFT" text="LEFT Specifies that the text is to be treated as left-justified text, meaning that the left side of the text field remains fixed and any resizing of a single line is on the right side."/>
<page href="flash/text/TextFieldAutoSize.html#NONE" title="TextFieldAutoSize.NONE" text="NONE Specifies that no resizing is to occur."/>
<page href="flash/text/TextFieldAutoSize.html#RIGHT" title="TextFieldAutoSize.RIGHT" text="RIGHT Specifies that the text is to be treated as right-justified text, meaning that the right side of the text field remains fixed and any resizing of a single line is on the left side."/>
<page href="flash/text/TextSnapshot.html" title="TextSnapshot class" text="TextSnapshot TextSnapshot objects let you work with static text in a movie clip. You can use them, for example, to lay out text with greater precision than that allowed by dynamic text, but still access the text in a read-only way. You don't use a constructor to create a TextSnapshot object; it is returned by flash.display.DisplayObjectContainer.textSnapshot property."/>
<page href="flash/text/TextSnapshot.html#findText()" title="TextSnapshot.findText()" text="findText Searches the specified TextSnapshot object and returns the position of the first occurrence of textToFind found at or after beginIndex. If textToFind is not found, the method returns -1. beginIndex textToFind caseSensitive Specifies the starting point to search for the specified text. Specifies the text to search for. If you specify a string literal instead of a variable of type String, enclose the string in quotation marks. Specifies whether the text must match the case of the string in textToFind."/>
<page href="flash/text/TextSnapshot.html#getSelected()" title="TextSnapshot.getSelected()" text="getSelected Returns a Boolean value that specifies whether a TextSnapshot object contains selected text in the specified range. To search all characters, pass a value of 0 for start, and charCount (or any very large number) for end. To search a single character, pass the end parameter a value that is one greater than the start parameter. beginIndex endIndex Indicates the position of the first character to be examined. Valid values for beginIndex are 0 through TextSnapshot.charCount - 1. If beginIndex is a negative value, 0 is used. A value that is one greater than the index of the last character to be examined. Valid values for endIndex are 0 through charCount. The character indexed by the endIndex parameter is not included in the extracted string. If this parameter is omitted, charCount is used. If this value is less than or equal to the value of beginIndex, beginIndex + 1 is used."/>
<page href="flash/text/TextSnapshot.html#getSelectedText()" title="TextSnapshot.getSelectedText()" text="getSelectedText Returns a string that contains all the characters specified by the corresponding setSelected() method. If no characters are specified (by the setSelected() method), an empty string is returned. If you pass true for includeLineEndings, newline characters are inserted in the return string, and the return string might be longer than the input range. If includeLineEndings is false or omitted, the method returns the selected text without adding any characters. includeLineEndings An optional Boolean value that specifies whether newline characters are inserted into the returned string where appropriate. The default value is false."/>
<page href="flash/text/TextSnapshot.html#getText()" title="TextSnapshot.getText()" text="getText Returns a string that contains all the characters specified by the beginIndex and endIndex parameters. If no characters are selected, an empty string is returned. To return all characters, pass a value of 0 for beginIndex and charCount (or any very large number) for endIndex. To return a single character, pass a value of beginIndex + 1 for endIndex. If you pass a value of true for includeLineEndings, newline characters are inserted in the string returned where deemed appropriate. In this case, the return string might be longer than the input range. If includeLineEndings is false or omitted, the selected text is returned without any characters added. beginIndex endIndex includeLineEndings Indicates the position of the first character to be included in the returned string. Valid values for beginIndex are0 through charCount - 1. If beginIndex is a negative value, 0 is used. A value that is one greater than the index of the last character to be examined. Valid values for endIndex are 0 through charCount. The character indexed by the endIndex parameter is not included in the extracted string. If this parameter is omitted, charCount is used. If this value is less than or equal to the value of beginIndex, beginIndex + 1 is used. An optional Boolean value that specifies whether newline characters are inserted (true) or are not inserted (false) into the returned string. The default value is false."/>
<page href="flash/text/TextSnapshot.html#getTextRunInfo()" title="TextSnapshot.getTextRunInfo()" text="getTextRunInfo Returns an array of objects that contains information about a run of text. Each object corresponds to one character in the range of characters specified by the two method parameters. Note: Using the getTextRunInfo() method for a large range of text can return a large object. Adobe recommends limiting the text range defined by the beginIndex and endIndex parameters. beginIndex endIndex The index value of the first character in a range of characters in a TextSnapshot object. The index value of the last character in a range of characters in a TextSnapshot object."/>
<page href="flash/text/TextSnapshot.html#hitTestTextNearPos()" title="TextSnapshot.hitTestTextNearPos()" text="hitTestTextNearPos Lets you determine which character within a TextSnapshot object is on or near the specified x, y coordinates of the movie clip containing the text in the TextSnapshot object. If you omit or pass a value of 0 for maxDistance, the location specified by the x, y coordinates must lie inside the bounding box of the TextSnapshot object. This method works correctly only with fonts that include character metric information; however, by default, the Flash authoring tool does not include this information for static text fields. Therefore, the method might return -1 instead of an index value. To ensure that an index value is returned, you can force the Flash authoring tool to include the character metric information for a font. To do this, add a dynamic text field that uses that font, select Character Options for that dynamic text field, and then specify that font outlines should be embedded for at least one character. (It doesn't matter which characters you specify, nor whether they are the characters used in the static text fields.) x y maxDistance A number that represents the x coordinate of the movie clip containing the text. A number that represents the y coordinate of the movie clip containing the text. An optional number that represents the maximum distance from x, y that can be searched for text. The distance is measured from the center point of each character. The default value is 0."/>
<page href="flash/text/TextSnapshot.html#setSelectColor()" title="TextSnapshot.setSelectColor()" text="setSelectColor Specifies the color to use when highlighting characters that have been selected with the setSelected() method. The color is always opaque; you can't specify a transparency value. This method works correctly only with fonts that include character metric information; however, by default, the Flash authoring tool does not include this information for static text fields. Therefore, the method might return -1 instead of an index value. To ensure that an index value is returned, you can force the Flash authoring tool to include the character metric information for a font. To do this, add a dynamic text field that uses that font, select Character Options for that dynamic text field, and then specify that font outlines should be embedded for at least one character. (It doesn't matter which characters you specify, nor if they are the characters used in the static text fields.) hexColor The color used for the border placed around characters that have been selected by the corresponding setSelected() command, expressed in hexadecimal format (0xRRGGBB)."/>
<page href="flash/text/TextSnapshot.html#setSelected()" title="TextSnapshot.setSelected()" text="setSelected Specifies a range of characters in a TextSnapshot object to be selected or deselected. Characters that are selected are drawn with a colored rectangle behind them, matching the bounding box of the character. The color of the bounding box is defined by setSelectColor(). To select or deselect all characters, pass a value of 0 for beginIndex and charCount (or any very large number) for endIndex. To specify a single character, pass a value of start + 1 for endIndex. Because characters are individually marked as selected, you can call this method multiple times to select multiple characters; that is, using this method does not deselect other characters that have been set by this method. The colored rectangle that indicates a selection is displayed only for fonts that include character metric information; by default, Flash does not include this information for static text fields. In some cases, this behavior means that text that is selected won't appear to be selected onscreen. To ensure that all selected text appears to be selected, you can force the Flash authoring tool to include the character metric information for a font. To do this, add a dynamic text field that uses that font, select Character Options for that dynamic text field, and then specify that font outlines should be embedded for at least one character. It doesn't matter which characters you specify, nor even if they are the characters used in the static text fields in question. beginIndex endIndex select Indicates the position of the first character to select. Valid values for beginIndex are 0 through charCount - 1. If beginIndex is a negative value, 0 is used. An integer that is 1+ the index of the last character to be examined. Valid values for end are 0 through charCount. The character indexed by the end parameter is not included in the extracted string. If you omit this parameter, TextSnapshot.charCount is used. If the value of beginIndex is less than or equal to the value of endIndex, beginIndex + 1 is used. A Boolean value that specifies whether the text should be selected (true) or deselected (false)."/>
<page href="flash/text/TextSnapshot.html#charCount" title="TextSnapshot.charCount" text="charCount The number of characters in a TextSnapshot object."/>
<page href="flash/text/TextFormatAlign.html" title="TextFormatAlign class" text="TextFormatAlign The TextFormatAlign class provides values for text alignment in the TextFormat class."/>
<page href="flash/text/TextFormatAlign.html#CENTER" title="TextFormatAlign.CENTER" text="CENTER Constant; centers the text in the text field. Use the syntax TextFormatAlign.CENTER."/>
<page href="flash/text/TextFormatAlign.html#JUSTIFY" title="TextFormatAlign.JUSTIFY" text="JUSTIFY Constant; justifies text within the text field. Use the syntax TextFormatAlign.JUSTIFY."/>
<page href="flash/text/TextFormatAlign.html#LEFT" title="TextFormatAlign.LEFT" text="LEFT Constant; aligns text to the left within the text field. Use the syntax TextFormatAlign.LEFT."/>
<page href="flash/text/TextFormatAlign.html#RIGHT" title="TextFormatAlign.RIGHT" text="RIGHT Constant; aligns text to the right within the text field. Use the syntax TextFormatAlign.RIGHT."/>
<page href="fl/controls/Slider.html" title="Slider class" text="Slider The Slider component lets users select a value by moving a slider thumb between the end points of the slider track. The current value of the Slider component is determined by the relative location of the thumb between the end points of the slider, corresponding to the minimum and maximum values of the Slider component."/>
<page href="fl/controls/Slider.html#Slider()" title="Slider.Slider()" text="Slider Creates a new Slider component instance."/>
<page href="fl/controls/Slider.html#getStyleDefinition()" title="Slider.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/controls/Slider.html#setSize()" title="Slider.setSize()" text="setSize Sets the component to the specified width and height. width height The width of the component, in pixels. The height of the component, in pixels."/>
<page href="fl/controls/Slider.html#direction" title="Slider.direction" text="direction Sets the direction of the slider. Acceptable values are SliderDirection.HORIZONTAL and SliderDirection.VERTICAL. The following example uses a check box to switch the direction of a slider: import fl.controls.CheckBox; import fl.controls.Slider; import fl.controls.SliderDirection; var s:Slider = new Slider(); s.move(25,110); addChild(s); var cb:CheckBox = new CheckBox(); cb.move(10,130); cb.label = &quot;Vertical Slider&quot;; cb.addEventListener(Event.CHANGE, switchSliderDirection); addChild(cb); function switchSliderDirection(e:Event):void { if(s.direction == SliderDirection.HORIZONTAL) { s.direction = SliderDirection.VERTICAL; } else { s.direction = SliderDirection.HORIZONTAL; } }"/>
<page href="fl/controls/Slider.html#enabled" title="Slider.enabled" text="enabled Gets or sets a value that indicates whether the component can accept user interaction. A value of true indicates that the component can accept user interaction; a value of false indicates that it cannot. If you set the enabled property to false, the color of the container is dimmed and user input is blocked (with the exception of the Label and ProgressBar components)."/>
<page href="fl/controls/Slider.html#liveDragging" title="Slider.liveDragging" text="liveDragging Gets or sets a Boolean value that indicates whether the SliderEvent.CHANGE event is dispatched continuously as the user moves the slider thumb. If the liveDragging property is false, the SliderEvent.CHANGE event is dispatched when the user releases the slider thumb. The following example demonstrates how when the liveDragging property is true, a slider will dispatch a change event as its thumb is dragged: import fl.controls.Slider; import fl.events.SliderEvent; var s:Slider = new Slider(); s.move(10,10); s.liveDragging = true; s.addEventListener(SliderEvent.CHANGE, announceChange); addChild(s); function announceChange(e:SliderEvent):void { trace(&quot;Slider value is now: &quot; + e.target.value); }"/>
<page href="fl/controls/Slider.html#maximum" title="Slider.maximum" text="maximum The maximum allowed value on the Slider component instance."/>
<page href="fl/controls/Slider.html#minimum" title="Slider.minimum" text="minimum The minimum value allowed on the Slider component instance."/>
<page href="fl/controls/Slider.html#snapInterval" title="Slider.snapInterval" text="snapInterval Gets or sets the increment by which the value is increased or decreased as the user moves the slider thumb. For example, this property is set to 2, the minimum value is 0, and the maximum value is 10, the position of the thumb will always be at 0, 2, 4, 6, 8, or 10. If this property is set to 0, the slider moves continuously between the minimum and maximum values. The following example creates a new Slider instance and sets the snapInterval and tickInterval properties: import fl.controls.Slider; var mySlider:Slider = new Slider(); mySlider.minimum = 10; mySlider.maximum = 100; mySlider.liveDragging = true; mySlider.snapInterval = 5; mySlider.tickInterval = mySlider.snapInterval; mySlider.move(10, 10); addChild(mySlider);"/>
<page href="fl/controls/Slider.html#tickInterval" title="Slider.tickInterval" text="tickInterval The spacing of the tick marks relative to the maximum value of the component. The Slider component displays tick marks whenever you set the tickInterval property to a nonzero value. The following example demonstrates how to show tick marks above a slider: import fl.controls.Slider; var s:Slider = new Slider(); s.move(10,10); s.setSize(300,50); s.maximum = 100; s.minimum = 0; s.tickInterval = 5; addChild(s);"/>
<page href="fl/controls/Slider.html#value" title="Slider.value" text="value Gets or sets the current value of the Slider component. This value is determined by the position of the slider thumb between the minimum and maximum values."/>
<page href="fl/controls/Slider.html#event:change" title="Slider.change" text="change Dispatched when the value of the Slider component changes as a result of mouse or keyboard interaction. If the liveDragging property is true, the event is dispatched continuously as the user moves the thumb. If liveDragging is false, the event is dispatched when the user releases the slider thumb."/>
<page href="fl/controls/Slider.html#event:thumbDrag" title="Slider.thumbDrag" text="thumbDrag Dispatched when the slider thumb is pressed and then moved by the mouse. This event is always preceded by a thumbPress event. The following example creates a new Label and Slider component instance and listens for the slider's thumbDrag event: import fl.controls.Label; import fl.controls.Slider; import fl.events.SliderEvent; var myLabel:Label = new Label(); myLabel.autoSize = TextFieldAutoSize.LEFT; myLabel.text = &quot;&quot;; myLabel.move(10, 10); addChild(myLabel); var mySlider:Slider = new Slider(); mySlider.addEventListener(SliderEvent.THUMB_DRAG, thumbDragHandler); mySlider.move(myLabel.x, myLabel.y + myLabel.height); addChild(mySlider); function thumbDragHandler(event:SliderEvent):void { myLabel.text = event.type + &quot;: &quot; + event.value; }"/>
<page href="fl/controls/Slider.html#event:thumbPress" title="Slider.thumbPress" text="thumbPress Dispatched when the slider thumb is pressed."/>
<page href="fl/controls/Slider.html#event:thumbRelease" title="Slider.thumbRelease" text="thumbRelease Dispatched when the slider thumb is pressed and released. The following example listens for the Slider component's thumbPress and thumbRelease events and updates the data provider for a List component: import fl.controls.List; import fl.controls.Slider; import fl.data.DataProvider; import fl.events.SliderEvent; var dp:DataProvider = new DataProvider(); var mySlider:Slider = new Slider(); mySlider.snapInterval = 1; mySlider.tickInterval = mySlider.snapInterval; mySlider.addEventListener(SliderEvent.THUMB_PRESS, thumbPressHandler); mySlider.addEventListener(SliderEvent.THUMB_RELEASE, thumbReleaseHandler); mySlider.move(10, 10); addChild(mySlider); var myList:List = new List(); myList.dataProvider = dp; myList.move(mySlider.x + mySlider.width + 10, mySlider.y); addChild(myList); function thumbPressHandler(event:SliderEvent):void { myList.enabled = false; } function thumbReleaseHandler(event:SliderEvent):void { var sl:Slider = event.currentTarget as Slider; var i:uint; dp.removeAll(); for (i = sl.minimum; i &lt;= event.value; i++) { dp.addItem({label:&quot;Item &quot; + i, value:i}); } myList.rowCount = myList.length; myList.enabled = true; }"/>
<page href="fl/controls/Slider.html#style:sliderTrackDisabledSkin" title="Slider.sliderTrackDisabledSkin" text="sliderTrackDisabledSkin The skin for the track in a Slider component that is disabled."/>
<page href="fl/controls/Slider.html#style:sliderTrackSkin" title="Slider.sliderTrackSkin" text="sliderTrackSkin The skin for the track in a Slider component."/>
<page href="fl/controls/Slider.html#style:thumbDisabledSkin" title="Slider.thumbDisabledSkin" text="thumbDisabledSkin The skin that is used to indicate the disabled state of the thumb."/>
<page href="fl/controls/Slider.html#style:thumbDownSkin" title="Slider.thumbDownSkin" text="thumbDownSkin Name of the class to use as the skin for the thumb of the scroll bar when you click the thumb."/>
<page href="fl/controls/Slider.html#style:thumbOverSkin" title="Slider.thumbOverSkin" text="thumbOverSkin Name of the class to use as the skin for the thumb of the scroll bar when the mouse pointer is over the thumb."/>
<page href="fl/controls/Slider.html#style:thumbUpSkin" title="Slider.thumbUpSkin" text="thumbUpSkin Name of the class to use as the skin used for the thumb of the scroll bar."/>
<page href="fl/controls/Slider.html#style:tickSkin" title="Slider.tickSkin" text="tickSkin The skin for the ticks in a Slider component."/>
<page href="fl/controls/DataGrid.html" title="DataGrid class" text="DataGrid The DataGrid class is a list-based component that provides a grid of rows and columns. You can specify an optional header row at the top of the component that shows all the property names. Each row consists of one or more columns, each of which represents a property that belongs to the specified data object. The DataGrid component is used to view data; it is not intended to be used as a layout tool like an HTML table. A DataGrid component is well suited for the display of objects that contain multiple properties. The data that a DataGrid component displays can be contained in a DataProvider object or as an array of objects. The columns of a DataGrid component can be represented by a list of DataGridColumn objects, each of which contains information that is specific to the column. The DataGrid component provides the following features: Columns of different widths or identical fixed widths Columns that the user can resize at run time Columns that the user can reorder at run time by using ActionScript Optional customizable column headers Support for custom item renderers to display data other than text in any column Support for sorting data by clicking on the column that contains it The DataGrid component is composed of subcomponents including ScrollBar, HeaderRenderer, CellRenderer, DataGridCellEditor, and ColumnDivider components, all of which can be skinned during authoring or at run time. The DataGrid component uses the following classes that can be found in the dataGridClasses package: DataGridColumn: Describes a column in a DataGrid component. Contains the indexes, widths, and other properties of the column. Does not contain cell data. HeaderRenderer: Displays the column header for the current DataGrid column. Contains the label and other properties of the column header. DataGridCellEditor: Manages the editing of the data for each cell."/>
<page href="fl/controls/DataGrid.html#DataGrid()" title="DataGrid.DataGrid()" text="DataGrid Creates a new DataGrid component instance."/>
<page href="fl/controls/DataGrid.html#addColumn()" title="DataGrid.addColumn()" text="addColumn Adds a column to the end of the columns array. column A String or a DataGridColumn object. The following example creates a DataGrid component instance and adds two columns by passing a string to the addColumn() method: import fl.controls.DataGrid; var myDataGrid:DataGrid = new DataGrid(); myDataGrid.addColumn(&quot;name&quot;); myDataGrid.addColumn(&quot;value&quot;); myDataGrid.addItem({name:&quot;Name 1&quot;, value:&quot;Value 1&quot;}); myDataGrid.addItem({name:&quot;Name 2&quot;, value:&quot;Value 2&quot;}); myDataGrid.addItem({name:&quot;Name 3&quot;, value:&quot;Value 3&quot;}); myDataGrid.width = 200; myDataGrid.rowCount = myDataGrid.length; myDataGrid.move(10, 10); addChild(myDataGrid);"/>
<page href="fl/controls/DataGrid.html#addColumnAt()" title="DataGrid.addColumnAt()" text="addColumnAt Inserts a column at the specified index in the columns array. column index The string or DataGridColumn object that represents the column to be inserted. The array index that identifies the location at which the column is to be inserted. The following example specifies an order and size for its columns by manually adding them before setting its data provider: import fl.controls.DataGrid; import fl.controls.dataGridClasses.DataGridColumn; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { stateName:&quot;California&quot;, stateAbbreviation:&quot;CA&quot; } ); dp.addItem( { stateName:&quot;New York&quot;, stateAbbreviation:&quot;NY&quot; } ); var dg:DataGrid = new DataGrid(); var abbreviationColumn:DataGridColumn = dg.addColumn(new DataGridColumn(&quot;stateAbbreviation&quot;)); var nameColumn:DataGridColumn = dg.addColumn(&quot;stateName&quot;); abbreviationColumn.width = 100; nameColumn.width = 200; dg.move(10,10); dg.width = 300; dg.rowCount = 2; dg.dataProvider = dp; addChild(dg);"/>
<page href="fl/controls/DataGrid.html#createItemEditor()" title="DataGrid.createItemEditor()" text="createItemEditor Uses the editor specified by the itemEditor property to create an item editor for the item renderer at the column and row index identified by the editedItemPosition property. This method sets the editor instance as the itemEditorInstance property. You can call this method from the event listener for the itemEditBegin event. To create an editor from other code, set the editedItemPosition property to generate the itemEditBegin event. colIndex rowIndex The column index of the item to be edited in the data provider. The row index of the item to be edited in the data provider."/>
<page href="fl/controls/DataGrid.html#destroyItemEditor()" title="DataGrid.destroyItemEditor()" text="destroyItemEditor Closes an item editor that is currently open on an item renderer. This method is typically called from the event listener for the itemEditEnd event, after a call is made to the preventDefault() method to prevent the default event listener from executing."/>
<page href="fl/controls/DataGrid.html#editField()" title="DataGrid.editField()" text="editField Edits a given field or property in the DataGrid component. index dataField data The index of the data provider item to be edited. The name of the field or property in the data provider item to be edited. The new data value. The specified index is less than 0 or greater than or equal to the length of the data provider."/>
<page href="fl/controls/DataGrid.html#getCellRendererAt()" title="DataGrid.getCellRendererAt()" text="getCellRendererAt Get the instance of a cell renderer at the specified position in the DataGrid. Note: This method returns null for positions that are not visible (i.e. scrolled out of the view). row column A row index. A column index."/>
<page href="fl/controls/DataGrid.html#getColumnAt()" title="DataGrid.getColumnAt()" text="getColumnAt Retrieves the column that is located at the specified index of the columns array. index The index of the column to be retrieved, or null if a column is not found."/>
<page href="fl/controls/DataGrid.html#getColumnCount()" title="DataGrid.getColumnCount()" text="getColumnCount Retrieves the number of columns in the DataGrid component. The following example populates a new DataGrid and returns the number of columns using both the columns array and the getColumnCount() method: import fl.controls.DataGrid; import fl.controls.ScrollPolicy; import fl.data.DataProvider; var i:uint; var totalRows:uint = 16; var dp:DataProvider = new DataProvider(); for (i = 0; i &lt; totalRows; i++) { dp.addItem({col1:getRandomNumber(), col2:getRandomNumber(), col3:getRandomNumber(), col4:getRandomNumber()}); } var dg:DataGrid = new DataGrid(); dg.setSize(200, 300); dg.columns = [&quot;col1&quot;, &quot;col2&quot;, &quot;col3&quot;]; dg.dataProvider = dp; addChild(dg); trace(&quot;columns.length:&quot;, dg.columns.length); // 3 trace(&quot;getColumnCount():&quot;, dg.getColumnCount()); // 3 function getRandomNumber():uint { return Math.round(Math.random() * 100); }"/>
<page href="fl/controls/DataGrid.html#getColumnIndex()" title="DataGrid.getColumnIndex()" text="getColumnIndex Retrieves the index of the column of the specified name, or -1 if no match is found. name The data field of the column to be located."/>
<page href="fl/controls/DataGrid.html#getStyleDefinition()" title="DataGrid.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/controls/DataGrid.html#itemToCellRenderer()" title="DataGrid.itemToCellRenderer()" text="itemToCellRenderer The DataGrid component has multiple cells for any given item, so the itemToCellRenderer method always returns null. item The item in the data provider."/>
<page href="fl/controls/DataGrid.html#removeAllColumns()" title="DataGrid.removeAllColumns()" text="removeAllColumns Removes all columns from the DataGrid component."/>
<page href="fl/controls/DataGrid.html#removeColumnAt()" title="DataGrid.removeColumnAt()" text="removeColumnAt Removes the column that is located at the specified index of the columns array. index The index of the column to be removed."/>
<page href="fl/controls/DataGrid.html#scrollToIndex()" title="DataGrid.scrollToIndex()" text="scrollToIndex Scrolls the list to the item at the specified index. If the index is out of range, the scroll position does not change. newCaretIndex The index location to scroll to."/>
<page href="fl/controls/DataGrid.html#spaceColumnsEqually()" title="DataGrid.spaceColumnsEqually()" text="spaceColumnsEqually Resets the widths of the visible columns to the same size."/>
<page href="fl/controls/DataGrid.html#columns" title="DataGrid.columns" text="columns Gets or sets an array of DataGridColumn objects, one for each column that can be displayed. If not explicitly set, the DataGrid component examines the first item in the data provider, locates its properties, and then displays those properties in alphabetic order. You can make changes to the columns and to their order in this DataGridColumn array. After the changes are made, however, you must explicitly assign the changed array to the columns property. If an explicit assignment is not made, the set of columns that was used before will continue to be used. The following example adds new columns to the data grid using the columns array: import fl.controls.DataGrid; import fl.controls.ScrollPolicy; import fl.data.DataProvider; var i:uint; var totalRows:uint = 16; var dp:DataProvider = new DataProvider(); for (i = 0; i &lt; totalRows; i++) { dp.addItem({col1:getRandomNumber(), col2:getRandomNumber(), col3:getRandomNumber(), col4:getRandomNumber()}); } var dg:DataGrid = new DataGrid(); dg.setSize(200, 300); dg.columns = [&quot;col1&quot;, &quot;col2&quot;, &quot;col3&quot;]; dg.dataProvider = dp; addChild(dg); function getRandomNumber():uint { return Math.round(Math.random() * 100); }"/>
<page href="fl/controls/DataGrid.html#editable" title="DataGrid.editable" text="editable Indicates whether or not the user can edit items in the data provider. A value of true indicates that the user can edit items in the data provider; a value of false indicates that the user cannot. If this value is true, the item renderers in the component are editable. The user can click on an item renderer to open an editor. You can turn off editing for individual columns of the DataGrid component by using the DataGridColumn.editable property, or by handling the itemEditBeginning and itemEditBegin events."/>
<page href="fl/controls/DataGrid.html#editedItemPosition" title="DataGrid.editedItemPosition" text="editedItemPosition Gets or sets the column and row index of the item renderer for the data provider item that is being edited. If no item is being edited, this property is null. This object has two fields: columnIndex: The zero-based column index of the current item rowIndex: The zero-based row index of the current item For example: { columnIndex:2, rowIndex:3 } Setting this property scrolls the item into view and dispatches the itemEditBegin event to open an item editor on the specified item renderer. The following example provides input fields in which the user can specify the row and column to edit within a data grid. The DataGrid, Button, Label, TextInput components must be in the library of the FLA file that is published for this example to function correctly: import fl.data.DataProvider; import fl.controls.*; var dp:DataProvider = new DataProvider(); var totalEntries:uint = 42; var i:uint; for(i=0; i&lt;totalEntries; i++) { dp.addItem( { col1:&quot;CellName&quot;, col2:&quot;CellName&quot;, col3:&quot;CellName&quot; } ); } var dg:DataGrid = new DataGrid(); dg.columns = [ &quot;col1&quot;, &quot;col2&quot;, &quot;col3&quot; ]; dg.editable = true; dg.dataProvider = dp; dg.move(200,10); dg.setSize(200,300); addChild(dg); var rowIntro:Label = new Label(); rowIntro.text = &quot;Row to edit:&quot;; rowIntro.move(10,10); var colIntro:Label = new Label(); colIntro.text = &quot;Column to edit:&quot;; colIntro.move(10,30); var rowInputField:TextInput = new TextInput(); rowInputField.move(100,10); rowInputField.setSize(30,20); var colInputField:TextInput = new TextInput(); colInputField.move(100,30); colInputField.setSize(30,20); var editButton:Button = new Button(); editButton.move(10,60); editButton.label = &quot;Edit&quot;; editButton.addEventListener(MouseEvent.CLICK,editGrid); addChild(rowIntro); addChild(colIntro); addChild(rowInputField); addChild(colInputField); addChild(editButton); function editGrid(e:MouseEvent):void { dg.editedItemPosition = { rowIndex:Number(rowInputField.text), columnIndex:Number(colInputField.text) }; }"/>
<page href="fl/controls/DataGrid.html#editedItemRenderer" title="DataGrid.editedItemRenderer" text="editedItemRenderer Gets a reference to the item renderer in the DataGrid component whose item is currently being edited. If no item is being edited, this property contains a value of null. You can obtain the current value of the item that is being edited by using the editedItemRenderer.data property from an event listener for the itemEditBegin event or the itemEditEnd event. This is a read-only property. To set a custom item editor, use the itemEditor property of the class that represents the relevant column. The following example provides input fields in which the user can specify the row and column to edit within a data grid. The DataGrid, Button, Label, TextInput components must be in the library of the FLA file that is published for this example to function correctly: import fl.data.DataProvider; import fl.controls.*; var dp:DataProvider = new DataProvider(); var totalEntries:uint = 42; var i:uint; for(i=0; i&lt;totalEntries; i++) { dp.addItem( { col1:&quot;CellName&quot;, col2:&quot;CellName&quot;, col3:&quot;CellName&quot; } ); } var dg:DataGrid = new DataGrid(); dg.columns = [ &quot;col1&quot;, &quot;col2&quot;, &quot;col3&quot; ]; dg.editable = true; dg.dataProvider = dp; dg.move(200,10); dg.setSize(200,300); addChild(dg); var rowIntro:Label = new Label(); rowIntro.text = &quot;Row to edit:&quot;; rowIntro.move(10,10); var colIntro:Label = new Label(); colIntro.text = &quot;Column to edit:&quot;; colIntro.move(10,30); var rowInputField:TextInput = new TextInput(); rowInputField.move(100,10); rowInputField.setSize(30,20); var colInputField:TextInput = new TextInput(); colInputField.move(100,30); colInputField.setSize(30,20); var editButton:Button = new Button(); editButton.move(10,60); editButton.label = &quot;Edit&quot;; editButton.addEventListener(MouseEvent.CLICK,editGrid); addChild(rowIntro); addChild(colIntro); addChild(rowInputField); addChild(colInputField); addChild(editButton); function editGrid(e:MouseEvent):void { dg.editedItemPosition = { rowIndex:Number(rowInputField.text), columnIndex:Number(colInputField.text) }; }"/>
<page href="fl/controls/DataGrid.html#headerHeight" title="DataGrid.headerHeight" text="headerHeight Gets or sets the height of the DataGrid header, in pixels. The following example uses a slider to change the headerHeight property of a DataGrid component instance: import fl.controls.DataGrid; import fl.controls.Slider; import fl.events.SliderEvent; var headerHeightSlider:Slider = new Slider(); headerHeightSlider.minimum = 20; headerHeightSlider.maximum = 40; headerHeightSlider.snapInterval = 2; headerHeightSlider.tickInterval = 4; headerHeightSlider.liveDragging = true; headerHeightSlider.move(10, 10); headerHeightSlider.addEventListener(SliderEvent.CHANGE, changeHandler); addChild(headerHeightSlider); var myDataGrid:DataGrid = new DataGrid(); myDataGrid.headerHeight = headerHeightSlider.value; myDataGrid.addColumn(&quot;name&quot;); myDataGrid.addColumn(&quot;value&quot;); myDataGrid.addItem({name:&quot;Person A&quot;, value:0.85}); myDataGrid.addItem({name:&quot;Person B&quot;, value:0.87}); myDataGrid.width = 200; myDataGrid.rowCount = myDataGrid.length; myDataGrid.move(10, 30); addChild(myDataGrid); function changeHandler(event:SliderEvent):void { myDataGrid.headerHeight = event.value; myDataGrid.rowCount = myDataGrid.length; }"/>
<page href="fl/controls/DataGrid.html#horizontalScrollPolicy" title="DataGrid.horizontalScrollPolicy" text="horizontalScrollPolicy Gets or sets a Boolean value that indicates whether the horizontal scroll bar is always on. The following list describes the valid values: ScrollPolicy.ON: The scroll bar is always on. ScrollPolicy.OFF: The scroll bar is always off. ScrollPolicy.AUTO: The state of the scroll bar changes based on the parameters that are passed to the setScrollBarProperties() method. Note: If the combined width of the visible columns in the DataGrid component is smaller than the available width of the DataGrid component, the columns may not expand to fill the available space of the DataGrid component, depending on the value of the horizontalScrollPolicy property. The following list describes these values and their effects: ScrollPolicy.ON: The horizontal scroll bar is disabled. The columns do not expand to fill the available space of the DataGrid component. ScrollPolicy.AUTO: The horizontal scroll bar is not visible. The columns do not expand to fill the available space of the DataGrid component. The following example creates a data grid that uses a horizontal scrolling bar to provide more space for its cells: import fl.controls.DataGrid; import fl.controls.ScrollPolicy; import fl.data.DataProvider; var i:uint; var totalRows:uint = 42; var dp:DataProvider = new DataProvider(); for (i = 0; i &lt; totalRows; i++) { dp.addItem({col1:getRandomNumber(), col2:getRandomNumber(), col3:getRandomNumber(), col4:getRandomNumber(), col5:getRandomNumber(), col6:getRandomNumber(), col7:getRandomNumber()}); } var dg:DataGrid = new DataGrid(); dg.setSize(200,300); dg.addColumn(&quot;col1&quot;); dg.addColumn(&quot;col2&quot;); dg.addColumn(&quot;col3&quot;); dg.addColumn(&quot;col4&quot;); dg.addColumn(&quot;col5&quot;); dg.addColumn(&quot;col6&quot;); dg.addColumn(&quot;col7&quot;); dg.dataProvider = dp; dg.horizontalScrollPolicy = ScrollPolicy.ON; addChild(dg); function getRandomNumber():uint { return Math.round(Math.random() * 100); }"/>
<page href="fl/controls/DataGrid.html#imeMode" title="DataGrid.imeMode" text="imeMode Gets or sets the mode of the input method editor (IME). The IME makes it possible for users to use a QWERTY keyboard to enter characters from the Chinese, Japanese, and Korean character sets. Flash sets the IME to the specified mode when the component gets focus, and restores it to the original value after the component loses focus. The flash.system.IMEConversionMode class defines constants for the valid values for this property. Set this property to null to prevent the use of the IME with the component."/>
<page href="fl/controls/DataGrid.html#itemEditorInstance" title="DataGrid.itemEditorInstance" text="itemEditorInstance A reference to the currently active instance of the item editor, if one exists. To access the item editor instance and the new item value when an item is being edited, use the itemEditorInstance property. The itemEditorInstance property is not valid until after the event listener for the itemEditBegin event executes. For this reason, the itemEditorInstance property is typically accessed from the event listener for the itemEditEnd event. The DataGridColumn.itemEditor property defines the class of the item editor, and therefore, the data type of the item editor instance. The following example accesses the itemEditorInstance property of a data grid to determine the text of a cell after it has been edited: import fl.data.DataProvider; import fl.controls.DataGrid; import fl.controls.dataGridClasses.DataGridCellEditor; import fl.controls.listClasses.ListData; import fl.events.DataGridEvent; var dp:DataProvider = new DataProvider(); var totalEntries:uint = 42; var i:uint; for(i=0; i&lt;totalEntries; i++) { dp.addItem( { col1:&quot;CellName&quot;, col2:&quot;CellName&quot;, col3:&quot;CellName&quot; } ); } var dg:DataGrid = new DataGrid(); dg.addEventListener(DataGridEvent.ITEM_EDIT_END,onItemEditEnd); dg.dataProvider = dp; dg.editable = true; dg.setSize(300,200); addChild(dg); function onItemEditEnd(e:DataGridEvent):void { var cellEditor:DataGridCellEditor = dg.itemEditorInstance as DataGridCellEditor; var listData:ListData = cellEditor.listData; trace(&quot;After Edit: &quot; + cellEditor.text); }"/>
<page href="fl/controls/DataGrid.html#labelFunction" title="DataGrid.labelFunction" text="labelFunction Gets or sets a function that determines which fields of each item to use for the label text. The following example uses a label function for each column in the data grid: import fl.controls.DataGrid; import fl.controls.ScrollPolicy; import fl.controls.dataGridClasses.DataGridColumn; import fl.data.DataProvider; var i:uint; var totalRows:uint = 16; var dp:DataProvider = new DataProvider(); for (i = 0; i &lt; totalRows; i++) { dp.addItem({col1:getRandomNumber(), col2:getRandomNumber(), col3:getRandomNumber(), col4:getRandomNumber()}); } var c1:DataGridColumn = new DataGridColumn(&quot;col1&quot;); c1.sortOptions = Array.NUMERIC; var c2:DataGridColumn = new DataGridColumn(&quot;col2&quot;); c2.sortOptions = Array.NUMERIC; var c3:DataGridColumn = new DataGridColumn(&quot;col3&quot;); c3.sortOptions = Array.NUMERIC; var dg:DataGrid = new DataGrid(); dg.addColumn(c1); dg.addColumn(c2); dg.addColumn(c3); dg.dataProvider = dp; dg.labelFunction = currencyFormatter; dg.move(10, 10); dg.setSize(200, 300); addChild(dg); function getRandomNumber():Number { return Math.random() * 100; } function currencyFormatter(data:Object, column:DataGridColumn):String { return &quot;$&quot; + data[column.dataField].toFixed(2); }"/>
<page href="fl/controls/DataGrid.html#minColumnWidth" title="DataGrid.minColumnWidth" text="minColumnWidth Gets or sets the minimum width of a DataGrid column, in pixels. If this value is set to NaN, the minimum column width can be individually set for each column of the DataGrid component. The following example enables horizontal scrolling of a data grid and sets the minimum column width to 185, large enough to fit the width of the sample string: import fl.controls.DataGrid; import fl.controls.ScrollPolicy; import fl.data.DataProvider; var i:uint; var totalRows:uint = 42; var dp:DataProvider = new DataProvider(); for (i = 0; i &lt; totalRows; i++) { dp.addItem({col1:getString(), col2:getString(), col3:getString(), col4:getString(), col5:getString(), col6:getString(), col7:getString()}); } var dg:DataGrid = new DataGrid(); dg.setSize(450,300); dg.addColumn(&quot;col1&quot;); dg.addColumn(&quot;col2&quot;); dg.addColumn(&quot;col3&quot;); dg.addColumn(&quot;col4&quot;); dg.addColumn(&quot;col5&quot;); dg.addColumn(&quot;col6&quot;); dg.addColumn(&quot;col7&quot;); dg.dataProvider = dp; dg.horizontalScrollPolicy = ScrollPolicy.ON; dg.minColumnWidth = 185; addChild(dg); function getString():String { return &quot;This string requires a wide column&quot;; }"/>
<page href="fl/controls/DataGrid.html#resizableColumns" title="DataGrid.resizableColumns" text="resizableColumns Indicates whether the user can change the size of the columns. A value of true indicates that the user can change the column size; a value of false indicates that column size is fixed. If this value is true, the user can stretch or shrink the columns of the DataGrid component by dragging the grid lines between the header cells. Additionally, if this value is true, the user can change the size of the columns unless the resizeable properties of individual columns are set to false. The following example creates a DataGrid component instance and sets its resizableColumns and sortableColumns to false: import fl.controls.DataGrid; import fl.controls.dataGridClasses.DataGridColumn; var nameCol:DataGridColumn = new DataGridColumn(&quot;name&quot;); nameCol.headerText = &quot;NAME:&quot;; nameCol.width = 120; var valueCol:DataGridColumn = new DataGridColumn(&quot;value&quot;); valueCol.headerText = &quot;VALUE:&quot;; valueCol.width = 80; var myDataGrid:DataGrid = new DataGrid(); myDataGrid.addColumn(nameCol); myDataGrid.addColumn(valueCol); myDataGrid.addItem({name:&quot;Name A&quot;, value:&quot;Value A&quot;}); myDataGrid.addItem({name:&quot;Name B&quot;, value:&quot;Value B&quot;}); myDataGrid.addItem({name:&quot;Name C&quot;, value:&quot;Value C&quot;}); myDataGrid.resizableColumns = false; myDataGrid.sortableColumns = false; myDataGrid.width = 200; myDataGrid.rowCount = myDataGrid.length; myDataGrid.move(10, 10); addChild(myDataGrid);"/>
<page href="fl/controls/DataGrid.html#rowCount" title="DataGrid.rowCount" text="rowCount Gets or sets the number of rows that are at least partially visible in the list. The following example creates a DataGrid component instance and resizes the data grid using the rowCount property: import fl.controls.DataGrid; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem({col1:&quot;item 1.A&quot;, col2:&quot;item 1.B&quot;, col3:&quot;item 1.C&quot;}); dp.addItem({col1:&quot;item 2.A&quot;, col2:&quot;item 2.B&quot;, col3:&quot;item 2.C&quot;}); dp.addItem({col1:&quot;item 3.A&quot;, col2:&quot;item 3.B&quot;, col3:&quot;item 3.C&quot;}); dp.addItem({col1:&quot;item 4.A&quot;, col2:&quot;item 4.B&quot;, col3:&quot;item 4.C&quot;}); var myDataGrid:DataGrid = new DataGrid(); myDataGrid.addColumn(&quot;col1&quot;); myDataGrid.addColumn(&quot;col2&quot;); myDataGrid.addColumn(&quot;col3&quot;); myDataGrid.dataProvider = dp; myDataGrid.move(10, 10); myDataGrid.setSize(300, 200); addChild(myDataGrid); var fixedHeight:uint = Math.min(myDataGrid.rowCount, myDataGrid.length); myDataGrid.rowCount = fixedHeight; trace(myDataGrid.width, myDataGrid.height); // 300 105"/>
<page href="fl/controls/DataGrid.html#rowHeight" title="DataGrid.rowHeight" text="rowHeight Gets or sets the height of each row in the DataGrid component, in pixels. The following example adjusts the height of the rows in a data grid and reduces the text size of all the components on the Stage: import fl.controls.DataGrid; import fl.controls.dataGridClasses.DataGridColumn; import fl.data.DataProvider; import fl.managers.StyleManager; var dp:DataProvider = new DataProvider(); var totalEntries:uint = 42; var i:uint; for(i = 0; i &lt; totalEntries; i++) { dp.addItem( { col1:Math.random(), col2:Math.random(), col3:Math.random() } ); } var smallText:TextFormat = new TextFormat(); smallText.size = 9; smallText.font = &quot;Verdana&quot;; var dg:DataGrid = new DataGrid(); dg.columns = [&quot;col1&quot;, &quot;col2&quot;, &quot;col3&quot;]; dg.rowHeight = 14; dg.move(10, 10); dg.setSize(400, 300); dg.dataProvider = dp; dg.setStyle(&quot;textFormat&quot;, smallText); addChild(dg); StyleManager.setStyle(&quot;textFormat&quot;, smallText);"/>
<page href="fl/controls/DataGrid.html#showHeaders" title="DataGrid.showHeaders" text="showHeaders Gets or sets a Boolean value that indicates whether the DataGrid component shows column headers. A value of true indicates that the DataGrid component shows column headers; a value of false indicates that it does not. The following example creates two data grids, one with column headers and one without: import fl.controls.DataGrid; import fl.controls.ScrollPolicy; import fl.data.DataProvider; var i:uint; var totalRows:uint = 42; var dp:DataProvider = new DataProvider(); for (i = 0; i &lt; totalRows; i++) { dp.addItem({col1:Math.random(), col2:Math.random()}); } var dg1:DataGrid = new DataGrid(); dg1.move(10,10); dg1.setSize(200,300); dg1.dataProvider = dp; addChild(dg1); var dg2:DataGrid = new DataGrid(); dg2.move(250,10); dg2.setSize(200,300); dg2.dataProvider = dp; dg2.showHeaders = false; addChild(dg2);"/>
<page href="fl/controls/DataGrid.html#sortableColumns" title="DataGrid.sortableColumns" text="sortableColumns Indicates whether the user can sort the items in the data provider by clicking on a column header cell. If this value is true, the user can sort the data provider items by clicking on a column header cell; if this value is false, the user cannot. If this value is true, to prevent an individual column from responding to a user mouse click on a header cell, set the sortable property of that column to false. The sort field of a column is either the dataField or sortCompareFunction property of the DataGridColumn component. If the user clicks a column more than one time, the sort operation alternates between ascending and descending order. If both this property and the sortable property of a column are set to true, the DataGrid component dispatches a headerRelease event after the user releases the mouse button of the column header cell. If a call is not made to the preventDefault() method from a handler method of the headerRelease event, the DataGrid component performs a sort based on the values of the dataField or sortCompareFunction properties. The following example creates a DataGrid component instance and sets its sortableColumns property to false to prevent the list from being user sortable: import fl.controls.DataGrid; import fl.controls.dataGridClasses.DataGridColumn; import fl.data.DataProvider; import fl.events.DataGridEvent; var data:XML = &lt;dataProvider&gt; &lt;data col1=&quot;Person A&quot; col2=&quot;11.383&quot; /&gt; &lt;data col1=&quot;Person B&quot; col2=&quot;3.399&quot; /&gt; &lt;data col1=&quot;Person C&quot; col2=&quot;25.624&quot; /&gt; &lt;/dataProvider&gt; var dp:DataProvider = new DataProvider(data); var c1:DataGridColumn = new DataGridColumn(&quot;col1&quot;); var c2:DataGridColumn = new DataGridColumn(&quot;col2&quot;); var myDataGrid:DataGrid = new DataGrid(); myDataGrid.addColumn(c1); myDataGrid.addColumn(c2); myDataGrid.dataProvider = dp; myDataGrid.move(10, 10); myDataGrid.setSize(160, 120); myDataGrid.sortableColumns = false; addChild(myDataGrid);"/>
<page href="fl/controls/DataGrid.html#sortDescending" title="DataGrid.sortDescending" text="sortDescending Gets the order in which a column is sorted when the user clicks its header. A value of true indicates that the column is sorted in descending order; a value of false indicates that the column is sorted in ascending order. The sortDescending property does not affect how the sort method completes the sort operation. By default, the sort operation involves a case-sensitive string sort. To change this behavior, modify the sortOptions and sortCompareFunction properties of the DataGridColumn class. Note: If you query this property from an event listener for the headerRelease event, the property value identifies the sort order for the previous sort operation. This is because the next sort has not yet occurred. The following example creates a DataGrid component instance, listens for the headerRelease and traces the sortDescending, sortIndex, and dataField properties: import fl.controls.DataGrid; import fl.controls.dataGridClasses.DataGridColumn; import fl.data.DataProvider; import fl.events.DataGridEvent; var dataXML:XML = &lt;dataProvider&gt; &lt;data col1=&quot;Person A&quot; col2=&quot;11.383&quot; /&gt; &lt;data col1=&quot;Person B&quot; col2=&quot;3.399&quot; /&gt; &lt;data col1=&quot;Person C&quot; col2=&quot;25.624&quot; /&gt; &lt;/dataProvider&gt; var dp:DataProvider = new DataProvider(dataXML); var c1:DataGridColumn = new DataGridColumn(&quot;col1&quot;); var c2:DataGridColumn = new DataGridColumn(&quot;col2&quot;); c2.sortOptions = Array.NUMERIC; var myDataGrid:DataGrid = new DataGrid(); myDataGrid.addColumn(c1); myDataGrid.addColumn(c2); myDataGrid.dataProvider = dp; myDataGrid.width = 160; myDataGrid.rowCount = myDataGrid.length; myDataGrid.move(10, 10); myDataGrid.addEventListener(DataGridEvent.HEADER_RELEASE, headerReleaseHandler); addChild(myDataGrid); function headerReleaseHandler(event:DataGridEvent):void { var myDG:DataGrid = event.currentTarget as DataGrid; var whichColumn:DataGridColumn = myDG.getColumnAt(event.columnIndex); trace(&quot;sortDescending:&quot;, myDG.sortDescending); trace(&quot;sortIndex:&quot;, myDG.sortIndex); trace(&quot;dataField:&quot;, whichColumn.dataField); trace(&quot;&quot;); }"/>
<page href="fl/controls/DataGrid.html#sortIndex" title="DataGrid.sortIndex" text="sortIndex Gets the index of the column to be sorted."/>
<page href="fl/controls/DataGrid.html#event:columnStretch" title="DataGrid.columnStretch" text="columnStretch Dispatched after a user expands a column horizontally. The following example creates a DataGrid component and listens for its columnStretch event: import fl.controls.DataGrid; import fl.controls.dataGridClasses.DataGridColumn; import fl.data.DataProvider; import fl.events.DataGridEvent; var dp:DataProvider = new DataProvider(); dp.addItem({col1:&quot;item 1.A&quot;, col2:&quot;item 1.B&quot;, col3:&quot;item 1.C&quot;}); dp.addItem({col1:&quot;item 2.A&quot;, col2:&quot;item 2.B&quot;, col3:&quot;item 2.C&quot;}); dp.addItem({col1:&quot;item 3.A&quot;, col2:&quot;item 3.B&quot;, col3:&quot;item 3.C&quot;}); dp.addItem({col1:&quot;item 4.A&quot;, col2:&quot;item 4.B&quot;, col3:&quot;item 4.C&quot;}); var myDataGrid:DataGrid = new DataGrid(); myDataGrid.addColumn(&quot;col1&quot;); myDataGrid.addColumn(&quot;col2&quot;); myDataGrid.addColumn(&quot;col3&quot;); myDataGrid.dataProvider = dp; myDataGrid.setSize(300, 200); myDataGrid.move(10, 10); myDataGrid.addEventListener(DataGridEvent.COLUMN_STRETCH, columnStretchHandler); addChild(myDataGrid); function columnStretchHandler(event:DataGridEvent):void { var dg:DataGrid = event.target as DataGrid; var column:DataGridColumn; var columnArray:Array = dg.columns; var dgColWidth:String; trace(&quot;resized column:&quot;, event.dataField); trace(&quot;columnIndex:&quot;, event.columnIndex); for each (column in columnArray) { dgColWidth = Number(column.width / dg.width * 100).toFixed(1); trace(column.dataField + &quot;.width:&quot;, column.width + &quot; pixels (&quot; + dgColWidth + &quot;%)&quot;); } trace(&quot;----------&quot;); }"/>
<page href="fl/controls/DataGrid.html#event:headerRelease" title="DataGrid.headerRelease" text="headerRelease Dispatched after the user clicks a header cell. The following example creates a DataGrid component instance and listens for its headerRelease event: import fl.controls.DataGrid; import fl.controls.dataGridClasses.DataGridColumn; import fl.data.DataProvider; import fl.events.DataGridEvent; var dp:DataProvider = new DataProvider(); dp.addItem({col1:&quot;item 1.A&quot;, col2:&quot;item 1.B&quot;, col3:&quot;item 1.C&quot;}); dp.addItem({col1:&quot;item 2.A&quot;, col2:&quot;item 2.B&quot;, col3:&quot;item 2.C&quot;}); dp.addItem({col1:&quot;item 3.A&quot;, col2:&quot;item 3.B&quot;, col3:&quot;item 3.C&quot;}); dp.addItem({col1:&quot;item 4.A&quot;, col2:&quot;item 4.B&quot;, col3:&quot;item 4.C&quot;}); var myDataGrid:DataGrid = new DataGrid(); myDataGrid.addColumn(&quot;col1&quot;); myDataGrid.addColumn(&quot;col2&quot;); myDataGrid.addColumn(&quot;col3&quot;); myDataGrid.dataProvider = dp; myDataGrid.setSize(300, 200); myDataGrid.move(10, 10); myDataGrid.addEventListener(DataGridEvent.HEADER_RELEASE, headerReleaseHandler); addChild(myDataGrid); function headerReleaseHandler(event:DataGridEvent):void { var dg:DataGrid = event.target as DataGrid; trace(&quot;dataField:&quot;, event.dataField, &quot;(columnIndex:&quot; + event.columnIndex + &quot;)&quot;); trace(&quot;sortIndex:&quot;, dg.sortIndex); trace(&quot;sortDescending:&quot;, dg.sortDescending); trace(&quot;----------&quot;); }"/>
<page href="fl/controls/DataGrid.html#event:itemEditBegin" title="DataGrid.itemEditBegin" text="itemEditBegin Dispatched after the editedItemPosition property is set and the item can be edited."/>
<page href="fl/controls/DataGrid.html#event:itemEditBeginning" title="DataGrid.itemEditBeginning" text="itemEditBeginning Dispatched after a user prepares to edit an item, for example, by releasing the mouse button over the item."/>
<page href="fl/controls/DataGrid.html#event:itemEditEnd" title="DataGrid.itemEditEnd" text="itemEditEnd Dispatched when an item editing session ends for any reason."/>
<page href="fl/controls/DataGrid.html#event:itemFocusIn" title="DataGrid.itemFocusIn" text="itemFocusIn Dispatched after an item receives focus."/>
<page href="fl/controls/DataGrid.html#event:itemFocusOut" title="DataGrid.itemFocusOut" text="itemFocusOut Dispatched after an item loses focus."/>
<page href="fl/controls/DataGrid.html#style:columnDividerSkin" title="DataGrid.columnDividerSkin" text="columnDividerSkin The name of the class that provides the divider that appears between columns."/>
<page href="fl/controls/DataGrid.html#style:columnStretchCursorSkin" title="DataGrid.columnStretchCursorSkin" text="columnStretchCursorSkin The name of the class that provides the cursor that is used when the mouse is between two column headers and the resizableColumns property is set to true."/>
<page href="fl/controls/DataGrid.html#style:headerDisabledSkin" title="DataGrid.headerDisabledSkin" text="headerDisabledSkin The name of the class that provides the background for each column header when the component is disabled."/>
<page href="fl/controls/DataGrid.html#style:headerDisabledTextFormat" title="DataGrid.headerDisabledTextFormat" text="headerDisabledTextFormat The format to be applied to the text contained in each column header when the component is disabled."/>
<page href="fl/controls/DataGrid.html#style:headerDownSkin" title="DataGrid.headerDownSkin" text="headerDownSkin The name of the class that provides the background for each column header when the mouse is down."/>
<page href="fl/controls/DataGrid.html#style:headerOverSkin" title="DataGrid.headerOverSkin" text="headerOverSkin The name of the class that provides the background for each column header when the mouse is over it."/>
<page href="fl/controls/DataGrid.html#style:headerRenderer" title="DataGrid.headerRenderer" text="headerRenderer The name of the class that provides each column header."/>
<page href="fl/controls/DataGrid.html#style:headerSortArrowAscSkin" title="DataGrid.headerSortArrowAscSkin" text="headerSortArrowAscSkin The name of the class that provides the sort arrow when the sorted column is in ascending order."/>
<page href="fl/controls/DataGrid.html#style:headerSortArrowDescSkin" title="DataGrid.headerSortArrowDescSkin" text="headerSortArrowDescSkin The name of the class that provides the sort arrow when the sorted column is in descending order."/>
<page href="fl/controls/DataGrid.html#style:headerTextFormat" title="DataGrid.headerTextFormat" text="headerTextFormat The format to be applied to the text contained in each column header."/>
<page href="fl/controls/DataGrid.html#style:headerTextPadding" title="DataGrid.headerTextPadding" text="headerTextPadding The padding that separates the column header border from the column header text, in pixels."/>
<page href="fl/controls/DataGrid.html#style:headerUpSkin" title="DataGrid.headerUpSkin" text="headerUpSkin The name of the class that provides the background for each column header."/>
<page href="fl/controls/Button.html" title="Button class" text="Button The Button component represents a commonly used rectangular button. Button components display a text label, an icon, or both. A Button component is typically associated with an event handler method that listens for a click event and performs the specified task after the click event is dispatched. When the user clicks an enabled button, the button dispatches the click and buttonDown events. Even if it is not enabled, a button dispatches other events including mouseMove, mouseOver, mouseOut, rollOver, rollOut, mouseDown, and mouseUp. You can change the appearance of the button by associating a different skin with each button state. A Button component can also be set to function as a push button or a toggle button."/>
<page href="fl/controls/Button.html#Button()" title="Button.Button()" text="Button Creates a new Button component instance."/>
<page href="fl/controls/Button.html#getStyleDefinition()" title="Button.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/controls/Button.html#emphasized" title="Button.emphasized" text="emphasized Gets or sets a Boolean value that indicates whether a border is drawn around the Button component when the button is in its up state. A value of true indicates that the button is surrounded by a border when it is in its up state; a value of false indicates that it is not. The following example sets the Button instance's emphasizedPadding style based on the value of a Slider component: import fl.controls.Button; import fl.controls.Slider; import fl.events.SliderEvent; var styleObject:Object = Button.getStyleDefinition(); var defaultEmphasizedPadding:uint = styleObject.emphasizedPadding; var myButton:Button = new Button(); myButton.label = &quot;emphasizedPadding:&quot; + defaultEmphasizedPadding; myButton.emphasized = true; myButton.width = 150; myButton.move(20, 20); addChild(myButton); var mySlider:Slider = new Slider(); mySlider.snapInterval = 1; mySlider.tickInterval = 1; mySlider.liveDragging = true; mySlider.value = defaultEmphasizedPadding; mySlider.width = myButton.width; mySlider.move(20, 60); mySlider.addEventListener(SliderEvent.CHANGE, changeHandler); addChild(mySlider); function changeHandler(event:SliderEvent):void { myButton.label = &quot;emphasizedPadding:&quot; + event.value; myButton.setStyle(&quot;emphasizedPadding&quot;, event.value); }"/>
<page href="fl/controls/Button.html#style:emphasizedPadding" title="Button.emphasizedPadding" text="emphasizedPadding The padding to be applied around the Buttons in an emphasized skin, in pixels."/>
<page href="fl/controls/Button.html#style:emphasizedSkin" title="Button.emphasizedSkin" text="emphasizedSkin The skin to be used when a button has emphasis."/>
<page href="fl/controls/LabelButton.html" title="LabelButton class" text="LabelButton The LabelButton class is an abstract class that extends the BaseButton class by adding a label, an icon, and toggle functionality. The LabelButton class is subclassed by the Button, CheckBox, RadioButton, and CellRenderer classes. The LabelButton component is used as a simple button class that can be combined with custom skin states that support ScrollBar buttons, NumericStepper buttons, ColorPicker swatches, and so on."/>
<page href="fl/controls/LabelButton.html#LabelButton()" title="LabelButton.LabelButton()" text="LabelButton Creates a new LabelButton component instance."/>
<page href="fl/controls/LabelButton.html#getStyleDefinition()" title="LabelButton.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/controls/LabelButton.html#label" title="LabelButton.label" text="label Gets or sets the text label for the component. By default, the label text appears centered on the button. Note: Setting this property triggers the labelChange event object to be dispatched."/>
<page href="fl/controls/LabelButton.html#labelPlacement" title="LabelButton.labelPlacement" text="labelPlacement Position of the label in relation to a specified icon. In ActionScript, you can use the following constants to set this property: ButtonLabelPlacement.RIGHT ButtonLabelPlacement.LEFT ButtonLabelPlacement.BOTTOM ButtonLabelPlacement.TOP The following example creates a Button component instance and sets its labelPlacement property to ButtonLabelPlacement.BOTTOM: import fl.controls.Button; import fl.controls.ButtonLabelPlacement; var myButton:Button = new Button(); myButton.label = &quot;ButtonLabelPlacement.BOTTOM&quot;; myButton.labelPlacement = ButtonLabelPlacement.BOTTOM; myButton.setStyle(&quot;icon&quot;, myLibraryAsset); myButton.setSize(200, 100); myButton.move(10, 10); addChild(myButton);"/>
<page href="fl/controls/LabelButton.html#selected" title="LabelButton.selected" text="selected Gets or sets a Boolean value that indicates whether a toggle button is toggled in the on or off position. A value of true indicates that it is toggled in the on position; a value of false indicates that it is toggled in the off position. This property can be set only if the toggle property is set to true. For a CheckBox component, this value indicates whether the box displays a check mark. For a RadioButton component, this value indicates whether the component is selected. The user can change this property by clicking the component, but you can also set this property programmatically. If the toggle property is set to true, changing this property also dispatches a change event. The following example demonstrates how you can create a toggle button using the toggle property and listening for the change event to determine when a button is selected: import fl.controls.Button; var myButton:Button = new Button(); myButton.toggle = true; myButton.move(10, 10); myButton.addEventListener(Event.CHANGE, changeHandler); addChild(myButton); function changeHandler(event:Event):void { trace(&quot;Button toggled (selected:&quot; + event.currentTarget.selected + &quot;)&quot;); }"/>
<page href="fl/controls/LabelButton.html#textField" title="LabelButton.textField" text="textField A reference to the component's internal text field."/>
<page href="fl/controls/LabelButton.html#toggle" title="LabelButton.toggle" text="toggle Gets or sets a Boolean value that indicates whether a button can be toggled. A value of true indicates that it can; a value of false indicates that it cannot. If this value is true, clicking the button toggles it between selected and unselected states. You can get or set this state programmatically by using the selected property. If this value is false, the button does not stay pressed after the user releases it. In this case, its selected property is always false. Note: When the toggle is set to false, selected is forced to false because only toggle buttons can be selected. The following example creates a toggleable Button by setting its toggle property to true and listening for its change event to be dispatched: import fl.controls.Button; var myButton:Button = new Button(); myButton.toggle = true; myButton.selected = true; myButton.label = &quot;selected:&quot; + myButton.selected; myButton.width = 120; myButton.move(10, 10); myButton.addEventListener(Event.CHANGE, changeHandler); addChild(myButton); function changeHandler(event:Event):void { var myBtn:Button = event.currentTarget as Button; myBtn.label = &quot;selected:&quot; + myBtn.selected; }"/>
<page href="fl/controls/LabelButton.html#event:click" title="LabelButton.click" text="click Dispatched after the toggle button receives input from a mouse device or from the spacebar. The following example creates a Button component instance and listens for the click event to be dispatched: import fl.controls.Button; var myButton:Button = new Button(); myButton.label = &quot;Click me&quot;; myButton.addEventListener(MouseEvent.CLICK, clickHandler); myButton.move(10, 10); addChild(myButton); function clickHandler(event:MouseEvent):void { trace(&quot;clicked (localX:&quot; + event.localX + &quot;, localY:&quot; + event.localY + &quot;)&quot;); }"/>
<page href="fl/controls/LabelButton.html#event:labelChange" title="LabelButton.labelChange" text="labelChange Dispatched after the label value changes. The following example creates a Button component instance and listens for the labelChange event to be dispatched whenever the button's label property changes: import fl.controls.Button; import fl.events.ComponentEvent; var myButton:Button = new Button(); myButton.addEventListener(ComponentEvent.LABEL_CHANGE, labelChangeHandler); myButton.label = &quot;Click me&quot;; myButton.move(10, 10); addChild(myButton); function labelChangeHandler(event:ComponentEvent):void { trace(&quot;labelChange: &quot; + event.currentTarget.label); }"/>
<page href="fl/controls/LabelButton.html#style:disabledIcon" title="LabelButton.disabledIcon" text="disabledIcon Name of the class to use as the icon when the button is not disabled."/>
<page href="fl/controls/LabelButton.html#style:disabledSkin" title="LabelButton.disabledSkin" text="disabledSkin Name of the class to use as the skin for the background and border when the button is not selected and is disabled."/>
<page href="fl/controls/LabelButton.html#style:downIcon" title="LabelButton.downIcon" text="downIcon Name of the class to use as the icon when the button is not selected and the mouse button is down."/>
<page href="fl/controls/LabelButton.html#style:downSkin" title="LabelButton.downSkin" text="downSkin Name of the class to use as the skin for the background and border when the button is not selected and the mouse button is down."/>
<page href="fl/controls/LabelButton.html#style:embedFonts" title="LabelButton.embedFonts" text="embedFonts Indicates whether embedded font outlines are used to render the text field. If this value is true, Flash Player renders the text field by using embedded font outlines. If this value is false, Flash Player renders the text field by using device fonts. If you set the embedFonts property to true for a text field, you must specify a font for that text by using the font property of a TextFormat object that is applied to the text field. If the specified font is not embedded in the SWF file, the text is not displayed."/>
<page href="fl/controls/LabelButton.html#style:icon" title="LabelButton.icon" text="icon Name of the class to use as the icon when a toggle button is not selected and the mouse is not over the button."/>
<page href="fl/controls/LabelButton.html#style:overIcon" title="LabelButton.overIcon" text="overIcon Name of the class to use as the icon when the button is not selected and the mouse is over the component."/>
<page href="fl/controls/LabelButton.html#style:overSkin" title="LabelButton.overSkin" text="overSkin Name of the class to use as the skin for the background and border when the button is not selected and the mouse is over the component."/>
<page href="fl/controls/LabelButton.html#style:repeatDelay" title="LabelButton.repeatDelay" text="repeatDelay The number of milliseconds to wait after the buttonDown event is first dispatched before sending a second buttonDown event."/>
<page href="fl/controls/LabelButton.html#style:repeatInterval" title="LabelButton.repeatInterval" text="repeatInterval The interval, in milliseconds, between buttonDown events that are dispatched after the delay that is specified by the repeatDelay style."/>
<page href="fl/controls/LabelButton.html#style:selectedDisabledIcon" title="LabelButton.selectedDisabledIcon" text="selectedDisabledIcon Name of the class to use as the icon when the button is selected and disabled."/>
<page href="fl/controls/LabelButton.html#style:selectedDisabledSkin" title="LabelButton.selectedDisabledSkin" text="selectedDisabledSkin Name of the class to use as the skin for the background and border when a toggle button is selected and disabled."/>
<page href="fl/controls/LabelButton.html#style:selectedDownIcon" title="LabelButton.selectedDownIcon" text="selectedDownIcon Name of the class to use as the icon when the button is selected and the mouse button is down."/>
<page href="fl/controls/LabelButton.html#style:selectedDownSkin" title="LabelButton.selectedDownSkin" text="selectedDownSkin Name of the class to use as the skin for the background and border when a toggle button is selected and the mouse button is down."/>
<page href="fl/controls/LabelButton.html#style:selectedOverIcon" title="LabelButton.selectedOverIcon" text="selectedOverIcon Name of the class to use as the icon when the button is selected and the mouse is over the component."/>
<page href="fl/controls/LabelButton.html#style:selectedOverSkin" title="LabelButton.selectedOverSkin" text="selectedOverSkin Name of the class to use as the skin for the background and border when a toggle button is selected and the mouse is over the component."/>
<page href="fl/controls/LabelButton.html#style:selectedUpIcon" title="LabelButton.selectedUpIcon" text="selectedUpIcon Name of the class to use as the icon when the button is selected and the mouse button is up."/>
<page href="fl/controls/LabelButton.html#style:selectedUpSkin" title="LabelButton.selectedUpSkin" text="selectedUpSkin Name of the class to use as the skin for the background and border when a toggle button is selected and the mouse is not over the component."/>
<page href="fl/controls/LabelButton.html#style:textPadding" title="LabelButton.textPadding" text="textPadding The spacing between the text and the edges of the component, and the spacing between the text and the icon, in pixels."/>
<page href="fl/controls/LabelButton.html#style:upIcon" title="LabelButton.upIcon" text="upIcon Name of the class to use as the icon when a toggle button is not selected and the mouse is not over the button."/>
<page href="fl/controls/LabelButton.html#style:upSkin" title="LabelButton.upSkin" text="upSkin Name of the class to use as the skin for the background and border when the button is not selected and the mouse is not over the component."/>
<page href="fl/controls/TileList.html" title="TileList class" text="TileList The TileList class provides a grid of rows and columns that is typically used to format and display images in a &quot;tiled&quot; format. The default cell renderer for this component is the ImageCell class. An ImageCell cell renderer displays a thumbnail image and a single-line label. To render a list-based cell in a TileList component, use the CellRenderer class. To modify the padding that separates the cell border from the image, you can globally set the imagePadding style, or set it on the ImageCell class. Like other cell styles, the imagePadding style cannot be set on the TileList component instance."/>
<page href="fl/controls/TileList.html#TileList()" title="TileList.TileList()" text="TileList Creates a new List component instance."/>
<page href="fl/controls/TileList.html#getStyleDefinition()" title="TileList.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/controls/TileList.html#itemToLabel()" title="TileList.itemToLabel()" text="itemToLabel Retrieves the string that the renderer displays for a given data object based on the labelField and labelFunction properties. item The Object to be rendered."/>
<page href="fl/controls/TileList.html#scrollToIndex()" title="TileList.scrollToIndex()" text="scrollToIndex Scrolls the list to the item at the specified index. If the index is out of range, the scroll position does not change. newCaretIndex The index location to scroll to. The following example creates a TileList component instance and uses a Slider component to scroll through the images: import fl.controls.ScrollPolicy; import fl.controls.Slider; import fl.controls.TileList; import fl.data.DataProvider; import fl.events.SliderEvent; var dp:DataProvider = new DataProvider(); dp.addItem({label:&quot;Image 1&quot;, source:&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;}); dp.addItem({label:&quot;Image 2&quot;, source:&quot;http://www.helpexamples.com/flash/images/image2.jpg&quot;}); dp.addItem({label:&quot;Image 3&quot;, source:&quot;http://www.helpexamples.com/flash/images/image3.jpg&quot;}); dp.addItem({label:&quot;Image 4&quot;, source:&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;}); dp.addItem({label:&quot;Image 5&quot;, source:&quot;http://www.helpexamples.com/flash/images/image2.jpg&quot;}); dp.addItem({label:&quot;Image 6&quot;, source:&quot;http://www.helpexamples.com/flash/images/image3.jpg&quot;}); var myTileList:TileList = new TileList(); myTileList.dataProvider = dp; myTileList.scrollPolicy = ScrollPolicy.OFF; myTileList.columnWidth = 100; myTileList.rowHeight = 67; myTileList.columnCount = 3; myTileList.rowCount = 1; myTileList.move(10, 10); addChild(myTileList); var mySlider:Slider = new Slider(); mySlider.liveDragging = true; mySlider.minimum = 0; mySlider.maximum = dp.length - 1; mySlider.snapInterval = 1; mySlider.tickInterval = 1; mySlider.width = myTileList.width; mySlider.move(myTileList.x, myTileList.y + myTileList.height + 10); mySlider.addEventListener(SliderEvent.CHANGE, changeHandler); addChild(mySlider); function changeHandler(event:SliderEvent):void { myTileList.scrollToIndex(event.value); }"/>
<page href="fl/controls/TileList.html#columnCount" title="TileList.columnCount" text="columnCount Gets or sets the number of columns that are at least partially visible in the list. Setting the columnCount property changes the width of the list, but the TileList component does not maintain this value. It is important to set the columnCount value after setting the dataProvider and rowHeight values. The only exception is if the rowCount is set with the Property inspector; in this case, the property is maintained until the component is first drawn. The following example creates a TileList component instance and resizes it by setting its columnCount and rowCount properties: import fl.controls.TileList; import fl.controls.ScrollBarDirection; var myTileList:TileList = new TileList(); myTileList.addItem({label:&quot;Image 1&quot;, source:&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;}); myTileList.addItem({label:&quot;Image 2&quot;, source:&quot;http://www.helpexamples.com/flash/images/image2.jpg&quot;}); myTileList.addItem({label:&quot;Image 3&quot;, source:&quot;http://www.helpexamples.com/flash/images/image3.jpg&quot;}); myTileList.direction = ScrollBarDirection.VERTICAL; myTileList.columnWidth = 200; myTileList.rowHeight = 134; myTileList.columnCount = 1; myTileList.rowCount = 2; myTileList.move(10, 10); addChild(myTileList);"/>
<page href="fl/controls/TileList.html#columnWidth" title="TileList.columnWidth" text="columnWidth Gets or sets the width that is applied to a column in the list, in pixels. The following example creates a TileList component instance and sets its columnWidth and rowHeight properties based on the value of a slider: import fl.controls.Slider; import fl.controls.TileList; import fl.data.DataProvider; import fl.events.SliderEvent; var baseURL:String = &quot;http://www.helpexamples.com/flash/images/&quot;; var imagesXML:XML = &lt;images&gt; &lt;img src=&quot;image1.jpg&quot; alt=&quot;Image 1&quot; /&gt; &lt;img src=&quot;image2.jpg&quot; alt=&quot;Image 2&quot; /&gt; &lt;img src=&quot;image3.jpg&quot; alt=&quot;Image 3&quot; /&gt; &lt;/images&gt;; var dp:DataProvider = new DataProvider(imagesXML); var columnWidthSlider:Slider = new Slider(); columnWidthSlider.minimum = 50; columnWidthSlider.maximum = 200; columnWidthSlider.liveDragging = true; columnWidthSlider.snapInterval = 10; columnWidthSlider.tickInterval = 10; columnWidthSlider.width = columnWidthSlider.maximum - columnWidthSlider.minimum; columnWidthSlider.move(10, 10); columnWidthSlider.addEventListener(SliderEvent.CHANGE, changeHandler); addChild(columnWidthSlider); var myTileList:TileList = new TileList(); myTileList.dataProvider = dp; myTileList.labelField = &quot;alt&quot;; myTileList.sourceFunction = mySourceFunction; myTileList.width = 530; myTileList.rowCount = 1; myTileList.move(10, 30); addChild(myTileList); function mySourceFunction(item:Object):String { return baseURL + item.src; } function changeHandler(event:SliderEvent):void { myTileList.columnWidth = event.value; myTileList.rowHeight = event.value; myTileList.rowCount = 1; }"/>
<page href="fl/controls/TileList.html#dataProvider" title="TileList.dataProvider" text="dataProvider Gets or sets the data model of the list of items to be viewed. A data provider can be shared by multiple list-based components. Changes to the data provider are immediately available to all components that use it as a data source. The following example creates a new TileList and adds items to its data provider using the addItem() method: import fl.controls.TileList; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem({label:&quot;Image 1&quot;, source:&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;}); dp.addItem({label:&quot;Image 2&quot;, source:&quot;http://www.helpexamples.com/flash/images/image2.jpg&quot;}); dp.addItem({label:&quot;Image 3&quot;, source:&quot;http://www.helpexamples.com/flash/images/image3.jpg&quot;}); var myTileList:TileList = new TileList(); myTileList.dataProvider = dp; myTileList.columnWidth = 100; myTileList.rowHeight = 100; myTileList.columnCount = 2; myTileList.rowCount = 2; myTileList.move(10, 10); addChild(myTileList);"/>
<page href="fl/controls/TileList.html#direction" title="TileList.direction" text="direction Gets or sets a value that indicates whether the TileList component scrolls horizontally or vertically. A value of ScrollBarDirection.HORIZONTAL indicates that the TileList component scrolls horizontally; a value of ScrollBarDirection.VERTICAL indicates that the TileList component scrolls vertically. The following example creates a TileList componenent instance and sets its scrolling direction to vertical: import fl.controls.ScrollBarDirection; import fl.controls.TileList; var baseURL:String = &quot;http://www.helpexamples.com/flash/images/&quot;; var myTileList:TileList = new TileList(); myTileList.addItem({label:&quot;Image 1&quot;, source:baseURL + &quot;image1.jpg&quot;}); myTileList.addItem({label:&quot;Image 2&quot;, source:baseURL + &quot;image2.jpg&quot;}); myTileList.addItem({label:&quot;Image 3&quot;, source:baseURL + &quot;image3.jpg&quot;}); myTileList.direction = ScrollBarDirection.VERTICAL; myTileList.columnWidth = 100; myTileList.rowHeight= 67; myTileList.columnCount = 1; myTileList.rowCount = 1; myTileList.move(10, 10); addChild(myTileList);"/>
<page href="fl/controls/TileList.html#iconField" title="TileList.iconField" text="iconField Gets or sets the item field that provides the icon for the item. Note: The iconField is not used if the iconFunction property is set to a callback function. Icons can be classes or they can be symbols from the library that have a class name. The following example creates an icon beside the label of each item in a tile list. The icon must be a symbol in the library named MyIcon with &quot;Export for ActionScript&quot; toggled in its symbol properties: import fl.controls.TileList; import fl.controls.listClasses.CellRenderer; var baseURL:String = &quot;http://www.helpexamples.com/flash/images/&quot;; var myTileList:TileList = new TileList(); myTileList.addItem({src:baseURL + &quot;image1.jpg&quot;, iconSrc:MyIcon }); myTileList.addItem({src:baseURL + &quot;image2.jpg&quot;, iconSrc:MyIcon }); myTileList.addItem({src:baseURL + &quot;image3.jpg&quot;, iconSrc:MyIcon }); myTileList.labelField = &quot;src&quot;; myTileList.labelFunction = myLabelFunction; myTileList.setStyle('cellRenderer', CellRenderer); myTileList.iconField = &quot;iconSrc&quot;; myTileList.columnWidth = 100; myTileList.rowHeight = 67; myTileList.columnCount = myTileList.length; myTileList.rowCount = 1; myTileList.move(10, 10); addChild(myTileList); function myLabelFunction(item:Object):String { var fileName:String = item.src; var filePath:Array = fileName.split(&quot;/&quot;); return filePath.pop(); }"/>
<page href="fl/controls/TileList.html#iconFunction" title="TileList.iconFunction" text="iconFunction Gets or sets the function to be used to obtain the icon for the item. Note: The iconField is not used if the iconFunction property is set to a callback function. Icons can be classes, or they can be library items that have class names. The following example creates an icon beside only the second item of a tile list by using a function to determine if image2.jpg is the source of the item. The icon must be a symbol in the library named MyIcon with &quot;Export for ActionScript&quot; toggled in its symbol properties: import fl.controls.TileList; import fl.controls.listClasses.CellRenderer; var baseURL:String = &quot;http://www.helpexamples.com/flash/images/&quot;; var myTileList:TileList = new TileList(); myTileList.addItem({src:baseURL + &quot;image1.jpg&quot; }); myTileList.addItem({src:baseURL + &quot;image2.jpg&quot; }); myTileList.addItem({src:baseURL + &quot;image3.jpg&quot; }); myTileList.labelField = &quot;src&quot;; myTileList.labelFunction = myLabelFunction; myTileList.setStyle('cellRenderer', CellRenderer); myTileList.iconFunction = myIconFunction; myTileList.columnWidth = 100; myTileList.rowHeight = 67; myTileList.columnCount = myTileList.length; myTileList.rowCount = 1; myTileList.move(10, 10); addChild(myTileList); function myLabelFunction(item:Object):String { var fileName:String = item.src; var filePath:Array = fileName.split(&quot;/&quot;); return filePath.pop(); } function myIconFunction(item:Object):Class { if(item.src == baseURL + &quot;image2.jpg&quot;) { return MyIcon; } else { return null; } }"/>
<page href="fl/controls/TileList.html#innerHeight" title="TileList.innerHeight" text="innerHeight Gets the height of the content area, in pixels. This value is the component height minus the combined height of the contentPadding value and horizontal scroll bar height, if the horizontal scroll bar is visible."/>
<page href="fl/controls/TileList.html#innerWidth" title="TileList.innerWidth" text="innerWidth Gets the width of the content area, in pixels. This value is the component width minus the combined width of the contentPadding value and vertical scroll bar, if the vertical scroll bar is visible. The following example creates a TileList componenent instance and traces its innerWidth and innerHeight properties whenever the component's resize event is dispatched: import fl.controls.ScrollBarDirection; import fl.controls.TileList; import fl.events.ComponentEvent; var baseURL:String = &quot;http://www.helpexamples.com/flash/images/&quot;; var myTileList:TileList = new TileList(); myTileList.addItem({label:&quot;Image 1&quot;, source:baseURL + &quot;image1.jpg&quot;}); myTileList.addItem({label:&quot;Image 2&quot;, source:baseURL + &quot;image2.jpg&quot;}); myTileList.addItem({label:&quot;Image 3&quot;, source:baseURL + &quot;image3.jpg&quot;}); myTileList.direction = ScrollBarDirection.VERTICAL; myTileList.addEventListener(ComponentEvent.RESIZE, resizeHandler); myTileList.columnWidth = 100; myTileList.rowHeight= 67; myTileList.columnCount = 1; myTileList.rowCount = 1; myTileList.move(10, 10); addChild(myTileList); function resizeHandler(event:ComponentEvent):void { var myTL:TileList = event.currentTarget as TileList; trace(&quot;resize:&quot;); trace(&quot;\t&quot; + &quot;width:&quot;, myTL.width); trace(&quot;\t&quot; + &quot;height:&quot;, myTL.height); trace(&quot;\t&quot; + &quot;innerHeight:&quot;, myTL.innerHeight); trace(&quot;\t&quot; + &quot;innerWidth:&quot;, myTL.innerWidth); }"/>
<page href="fl/controls/TileList.html#labelField" title="TileList.labelField" text="labelField Gets or sets a field in each item that contains a label for each tile. Note: The labelField is not used if the labelFunction property is set to a callback function. The following example creates a TileList component instance and sets the labelField and sourceField properties: import fl.controls.TileList; import fl.data.DataProvider; var imagesXML:XML = &lt;images&gt; &lt;img src=&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot; alt=&quot;Image 1&quot; /&gt; &lt;img src=&quot;http://www.helpexamples.com/flash/images/image2.jpg&quot; alt=&quot;Image 2&quot; /&gt; &lt;img src=&quot;http://www.helpexamples.com/flash/images/image3.jpg&quot; alt=&quot;Image 3&quot; /&gt; &lt;/images&gt;; var dp:DataProvider = new DataProvider(imagesXML); var myTileList:TileList = new TileList(); myTileList.dataProvider = dp; myTileList.labelField = &quot;alt&quot;; myTileList.sourceField = &quot;src&quot;; myTileList.move(10, 10); addChild(myTileList);"/>
<page href="fl/controls/TileList.html#labelFunction" title="TileList.labelFunction" text="labelFunction Gets a function that indicates the fields of an item that provide the label text for a tile. Note: The labelField is not used if the labelFunction property is set to a callback function. The following example creates a TileList component instance and creates a custom label function that returns the file name of the image being loaded: import fl.controls.TileList; import fl.data.DataProvider; var imagesXML:XML = &lt;images&gt; &lt;img src=&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot; /&gt; &lt;img src=&quot;http://www.helpexamples.com/flash/images/image2.jpg&quot; /&gt; &lt;img src=&quot;http://www.helpexamples.com/flash/images/image3.jpg&quot; /&gt; &lt;/images&gt;; var dp:DataProvider = new DataProvider(imagesXML); var myTileList:TileList = new TileList(); myTileList.dataProvider = dp; myTileList.labelFunction = myLabelFunction; myTileList.sourceField = &quot;src&quot;; myTileList.columnWidth = 100; myTileList.rowHeight = 67; myTileList.columnCount = 3; myTileList.rowCount = 1; myTileList.move(10, 10); addChild(myTileList); function myLabelFunction(item:Object):String { var fileName:String = item.src; var filePath:Array = fileName.split(&quot;/&quot;); return filePath.pop(); }"/>
<page href="fl/controls/TileList.html#maxHorizontalScrollPosition" title="TileList.maxHorizontalScrollPosition" text="maxHorizontalScrollPosition Gets the maximum horizontal scroll position for the current content, in pixels."/>
<page href="fl/controls/TileList.html#rowCount" title="TileList.rowCount" text="rowCount Gets or sets the number of rows that are at least partially visible in the list. Setting the rowCount property changes the height of the list, but the TileList component does not maintain this value. It is important to set the rowCount value after setting the dataProvider and rowHeight values. The only exception is if the rowCount is set with the Property inspector; in this case, the property is maintained until the component is first drawn. The following example creates a TileList component instance and sets the columnCount and rowCount properties to create a grid of images: import fl.controls.TileList; import fl.data.DataProvider; var baseURL:String = &quot;http://www.helpexamples.com/flash/images/gallery1/thumbnails/&quot;; var imagesArray:Array = new Array(); var i:uint; for (i = 20; i &lt; 30; i++) { imagesArray.push({source:baseURL + &quot;pic&quot; + i + &quot;.jpg&quot;, label:&quot;Image &quot; + i}); } var dp:DataProvider = new DataProvider(imagesArray); var myTileList:TileList = new TileList(); myTileList.dataProvider = dp; myTileList.columnWidth = 150; myTileList.rowHeight = 100; myTileList.columnCount = 3; myTileList.rowCount = 2; myTileList.move(10, 10); addChild(myTileList);"/>
<page href="fl/controls/TileList.html#rowHeight" title="TileList.rowHeight" text="rowHeight Gets or sets the height that is applied to each row in the list, in pixels. The following example creates a TileList component instance and displays the specified images in a 2x2 grid: import fl.controls.TileList; var baseURL:String = &quot;http://www.helpexamples.com/flash/images/&quot;; var myTileList:TileList = new TileList(); myTileList.addItem({label:&quot;Image 1&quot;, source:baseURL + &quot;image1.jpg&quot;}); myTileList.addItem({label:&quot;Image 2&quot;, source:baseURL + &quot;image2.jpg&quot;}); myTileList.addItem({label:&quot;Image 3&quot;, source:baseURL + &quot;image3.jpg&quot;}); myTileList.columnWidth = 100; myTileList.rowHeight = 67; myTileList.columnCount = 2; myTileList.rowCount = 2; myTileList.move(10, 10); addChild(myTileList);"/>
<page href="fl/controls/TileList.html#scrollPolicy" title="TileList.scrollPolicy" text="scrollPolicy Gets or sets the scroll policy for the TileList component. This value is used to specify the scroll policy for the scroll bar that is set by the direction property. Note: The TileList component supports scrolling only in one direction. Tiles are adjusted to fit into the viewable area of the component, so that tiles are hidden in only one direction. The TileList component resizes to fit tiles only when the user manually sets the size or when the user sets the rowCount or columnCount properties. When this value is set to ScrollPolicy.AUTO, the scroll bar is visible only when the TileList component must scroll to show all the items. The following example creates a TileList component instance and sets the scrollPolicy to be always on: import fl.controls.ScrollPolicy; import fl.controls.TileList; var baseURL:String = &quot;http://www.helpexamples.com/flash/images/&quot;; var myTileList:TileList = new TileList(); myTileList.addItem({label:&quot;Image 1&quot;, source:baseURL + &quot;image1.jpg&quot;}); myTileList.addItem({label:&quot;Image 2&quot;, source:baseURL + &quot;image2.jpg&quot;}); myTileList.addItem({label:&quot;Image 3&quot;, source:baseURL + &quot;image3.jpg&quot;}); myTileList.columnWidth = 100; myTileList.rowHeight = 67; myTileList.scrollPolicy = ScrollPolicy.ON; myTileList.columnCount = 4; myTileList.rowCount = 1; myTileList.move(10, 10); addChild(myTileList);"/>
<page href="fl/controls/TileList.html#sourceField" title="TileList.sourceField" text="sourceField Gets or sets the item field that provides the source path for a tile. Note: The sourceField is not used if the sourceFunction property is set to a callback function. The following example creates a TileList component instance and sets the labelField and sourceField properties: import fl.controls.ScrollPolicy; import fl.controls.TileList; var baseURL:String = &quot;http://www.helpexamples.com/flash/images/&quot;; var myTileList:TileList = new TileList(); myTileList.addItem({alt:&quot;Image 1&quot;, src:baseURL + &quot;image1.jpg&quot;}); myTileList.addItem({alt:&quot;Image 2&quot;, src:baseURL + &quot;image2.jpg&quot;}); myTileList.addItem({alt:&quot;Image 3&quot;, src:baseURL + &quot;image3.jpg&quot;}); myTileList.labelField = &quot;alt&quot;; myTileList.sourceField = &quot;src&quot;; myTileList.columnWidth = 100; myTileList.rowHeight = 67; myTileList.columnCount = myTileList.length; myTileList.rowCount = 1; myTileList.move(10, 10); addChild(myTileList);"/>
<page href="fl/controls/TileList.html#sourceFunction" title="TileList.sourceFunction" text="sourceFunction Gets or sets the function to be used to obtain the source path for a tile. Note: The sourceField is not used if the sourceFunction property is set to a callback function. The following example creates a TileList component instance and sets the sourceFunction property: import fl.controls.ScrollPolicy; import fl.controls.TileList; var baseURL:String = &quot;http://www.helpexamples.com/flash/images/&quot;; var myTileList:TileList = new TileList(); myTileList.addItem({src:&quot;image1.jpg&quot;}); myTileList.addItem({src:&quot;image2.jpg&quot;}); myTileList.addItem({src:&quot;image3.jpg&quot;}); myTileList.labelField = &quot;src&quot;; myTileList.sourceFunction = mySourceFunction; myTileList.columnWidth = 100; myTileList.rowHeight = 67; myTileList.columnCount = myTileList.length; myTileList.rowCount = 1; myTileList.move(10, 10); addChild(myTileList); function mySourceFunction(item:Object):String { return baseURL + item.src; }"/>
<page href="fl/controls/TileList.html#style:cellRenderer" title="TileList.cellRenderer" text="cellRenderer The cell renderer to be used to render each item in the TileList component."/>
<page href="fl/controls/TileList.html#style:skin" title="TileList.skin" text="skin The skin to be used as the background of the TileList component."/>
<page href="fl/controls/ProgressBarMode.html" title="ProgressBarMode class" text="ProgressBarMode The ProgressBarMode class defines the values for the mode property of the ProgressBar class."/>
<page href="fl/controls/ProgressBarMode.html#EVENT" title="ProgressBarMode.EVENT" text="EVENT The component specified by the source property must dispatch progress and complete events. The ProgressBar uses these events to update its status. The following example creates ProgressBar, Label and UILoader component instances and displays the loading progress of an image: import fl.containers.UILoader; import fl.controls.Label; import fl.controls.ProgressBar; import fl.controls.ProgressBarMode; import fl.events.ComponentEvent; var url:String = &quot;http://www.helpexamples.com/flash/images/image2.jpg&quot;; var myUILoader:UILoader = new UILoader(); myUILoader.visible = false; myUILoader.scaleContent = false; myUILoader.autoLoad = false; myUILoader.source = url; myUILoader.addEventListener(ComponentEvent.RESIZE, resizeHandler); myUILoader.load(); var myProgressBar:ProgressBar = new ProgressBar(); myProgressBar.mode = ProgressBarMode.EVENT; myProgressBar.indeterminate = false; myProgressBar.source = myUILoader; myProgressBar.setSize(320, 12); myProgressBar.move((stage.stageWidth - myProgressBar.width) / 2, (stage.stageHeight - myProgressBar.height) / 2); myProgressBar.addEventListener(Event.COMPLETE, completeHandler); myProgressBar.addEventListener(ProgressEvent.PROGRESS, progressHandler); addChild(myProgressBar); var myLabel:Label = new Label(); myLabel.text = &quot;&quot;; myLabel.autoSize = TextFieldAutoSize.LEFT; myLabel.move(myProgressBar.x, myProgressBar.y + myProgressBar.height); addChild(myLabel); function progressHandler(event:ProgressEvent):void { trace(&quot;progress:&quot;, event.bytesLoaded, &quot;of&quot;, event.bytesTotal, &quot;bytes&quot;); myLabel.text = event.bytesLoaded + &quot; of &quot; + event.bytesTotal + &quot; (&quot; + event.currentTarget.percentComplete.toFixed(1) + &quot;%)&quot;; } function completeHandler(event:Event):void { trace(&quot;complete:&quot;); removeChild(myLabel); removeChild(myProgressBar); myProgressBar.removeEventListener(ProgressEvent.PROGRESS, progressHandler); myProgressBar.removeEventListener(Event.COMPLETE, completeHandler); addChild(myUILoader); } function resizeHandler(event:ComponentEvent):void { trace(&quot;resize:&quot;); var myUILdr:UILoader = event.currentTarget as UILoader; myUILdr.move((stage.stageWidth - myUILdr.width) / 2, (stage.stageHeight - myUILdr.height) / 2); myUILdr.visible = true; }"/>
<page href="fl/controls/ProgressBarMode.html#MANUAL" title="ProgressBarMode.MANUAL" text="MANUAL Manually update the status of the ProgressBar component. In this mode, you specify the minimum and maximum properties and use the setProgress() method to specify the status. The following example creates ProgressBar and Label component instances to display the progress bar's status: import fl.controls.Label; import fl.controls.ProgressBar; import fl.controls.ProgressBarMode; var myProgressBar:ProgressBar = new ProgressBar(); myProgressBar.indeterminate = false; myProgressBar.mode = ProgressBarMode.MANUAL; myProgressBar.maximum = 256; myProgressBar.setSize(320, 16); myProgressBar.move(10, 10) addChild(myProgressBar); var myLabel:Label = new Label(); myLabel.text = &quot;&quot;; myLabel.autoSize = TextFieldAutoSize.LEFT; myLabel.move(myProgressBar.x, myProgressBar.y + myProgressBar.height); addChild(myLabel); var t:Timer = new Timer(150); t.addEventListener(TimerEvent.TIMER, timerHandler); t.start(); function timerHandler(event:TimerEvent):void { myProgressBar.setProgress(myProgressBar.value + 1, myProgressBar.maximum); if (myProgressBar.percentComplete == 100) { myProgressBar.setProgress(0, myProgressBar.maximum); } myLabel.text = int(myProgressBar.value) + &quot; of &quot; + int(myProgressBar.maximum) + &quot; (&quot; + int(myProgressBar.percentComplete) + &quot;%)&quot;; }"/>
<page href="fl/controls/ProgressBarMode.html#POLLED" title="ProgressBarMode.POLLED" text="POLLED Progress is updated by polling the source. The source property must specify an object that exposes the bytesLoaded and bytesTotal properties. The following example uses the ProgressBar to display the loading progress of an FLV file: import fl.controls.ProgressBar; import fl.controls.ProgressBarMode; var url:String = &quot;http://www.helpexamples.com/flash/video/cuepoints.flv&quot;; var nc:NetConnection = new NetConnection(); nc.connect(null); var ns:NetStream = new NetStream(nc); ns.client = {onMetaData:metaDataHandler}; ns.play(url); var vid:Video = new Video(); vid.attachNetStream(ns); vid.x = (stage.stageWidth - vid.width) / 2; vid.y = (stage.stageHeight - vid.height) / 2; addChild(vid); var myProgressBar:ProgressBar = new ProgressBar(); myProgressBar.mode = ProgressBarMode.POLLED; myProgressBar.indeterminate = false; myProgressBar.source = ns; myProgressBar.setSize(vid.width, myProgressBar.height); myProgressBar.move(vid.x, vid.y + vid.height); addChild(myProgressBar); function metaDataHandler(meta:Object):void { try { trace(&quot;w:&quot; + meta.width, &quot;h:&quot; + meta.height); vid.width = meta.width; vid.height = meta.height; vid.x = (stage.stageWidth - vid.width) / 2; vid.y = (stage.stageHeight - vid.height) / 2; myProgressBar.width = vid.width; myProgressBar.move(vid.x, vid.y + vid.height); } catch (error:*) { // } }"/>
<page href="fl/controls/ProgressBar.html" title="ProgressBar class" text="ProgressBar The ProgressBar component displays the progress of content that is being loaded. The ProgressBar is typically used to display the status of images, as well as portions of applications, while they are loading. The loading process can be determinate or indeterminate. A determinate progress bar is a linear representation of the progress of a task over time and is used when the amount of content to load is known. An indeterminate progress bar has a striped fill and a loading source of unknown size."/>
<page href="fl/controls/ProgressBar.html#ProgressBar()" title="ProgressBar.ProgressBar()" text="ProgressBar Creates a new ProgressBar component instance."/>
<page href="fl/controls/ProgressBar.html#getStyleDefinition()" title="ProgressBar.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/controls/ProgressBar.html#reset()" title="ProgressBar.reset()" text="reset Resets the progress bar for a new load operation."/>
<page href="fl/controls/ProgressBar.html#setProgress()" title="ProgressBar.setProgress()" text="setProgress Sets the state of the bar to reflect the amount of progress made when using manual mode. The value argument is assigned to the value property and the maximum argument is assigned to the maximum property. The minimum property is not altered. value maximum A value describing the progress that has been made. The maximum progress value of the progress bar."/>
<page href="fl/controls/ProgressBar.html#direction" title="ProgressBar.direction" text="direction Indicates the fill direction for the progress bar. A value of ProgressBarDirection.RIGHT indicates that the progress bar is filled from left to right. A value of ProgressBarDirection.LEFT indicates that the progress bar is filled from right to left. The following example displays the difference between a progress bar that loads from the left and a progress bar that loads from the right. Replace testPath with a large file in order to test locally: import fl.controls.ProgressBar; import fl.controls.ProgressBarDirection; var testPath:String = &quot;largeVideo.flv&quot;; var loader:URLLoader = new URLLoader(); loader.load(new URLRequest(testPath)); var leftProgressBar:ProgressBar = new ProgressBar(); leftProgressBar.move(10,10); leftProgressBar.direction = ProgressBarDirection.LEFT; leftProgressBar.source = loader; addChild(leftProgressBar); var rightProgressBar:ProgressBar = new ProgressBar(); rightProgressBar.move(10,40); rightProgressBar.source = loader; rightProgressBar.direction = ProgressBarDirection.RIGHT; addChild(rightProgressBar);"/>
<page href="fl/controls/ProgressBar.html#indeterminate" title="ProgressBar.indeterminate" text="indeterminate Gets or sets a value that indicates the type of fill that the progress bar uses and whether the loading source is known or unknown. A value of true indicates that the progress bar has a striped fill and a loading source of unknown size. A value of false indicates that the progress bar has a solid fill and a loading source of known size. This property can only be set when the progress bar mode is set to ProgressBarMode.MANUAL."/>
<page href="fl/controls/ProgressBar.html#maximum" title="ProgressBar.maximum" text="maximum Gets or sets the maximum value for the progress bar when the ProgressBar.mode property is set to ProgressBarMode.MANUAL."/>
<page href="fl/controls/ProgressBar.html#minimum" title="ProgressBar.minimum" text="minimum Gets or sets the minimum value for the progress bar when the ProgressBar.mode property is set to ProgressBarMode.MANUAL."/>
<page href="fl/controls/ProgressBar.html#mode" title="ProgressBar.mode" text="mode Gets or sets the method to be used to update the progress bar. The following values are valid for this property: ProgressBarMode.EVENT ProgressBarMode.POLLED ProgressBarMode.MANUAL Event mode and polled mode are the most common modes. In event mode, the source property specifies loading content that generates progress and complete events; you should use a UILoader object in this mode. In polled mode, the source property specifies loading content, such as a custom class, that exposes bytesLoaded and bytesTotal properties. Any object that exposes these properties can be used as a source in polled mode. You can also use the ProgressBar component in manual mode by manually setting the maximum and minimum properties and making calls to the ProgressBar.setProgress() method."/>
<page href="fl/controls/ProgressBar.html#percentComplete" title="ProgressBar.percentComplete" text="percentComplete Gets a number between 0 and 100 that indicates the percentage of the content has already loaded. To change the percentage value, use the setProgress() method. The following example creates ProgressBar and Label component instances to display the progress bar's status: import fl.controls.Label; import fl.controls.ProgressBar; import fl.controls.ProgressBarMode; var myProgressBar:ProgressBar = new ProgressBar(); myProgressBar.indeterminate = false; myProgressBar.mode = ProgressBarMode.MANUAL; myProgressBar.maximum = 256; myProgressBar.setSize(320, 16); myProgressBar.move(10, 10) addChild(myProgressBar); var myLabel:Label = new Label(); myLabel.text = &quot;&quot;; myLabel.autoSize = TextFieldAutoSize.LEFT; myLabel.move(myProgressBar.x, myProgressBar.y + myProgressBar.height); addChild(myLabel); var t:Timer = new Timer(150); t.addEventListener(TimerEvent.TIMER, timerHandler); t.start(); function timerHandler(event:TimerEvent):void { myProgressBar.setProgress(myProgressBar.value + 1, myProgressBar.maximum); if (myProgressBar.percentComplete == 100) { myProgressBar.setProgress(0, myProgressBar.maximum); } myLabel.text = int(myProgressBar.value) + &quot; of &quot; + int(myProgressBar.maximum) + &quot; (&quot; + int(myProgressBar.percentComplete) + &quot;%)&quot;; }"/>
<page href="fl/controls/ProgressBar.html#source" title="ProgressBar.source" text="source Gets or sets a reference to the content that is being loaded and for which the ProgressBar is measuring the progress of the load operation. A typical usage of this property is to set it to a UILoader component. Use this property only in event mode and polled mode. The following example demonstrates how to link a progress bar to a loader by setting the source property. In order for the the progress bar to show loading progress, the dataPath variable must first be set to a remote file: import fl.controls.ProgressBar; var dataPath:String = &quot;test.txt&quot;; var loader:URLLoader = new URLLoader(); loader.load(new URLRequest(dataPath)); var pb:ProgressBar = new ProgressBar(); pb.source = loader; addChild(pb);"/>
<page href="fl/controls/ProgressBar.html#value" title="ProgressBar.value" text="value Gets or sets a value that indicates the amount of progress that has been made in the load operation. This value is a number between the minimum and maximum values."/>
<page href="fl/controls/ProgressBar.html#event:complete" title="ProgressBar.complete" text="complete Dispatched when the load operation completes. The following example loads an external image using a UILoader component and when the image has finished loading hides a ProgressBar and Label component: import fl.containers.UILoader; import fl.controls.Label; import fl.controls.ProgressBar; var url:String = &quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;; var myUILoader:UILoader = new UILoader(); myUILoader.autoLoad = false; myUILoader.source = url; myUILoader.move(10, 10); myUILoader.scaleContent = false; myUILoader.load(); var myProgressBar:ProgressBar = new ProgressBar(); myProgressBar.source = myUILoader; myProgressBar.move(myUILoader.x, myUILoader.y); myProgressBar.addEventListener(ProgressEvent.PROGRESS, progressHandler); myProgressBar.addEventListener(Event.COMPLETE, completeHandler); addChild(myProgressBar) var myLabel:Label = new Label(); myLabel.text = &quot;xx&quot;; myLabel.autoSize = TextFieldAutoSize.LEFT; myLabel.move(myProgressBar.x, myProgressBar.y + myProgressBar.height); addChild(myLabel); function progressHandler(event:ProgressEvent):void { trace(&quot;progress:&quot;, event.bytesLoaded, event.bytesTotal, int(event.currentTarget.percentComplete) + &quot;%&quot;); myLabel.text = event.bytesLoaded + &quot; of &quot; + event.bytesTotal + &quot; bytes loaded.&quot;; } function completeHandler(event:Event):void { trace(&quot;complete:&quot;); myProgressBar.removeEventListener(ProgressEvent.PROGRESS, progressHandler); myProgressBar.removeEventListener(Event.COMPLETE, completeHandler); removeChild(myProgressBar); removeChild(myLabel); addChild(myUILoader); }"/>
<page href="fl/controls/ProgressBar.html#event:progress" title="ProgressBar.progress" text="progress Dispatched as content loads in event mode or polled mode. The following example loads an external image using a UILoader component and when the image has finished loading hides a ProgressBar and Label component: import fl.containers.UILoader; import fl.controls.Label; import fl.controls.ProgressBar; var url:String = &quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;; var myUILoader:UILoader = new UILoader(); myUILoader.autoLoad = false; myUILoader.source = url; myUILoader.move(10, 10); myUILoader.scaleContent = false; myUILoader.load(); var myProgressBar:ProgressBar = new ProgressBar(); myProgressBar.source = myUILoader; myProgressBar.move(myUILoader.x, myUILoader.y); myProgressBar.addEventListener(ProgressEvent.PROGRESS, progressHandler); myProgressBar.addEventListener(Event.COMPLETE, completeHandler); addChild(myProgressBar) var myLabel:Label = new Label(); myLabel.text = &quot;xx&quot;; myLabel.autoSize = TextFieldAutoSize.LEFT; myLabel.move(myProgressBar.x, myProgressBar.y + myProgressBar.height); addChild(myLabel); function progressHandler(event:ProgressEvent):void { trace(&quot;progress:&quot;, event.bytesLoaded, event.bytesTotal, int(event.currentTarget.percentComplete) + &quot;%&quot;); myLabel.text = event.bytesLoaded + &quot; of &quot; + event.bytesTotal + &quot; bytes loaded.&quot;; } function completeHandler(event:Event):void { trace(&quot;complete:&quot;); myProgressBar.removeEventListener(ProgressEvent.PROGRESS, progressHandler); myProgressBar.removeEventListener(Event.COMPLETE, completeHandler); removeChild(myProgressBar); removeChild(myLabel); addChild(myUILoader); }"/>
<page href="fl/controls/ProgressBar.html#style:barPadding" title="ProgressBar.barPadding" text="barPadding The padding that separates the progress bar indicator from the track, in pixels."/>
<page href="fl/controls/ProgressBar.html#style:barSkin" title="ProgressBar.barSkin" text="barSkin Name of the class to use as the determinate progress bar."/>
<page href="fl/controls/ProgressBar.html#style:icon" title="ProgressBar.icon" text="icon Name of the class to use as the default icon. Setting any other icon style overrides this setting."/>
<page href="fl/controls/ProgressBar.html#style:indeterminateBar" title="ProgressBar.indeterminateBar" text="indeterminateBar The class to use as a renderer for the indeterminate bar animation. This is an advanced style."/>
<page href="fl/controls/ProgressBar.html#style:indeterminateSkin" title="ProgressBar.indeterminateSkin" text="indeterminateSkin Name of the class to use as the indeterminate progress bar. This is passed to the indeterminate bar renderer, which is specified by the indeterminateBar style."/>
<page href="fl/controls/ProgressBar.html#style:trackSkin" title="ProgressBar.trackSkin" text="trackSkin Name of the class to use as the progress indicator track."/>
<page href="fl/controls/TextInput.html" title="TextInput class" text="TextInput The TextInput component is a single-line text component that contains a native ActionScript TextField object. A TextInput component can be enabled or disabled in an application. When the TextInput component is disabled, it cannot receive input from mouse or keyboard. An enabled TextInput component implements focus, selection, and navigation like an ActionScript TextField object. You can use styles to customize the TextInput component by changing its appearance--for example, when it is disabled. Some other customizations that you can apply to this component include formatting it with HTML or setting it to be a password field whose text must be hidden."/>
<page href="fl/controls/TextInput.html#TextInput()" title="TextInput.TextInput()" text="TextInput Creates a new TextInput component instance."/>
<page href="fl/controls/TextInput.html#appendText()" title="TextInput.appendText()" text="appendText Appends the specified string after the last character that the TextArea contains. This method is more efficient than concatenating two strings by using an addition assignment on a text property; for example, myTextArea.text += moreText. This method is particularly useful when the TextArea component contains a significant amount of content. text The string to be appended to the existing text."/>
<page href="fl/controls/TextInput.html#drawFocus()" title="TextInput.drawFocus()" text="drawFocus Shows or hides the focus indicator on this component. The UIComponent class implements this method by creating and positioning an instance of the class that is specified by the focusSkin style. focused Indicates whether to show or hide the focus indicator. If this value is true, the focus indicator is shown; if this value is false, the focus indicator is hidden."/>
<page href="fl/controls/TextInput.html#getLineMetrics()" title="TextInput.getLineMetrics()" text="getLineMetrics Retrieves information about a specified line of text. index The line number for which information is to be retrieved. The following example draws a red rectangle over a text input's ascent from the baseline and a blue rectangle over its descent from the baseline: var format:TextFormat = new TextFormat(); format.size = 72; format.font = &quot;Georgia&quot;; import fl.controls.TextInput; var ti:TextInput = new TextInput(); addChild(ti); ti.setSize(393,82); ti.move(10,10); ti.setStyle(&quot;textFormat&quot;,format); ti.text = &quot;Hello World&quot;; ti.drawNow(); var metrics:TextLineMetrics = ti.getLineMetrics(0); var ascenderColoring:Shape = new Shape(); var descenderColoring:Shape = new Shape(); ti.addChild(ascenderColoring); ti.addChild(descenderColoring); ascenderColoring.graphics.clear(); ascenderColoring.graphics.beginFill(0xFF0000,0.2); ascenderColoring.graphics.drawRect(0, 0, metrics.width, metrics.ascent); descenderColoring.graphics.clear(); descenderColoring.graphics.beginFill(0x0000FF,0.2); descenderColoring.graphics.drawRect(0, metrics.ascent + 2, metrics.width, metrics.descent);"/>
<page href="fl/controls/TextInput.html#getStyleDefinition()" title="TextInput.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/controls/TextInput.html#setSelection()" title="TextInput.setSelection()" text="setSelection Sets the range of a selection made in a text area that has focus. The selection range begins at the index that is specified by the start parameter, and ends at the index that is specified by the end parameter. If the parameter values that specify the selection range are the same, this method sets the text insertion point in the same way that the caretIndex property does. The selected text is treated as a zero-based string of characters in which the first selected character is located at index 0, the second character at index 1, and so on. This method has no effect if the text field does not have focus. beginIndex endIndex The index location of the first character in the selection. The index location of the last character in the selection. The following example enters text into a TextInput instance and sets the selection to the second word: import fl.controls.TextInput; var ti:TextInput = new TextInput(); addChild(ti); ti.text = &quot;Hello World&quot;; ti.setFocus(); ti.setSelection(6, 11);"/>
<page href="fl/controls/TextInput.html#alwaysShowSelection" title="TextInput.alwaysShowSelection" text="alwaysShowSelection Gets or sets a Boolean value that indicates how a selection is displayed when the text field does not have focus. When this value is set to true and the text field does not have focus, Flash Player highlights the selection in the text field in gray. When this value is set to false and the text field does not have focus, Flash Player does not highlight the selection in the text field. The following example creates a TextInput component and selects some text using the setSelection() method: import fl.controls.TextInput; var myTextInput:TextInput = new TextInput(); myTextInput.text = &quot;The quick brown fox jumped over the lazy dog.&quot;; myTextInput.alwaysShowSelection = true; myTextInput.setSelection(16, 19); myTextInput.move(10, 10); addChild(myTextInput);"/>
<page href="fl/controls/TextInput.html#condenseWhite" title="TextInput.condenseWhite" text="condenseWhite Gets or sets a Boolean value that indicates whether extra white space is removed from a TextInput component that contains HTML text. Examples of extra white space in the component include spaces and line breaks. A value of true indicates that extra white space is removed; a value of false indicates that extra white space is not removed. This property affects only text that is set by using the htmlText property; it does not affect text that is set by using the text property. If you use the text property to set text, the condenseWhite property is ignored. If the condenseWhite property is set 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."/>
<page href="fl/controls/TextInput.html#displayAsPassword" title="TextInput.displayAsPassword" text="displayAsPassword Gets or sets a Boolean value that indicates whether the current TextInput component instance was created to contain a password or to contain text. A value of true indicates that the component instance is a password text field; a value of false indicates that the component instance is a normal text field. When this property is set to true, for each character that the user enters into the text field, the TextInput component instance displays an asterisk. Additionally, the Cut and Copy commands and their keyboard shortcuts are disabled. These measures prevent the recovery of a password from an unattended computer. The following example creates two TextInput component instances, one with the displayAsPassword property set to true and the other one set to false: import fl.controls.Label; import fl.controls.TextInput; var usernameLabel:Label = new Label(); usernameLabel.text = &quot;User name:&quot;; usernameLabel.move(10, 10); addChild(usernameLabel); var usernameTextInput:TextInput = new TextInput(); usernameTextInput.move(90, 10); addChild(usernameTextInput); var passwordLabel:Label = new Label(); passwordLabel.text = &quot;Password:&quot;; passwordLabel.move(10, 40); addChild(passwordLabel); var passwordTextInput:TextInput = new TextInput(); passwordTextInput.displayAsPassword = true; passwordTextInput.move(90, 40); addChild(passwordTextInput);"/>
<page href="fl/controls/TextInput.html#editable" title="TextInput.editable" text="editable Gets or sets a Boolean value that indicates whether the text field can be edited by the user. A value of true indicates that the user can edit the text field; a value of false indicates that the user cannot edit the text field."/>
<page href="fl/controls/TextInput.html#enabled" title="TextInput.enabled" text="enabled Gets or sets a value that indicates whether the component can accept user interaction. A value of true indicates that the component can accept user interaction; a value of false indicates that it cannot. If you set the enabled property to false, the color of the container is dimmed and user input is blocked (with the exception of the Label and ProgressBar components)."/>
<page href="fl/controls/TextInput.html#horizontalScrollPosition" title="TextInput.horizontalScrollPosition" text="horizontalScrollPosition Gets or sets the position of the thumb of the horizontal scroll bar. The following example creates a TextInput component instance and displays the current value of its horizontalScrollPosition and maxHorizontalScrollPosition properties: import fl.controls.Label; import fl.controls.Slider; import fl.controls.TextInput; import fl.events.SliderEvent; var myTextInput:TextInput = new TextInput(); myTextInput.text = &quot;The quick brown fox jumped over the lazy dog.&quot;; myTextInput.width = 120; myTextInput.move(10, 10); myTextInput.addEventListener(Event.CHANGE, textInputChangeHandler); myTextInput.textField.addEventListener(Event.SCROLL, scrollHandler); addChild(myTextInput); var mySlider:Slider = new Slider(); mySlider.snapInterval = 1; mySlider.tickInterval = 10; mySlider.minimum = 0; mySlider.maximum = myTextInput.maxHorizontalScrollPosition; mySlider.value = myTextInput.horizontalScrollPosition; mySlider.liveDragging = true; mySlider.addEventListener(SliderEvent.CHANGE, sliderChangeHandler); mySlider.width = 120; mySlider.move(10, 40); addChild(mySlider); var myLabel:Label = new Label(); myLabel.autoSize = TextFieldAutoSize.LEFT; myLabel.text = &quot;&quot;; myLabel.move(10, 50); addChild(myLabel); getScrollPosition(); function getScrollPosition():void { myTextInput.drawNow(); var scrollPos:uint = myTextInput.horizontalScrollPosition; var maxScrollPos:uint = myTextInput.maxHorizontalScrollPosition; myLabel.text = &quot;scrollPosition: &quot; + scrollPos + &quot; of &quot; + maxScrollPos; mySlider.value = scrollPos; mySlider.maximum = maxScrollPos; } function scrollHandler(event:Event):void { getScrollPosition(); } function sliderChangeHandler(event:SliderEvent):void { myTextInput.horizontalScrollPosition = event.value; getScrollPosition(); } function textInputChangeHandler(event:Event):void { getScrollPosition(); }"/>
<page href="fl/controls/TextInput.html#htmlText" title="TextInput.htmlText" text="htmlText Contains the HTML representation of the string that the text field contains. The following example creates an uneditable TextInput component and sets the htmlText property to apply HTML formatting the text field's text: import fl.controls.TextInput; var myTextInput:TextInput = new TextInput(); myTextInput.editable = false; myTextInput.enabled = false; myTextInput.htmlText = &quot;(&lt;i&gt;auto assigned&lt;/i&gt;)&quot;; myTextInput.move(10, 10); addChild(myTextInput);"/>
<page href="fl/controls/TextInput.html#imeMode" title="TextInput.imeMode" text="imeMode Gets or sets the mode of the input method editor (IME). The IME makes it possible for users to use a QWERTY keyboard to enter characters from the Chinese, Japanese, and Korean character sets. Flash sets the IME to the specified mode when the component gets focus, and restores it to the original value after the component loses focus. The flash.system.IMEConversionMode class defines constants for the valid values for this property. Set this property to null to prevent the use of the IME with the component."/>
<page href="fl/controls/TextInput.html#length" title="TextInput.length" text="length Gets the number of characters in a TextInput component. The following example creates a TextInput component and sets its maxChars and restrict properties to restrict the characters that can be entered: import fl.controls.Label; import fl.controls.TextInput; var myTextInput:TextInput = new TextInput(); myTextInput.restrict = &quot;0-9A-F&quot;; myTextInput.maxChars = 6; myTextInput.move(10, 10); myTextInput.addEventListener(Event.CHANGE, changeHandler); addChild(myTextInput); var myLabel:Label = new Label(); myLabel.autoSize = TextFieldAutoSize.LEFT; myLabel.text = myTextInput.length + &quot; of &quot; + myTextInput.maxChars; myLabel.move(10, 30); addChild(myLabel); function changeHandler(event:Event):void { myLabel.text = myTextInput.length + &quot; of &quot; + myTextInput.maxChars; }"/>
<page href="fl/controls/TextInput.html#maxChars" title="TextInput.maxChars" text="maxChars Gets or sets the maximum number of characters that a user can enter in the text field. The following example creates a TextInput component and sets its maxChars and restrict properties to restrict the characters that can be entered: import fl.controls.Label; import fl.controls.TextInput; var myTextInput:TextInput = new TextInput(); myTextInput.restrict = &quot;0-9A-F&quot;; myTextInput.maxChars = 6; myTextInput.move(10, 10); myTextInput.addEventListener(Event.CHANGE, changeHandler); addChild(myTextInput); var myLabel:Label = new Label(); myLabel.autoSize = TextFieldAutoSize.LEFT; myLabel.text = myTextInput.length + &quot; of &quot; + myTextInput.maxChars; myLabel.move(10, 30); addChild(myLabel); function changeHandler(event:Event):void { myLabel.text = myTextInput.length + &quot; of &quot; + myTextInput.maxChars; }"/>
<page href="fl/controls/TextInput.html#maxHorizontalScrollPosition" title="TextInput.maxHorizontalScrollPosition" text="maxHorizontalScrollPosition Gets a value that describes the furthest position to which the text field can be scrolled to the right."/>
<page href="fl/controls/TextInput.html#restrict" title="TextInput.restrict" text="restrict Gets or sets the string of characters that the text field accepts from a user. Note that characters that are not included in this string are accepted in the text field if they are entered programmatically. The characters in the string are read from left to right. You can specify a character range by using the hyphen (-) character. If the value of this property is null, the text field accepts all characters. If this property is set to an empty string (&quot;&quot;), the text field accepts no characters. If the string begins with a caret (^) character, all characters are initially accepted and succeeding characters in the string are excluded from the set of accepted characters. If the string does not begin with a caret (^) character, no characters are initially accepted and succeeding characters in the string are included in the set of accepted characters."/>
<page href="fl/controls/TextInput.html#selectionBeginIndex" title="TextInput.selectionBeginIndex" text="selectionBeginIndex Gets the index value of the first selected character in a selection of one or more characters. The index position of a selected character is zero-based and calculated from the first character that appears in the text area. If there is no selection, this value is set to the position of the caret. The following example creates a Label component which displays the selectionBeginIndex and selectionEndIndex properties for a TextInput component. This example also creates two Slider component instances that can be used to set the selection begin index and selection end index programmatically using the setSelection() method: import fl.controls.Label; import fl.controls.Slider; import fl.controls.TextInput; import fl.events.SliderEvent; var myTextInput:TextInput = new TextInput(); myTextInput.alwaysShowSelection = true; myTextInput.text = &quot;The quick brown fox jumped over the lazy dog.&quot;; myTextInput.width = 120; myTextInput.move(10, 10); myTextInput.addEventListener(Event.CHANGE, changeHandler); myTextInput.addEventListener(FocusEvent.FOCUS_IN, focusInHandler); myTextInput.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler); addChild(myTextInput); var myLabel:Label = new Label(); myLabel.autoSize = TextFieldAutoSize.LEFT; myLabel.text = &quot;&quot;; myLabel.move(10, 30); addChild(myLabel); var beginSlider:Slider = new Slider(); beginSlider.maximum = myTextInput.length; beginSlider.snapInterval = 1; beginSlider.liveDragging = true; beginSlider.width = 120; beginSlider.move(10, 65); beginSlider.addEventListener(SliderEvent.CHANGE, beginChangeHandler); addChild(beginSlider); var endSlider:Slider = new Slider(); endSlider.maximum = myTextInput.length; endSlider.snapInterval = 1; endSlider.liveDragging = true; endSlider.width = 120; endSlider.move(10, 85); endSlider.addEventListener(SliderEvent.CHANGE, endChangeHandler); addChild(endSlider); var t:Timer = new Timer(50); t.addEventListener(TimerEvent.TIMER, timerHandler); function changeHandler(event:Event):void { beginSlider.maximum = myTextInput.length; endSlider.maximum = myTextInput.length; updateUI(); } function focusInHandler(event:FocusEvent):void { t.start(); } function focusOutHandler(event:FocusEvent):void { t.stop(); } function beginChangeHandler(event:SliderEvent):void { myTextInput.setSelection(event.value, myTextInput.selectionEndIndex); updateUI(); } function endChangeHandler(event:SliderEvent):void { myTextInput.setSelection(myTextInput.selectionBeginIndex, event.value); updateUI(); } function timerHandler(event:TimerEvent):void { updateUI(); } function updateUI():void { myLabel.text = &quot;selectionBeginIndex:&quot; + myTextInput.selectionBeginIndex + &quot;\n&quot;; myLabel.text += &quot;selectionEndIndex:&quot; + myTextInput.selectionEndIndex; beginSlider.value = myTextInput.selectionBeginIndex; endSlider.value = myTextInput.selectionEndIndex; }"/>
<page href="fl/controls/TextInput.html#selectionEndIndex" title="TextInput.selectionEndIndex" text="selectionEndIndex Gets the index position of the last selected character in a selection of one or more characters. The index position of a selected character is zero-based and calculated from the first character that appears in the text area. If there is no selection, this value is set to the position of the caret."/>
<page href="fl/controls/TextInput.html#text" title="TextInput.text" text="text Gets or sets a string which contains the text that is currently in the TextInput component. This property contains text that is unformatted and does not have HTML tags. To retrieve this text formatted as HTML, use the htmlText property."/>
<page href="fl/controls/TextInput.html#textField" title="TextInput.textField" text="textField A reference to the internal text field of the TextInput component. The following example creates a TextInput component instance and uses the textField property to access the underlying native ActionScript TextField object and call its replaceText() method: import fl.controls.TextInput; var myTextInput:TextInput = new TextInput(); myTextInput.text = &quot;The quick brown fox jumped over the lazy dog.&quot;; myTextInput.textField.replaceText(41, 44, &quot;fox&quot;); myTextInput.textField.replaceText(16, 19, &quot;dog&quot;); addChild(myTextInput);"/>
<page href="fl/controls/TextInput.html#textHeight" title="TextInput.textHeight" text="textHeight The height of the text, in pixels."/>
<page href="fl/controls/TextInput.html#textWidth" title="TextInput.textWidth" text="textWidth The width of the text, in pixels. The following example creates a TextInput component instance and traces out the textWidth and textHeight propreties whenever the contents of the text field have changed: import fl.controls.TextInput; var myTextInput:TextInput = new TextInput(); myTextInput.move(10, 10); myTextInput.addEventListener(Event.CHANGE, changeHandler); addChild(myTextInput); function changeHandler(event:Event):void { trace(&quot;textWidth:&quot; + myTextInput.textWidth + &quot;, textHeight:&quot; + myTextInput.textHeight); }"/>
<page href="fl/controls/TextInput.html#event:change" title="TextInput.change" text="change Dispatched when user input changes text in the TextInput component. Note: This event does not occur if ActionScript is used to change the text."/>
<page href="fl/controls/TextInput.html#event:enter" title="TextInput.enter" text="enter Dispatched when the user presses the Enter key."/>
<page href="fl/controls/TextInput.html#event:textInput" title="TextInput.textInput" text="textInput Dispatched when the user inputs text."/>
<page href="fl/controls/TextInput.html#style:disabledSkin" title="TextInput.disabledSkin" text="disabledSkin The name of the class to use as a background for the TextInput component when its enabled property is set to false."/>
<page href="fl/controls/TextInput.html#style:embedFonts" title="TextInput.embedFonts" text="embedFonts Indicates whether embedded font outlines are used to render the text field. If this value is true, Flash Player renders the text field by using embedded font outlines. If this value is false, Flash Player renders the text field by using device fonts. If you set the embedFonts property to true for a text field, you must specify a font for that text by using the font property of a TextFormat object that is applied to the text field. If the specified font is not embedded in the SWF file, the text is not displayed."/>
<page href="fl/controls/TextInput.html#style:textPadding" title="TextInput.textPadding" text="textPadding The padding that separates the component border from the text, in pixels."/>
<page href="fl/controls/TextInput.html#style:upSkin" title="TextInput.upSkin" text="upSkin The name of the class to use as a background for the TextInput component."/>
<page href="fl/controls/CheckBox.html" title="CheckBox class" text="CheckBox The CheckBox component displays a small box that can contain a check mark. A CheckBox component can also display an optional text label that is positioned to the left, right, top, or bottom of the CheckBox. A CheckBox component changes its state in response to a mouse click, from selected to cleared, or from cleared to selected. CheckBox components include a set of true or false values that are not mutually exclusive."/>
<page href="fl/controls/CheckBox.html#CheckBox()" title="CheckBox.CheckBox()" text="CheckBox Creates a new CheckBox component instance."/>
<page href="fl/controls/CheckBox.html#drawFocus()" title="CheckBox.drawFocus()" text="drawFocus Shows or hides the focus indicator around this component. focused Show or hide the focus indicator."/>
<page href="fl/controls/CheckBox.html#getStyleDefinition()" title="CheckBox.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/controls/CheckBox.html#autoRepeat" title="CheckBox.autoRepeat" text="autoRepeat A CheckBox never auto-repeats by definition, so the autoRepeat property is set to false in the constructor and cannot be changed for a CheckBox."/>
<page href="fl/controls/CheckBox.html#toggle" title="CheckBox.toggle" text="toggle A CheckBox toggles by definition, so the toggle property is set to true in the constructor and cannot be changed for a CheckBox. This value cannot be changed for a CheckBox component."/>
<page href="fl/controls/CheckBox.html#style:disabledIcon" title="CheckBox.disabledIcon" text="disabledIcon Name of the class to use as the icon when the button is not disabled."/>
<page href="fl/controls/CheckBox.html#style:downIcon" title="CheckBox.downIcon" text="downIcon Name of the class to use as the icon when the button is not selected and the mouse button is down."/>
<page href="fl/controls/CheckBox.html#style:icon" title="CheckBox.icon" text="icon Name of the class to use as the icon when a toggle button is not selected and the mouse is not over the button."/>
<page href="fl/controls/CheckBox.html#style:overIcon" title="CheckBox.overIcon" text="overIcon Name of the class to use as the icon when the button is not selected and the mouse is over the component."/>
<page href="fl/controls/CheckBox.html#style:selectedDisabledIcon" title="CheckBox.selectedDisabledIcon" text="selectedDisabledIcon Name of the class to use as the icon when the button is selected and disabled."/>
<page href="fl/controls/CheckBox.html#style:selectedDownIcon" title="CheckBox.selectedDownIcon" text="selectedDownIcon Name of the class to use as the icon when the button is selected and the mouse button is down."/>
<page href="fl/controls/CheckBox.html#style:selectedOverIcon" title="CheckBox.selectedOverIcon" text="selectedOverIcon Name of the class to use as the icon when the button is selected and the mouse is over the component."/>
<page href="fl/controls/CheckBox.html#style:selectedUpIcon" title="CheckBox.selectedUpIcon" text="selectedUpIcon Name of the class to use as the icon when the button is selected and the mouse button is up."/>
<page href="fl/controls/CheckBox.html#style:textPadding" title="CheckBox.textPadding" text="textPadding The spacing between the text and the edges of the component, and the spacing between the text and the icon, in pixels."/>
<page href="fl/controls/CheckBox.html#style:upIcon" title="CheckBox.upIcon" text="upIcon Name of the class to use as the icon when a toggle button is not selected and the mouse is not over the button."/>
<page href="fl/controls/ScrollPolicy.html" title="ScrollPolicy class" text="ScrollPolicy Values for the horizontalScrollPolicy and verticalScrollPolicy properties of the BaseScrollPane class."/>
<page href="fl/controls/ScrollPolicy.html#AUTO" title="ScrollPolicy.AUTO" text="AUTO Show the scroll bar if the children exceed the owner's dimensions. The size of the owner is not adjusted to account for the scroll bars when they appear, so this may cause the scroll bar to obscure the contents of the component or container."/>
<page href="fl/controls/ScrollPolicy.html#OFF" title="ScrollPolicy.OFF" text="OFF Never show the scroll bar."/>
<page href="fl/controls/ScrollPolicy.html#ON" title="ScrollPolicy.ON" text="ON Always show the scroll bar. The size of the scroll bar is automatically added to the size of the owner's contents to determine the size of the owner if explicit sizes are not specified."/>
<page href="fl/controls/NumericStepper.html" title="NumericStepper class" text="NumericStepper The NumericStepper component displays an ordered set of numbers from which the user can make a selection. This component includes a single-line field for text input and a pair of arrow buttons that can be used to step through the set of values. The Up and Down arrow keys can also be used to view the set of values. The NumericStepper component dispatches a change event after there is a change in its current value. This component also contains the value property; you can use this property to obtain the current value of the component."/>
<page href="fl/controls/NumericStepper.html#NumericStepper()" title="NumericStepper.NumericStepper()" text="NumericStepper Creates a new NumericStepper component instance."/>
<page href="fl/controls/NumericStepper.html#drawFocus()" title="NumericStepper.drawFocus()" text="drawFocus Shows or hides the focus indicator on this component. The UIComponent class implements this method by creating and positioning an instance of the class that is specified by the focusSkin style. focused Indicates whether to show or hide the focus indicator. If this value is true, the focus indicator is shown; if this value is false, the focus indicator is hidden."/>
<page href="fl/controls/NumericStepper.html#getStyleDefinition()" title="NumericStepper.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/controls/NumericStepper.html#setFocus()" title="NumericStepper.setFocus()" text="setFocus Sets focus to the component instance."/>
<page href="fl/controls/NumericStepper.html#enabled" title="NumericStepper.enabled" text="enabled Gets or sets a value that indicates whether the component can accept user interaction. A value of true indicates that the component can accept user interaction; a value of false indicates that it cannot. If you set the enabled property to false, the color of the container is dimmed and user input is blocked (with the exception of the Label and ProgressBar components)."/>
<page href="fl/controls/NumericStepper.html#imeMode" title="NumericStepper.imeMode" text="imeMode Gets or sets the mode of the input method editor (IME). The IME makes it possible for users to use a QWERTY keyboard to enter characters from the Chinese, Japanese, and Korean character sets. Flash sets the IME to the specified mode when the component gets focus, and restores it to the original value after the component loses focus. The flash.system.IMEConversionMode class defines constants for the valid values for this property. Set this property to null to prevent the use of the IME with the component."/>
<page href="fl/controls/NumericStepper.html#maximum" title="NumericStepper.maximum" text="maximum Gets or sets the maximum value in the sequence of numeric values."/>
<page href="fl/controls/NumericStepper.html#minimum" title="NumericStepper.minimum" text="minimum Gets or sets the minimum number in the sequence of numeric values."/>
<page href="fl/controls/NumericStepper.html#nextValue" title="NumericStepper.nextValue" text="nextValue Gets the next value in the sequence of values."/>
<page href="fl/controls/NumericStepper.html#previousValue" title="NumericStepper.previousValue" text="previousValue Gets the previous value in the sequence of values."/>
<page href="fl/controls/NumericStepper.html#stepSize" title="NumericStepper.stepSize" text="stepSize Gets or sets a nonzero number that describes the unit of change between values. The value property is a multiple of this number less the minimum. The NumericStepper component rounds the resulting value to the nearest step size."/>
<page href="fl/controls/NumericStepper.html#textField" title="NumericStepper.textField" text="textField Gets a reference to the TextInput component that the NumericStepper component contains. Use this property to access and manipulate the underlying TextInput component. For example, you can use this property to change the current selection in the text box or to restrict the characters that the text box accepts."/>
<page href="fl/controls/NumericStepper.html#value" title="NumericStepper.value" text="value Gets or sets the current value of the NumericStepper component."/>
<page href="fl/controls/NumericStepper.html#event:change" title="NumericStepper.change" text="change Dispatched when the user changes the value of the NumericStepper component. Note: This event is not dispatched if ActionScript is used to change the value."/>
<page href="fl/controls/NumericStepper.html#style:downArrowDisabledSkin" title="NumericStepper.downArrowDisabledSkin" text="downArrowDisabledSkin The class that provides the skin for the down arrow when it is disabled."/>
<page href="fl/controls/NumericStepper.html#style:downArrowDownSkin" title="NumericStepper.downArrowDownSkin" text="downArrowDownSkin The class that provides the skin for the down arrow when it is in a down state."/>
<page href="fl/controls/NumericStepper.html#style:downArrowOverSkin" title="NumericStepper.downArrowOverSkin" text="downArrowOverSkin The class that provides the skin for the down arrow when the mouse is over the component."/>
<page href="fl/controls/NumericStepper.html#style:downArrowUpSkin" title="NumericStepper.downArrowUpSkin" text="downArrowUpSkin The class that provides the skin for the down arrow when it is in its default state."/>
<page href="fl/controls/NumericStepper.html#style:embedFonts" title="NumericStepper.embedFonts" text="embedFonts Indicates whether embedded font outlines are used to render the text field. If this value is true, Flash Player renders the text field by using embedded font outlines. If this value is false, Flash Player renders the text field by using device fonts. If you set the embedFonts property to true for a text field, you must specify a font for that text by using the font property of a TextFormat object that is applied to the text field. If the specified font is not embedded in the SWF file, the text is not displayed."/>
<page href="fl/controls/NumericStepper.html#style:repeatDelay" title="NumericStepper.repeatDelay" text="repeatDelay The number of milliseconds to wait after the buttonDown event is first dispatched before sending a second buttonDown event."/>
<page href="fl/controls/NumericStepper.html#style:repeatInterval" title="NumericStepper.repeatInterval" text="repeatInterval The interval, in milliseconds, between buttonDown events that are dispatched after the delay that is specified by the repeatDelay style."/>
<page href="fl/controls/NumericStepper.html#style:TextInput_disabledSkin" title="NumericStepper.TextInput_disabledSkin" text="TextInput_disabledSkin The skin used for the up arrow when it is in an up state."/>
<page href="fl/controls/NumericStepper.html#style:TextInput_upskin" title="NumericStepper.TextInput_upskin" text="TextInput_upskin The class that provides the skin for the text input box."/>
<page href="fl/controls/NumericStepper.html#style:upArrowDisabledSkin" title="NumericStepper.upArrowDisabledSkin" text="upArrowDisabledSkin The class that provides the skin for the up arrow when it is disabled."/>
<page href="fl/controls/NumericStepper.html#style:upArrowDownSkin" title="NumericStepper.upArrowDownSkin" text="upArrowDownSkin The class that provides the skin for the up arrow when it is in the down state."/>
<page href="fl/controls/NumericStepper.html#style:upArrowOverSkin" title="NumericStepper.upArrowOverSkin" text="upArrowOverSkin The class that provides the skin for the down arrow during mouse over."/>
<page href="fl/controls/NumericStepper.html#style:upArrowUpSkin" title="NumericStepper.upArrowUpSkin" text="upArrowUpSkin The class that provides the skin for the up arrow when it is in the up state."/>
<page href="fl/controls/BaseButton.html" title="BaseButton class" text="BaseButton The BaseButton class is the base class for all button components, defining properties and methods that are common to all buttons. This class handles drawing states and the dispatching of button events."/>
<page href="fl/controls/BaseButton.html#BaseButton()" title="BaseButton.BaseButton()" text="BaseButton Creates a new BaseButton instance."/>
<page href="fl/controls/BaseButton.html#getStyleDefinition()" title="BaseButton.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/controls/BaseButton.html#setMouseState()" title="BaseButton.setMouseState()" text="setMouseState Set the mouse state via ActionScript. The BaseButton class uses this property internally, but it can also be invoked manually, and will set the mouse state visually. state A string that specifies a mouse state. Supported values are &quot;up&quot;, &quot;over&quot;, and &quot;down&quot;."/>
<page href="fl/controls/BaseButton.html#autoRepeat" title="BaseButton.autoRepeat" text="autoRepeat Gets or sets a Boolean value that indicates whether the buttonDown event is dispatched more than one time when the user holds the mouse button down over the component. A value of true indicates that the buttonDown event is dispatched repeatedly while the mouse button remains down; a value of false indicates that the event is dispatched only one time. If this value is true, after the delay specified by the repeatDelay style, the buttonDown event is dispatched at the interval that is specified by the repeatInterval style. The following example demonstrates how to use the autoRepeat property to repeatedly dispatch buttonDown events as long as a button is pressed: import fl.controls.Button; import fl.controls.Label; import fl.events.ComponentEvent; var myLabel:Label = new Label(); myLabel.text = &quot;0&quot;; myLabel.move(10, 10); addChild(myLabel); var downButton:Button = new Button(); downButton.label = &quot;-&quot;; downButton.autoRepeat = true; downButton.setSize(20, 20); downButton.move(10, 30); downButton.addEventListener(ComponentEvent.BUTTON_DOWN, buttonDownHandler); addChild(downButton) var upButton:Button = new Button(); upButton.label = &quot;+&quot;; upButton.autoRepeat = true; upButton.setSize(20, 20); upButton.move(40, 30); upButton.addEventListener(ComponentEvent.BUTTON_DOWN, buttonDownHandler); addChild(upButton); function buttonDownHandler(event:ComponentEvent):void { var value:Number = Number(myLabel.text); switch (event.currentTarget) { case downButton: value--; break; case upButton: value++; break; } myLabel.text = value.toString(); }"/>
<page href="fl/controls/BaseButton.html#enabled" title="BaseButton.enabled" text="enabled Gets or sets a value that indicates whether the component can accept user input. A value of true indicates that the component can accept user input; a value of false indicates that it cannot. When this property is set to false, the button is disabled. This means that although it is visible, it cannot be clicked. This property is useful for disabling a specific part of the user interface. For example, a button that is used to trigger the reloading of a web page could be disabled by using this technique."/>
<page href="fl/controls/BaseButton.html#selected" title="BaseButton.selected" text="selected Gets or sets a Boolean value that indicates whether a toggle button is selected. A value of true indicates that the button is selected; a value of false indicates that it is not. This property has no effect if the toggle property is not set to true. For a CheckBox component, this value indicates whether the box is checked. For a RadioButton component, this value indicates whether the component is selected. This value changes when the user clicks the component but can also be changed programmatically. If the toggle property is set to true, changing this property causes a change event object to be dispatched. The following example demonstrates how you can create a toggle button using the toggle property and listening for the change event to determine when a button is selected: import fl.controls.Button; var myButton:Button = new Button(); myButton.toggle = true; myButton.move(10, 10); myButton.addEventListener(Event.CHANGE, changeHandler); addChild(myButton); function changeHandler(event:Event):void { trace(&quot;Button toggled (selected:&quot; + event.currentTarget.selected + &quot;)&quot;); }"/>
<page href="fl/controls/BaseButton.html#event:buttonDown" title="BaseButton.buttonDown" text="buttonDown Dispatched when the user presses the Button component. If the autoRepeat property is true, this event is dispatched at specified intervals until the button is released. The repeatDelay style is used to specify the delay before the buttonDown event is dispatched a second time. The repeatInterval style specifies the interval at which this event is dispatched thereafter, until the user releases the button. The following example demonstrates how to use the autoRepeat property to repeatedly dispatch buttonDown events as long as a button is pressed: import fl.controls.Button; import fl.controls.Label; import fl.events.ComponentEvent; var myLabel:Label = new Label(); myLabel.text = &quot;0&quot;; myLabel.move(10, 10); addChild(myLabel); var downButton:Button = new Button(); downButton.label = &quot;-&quot;; downButton.autoRepeat = true; downButton.setSize(20, 20); downButton.move(10, 30); downButton.addEventListener(ComponentEvent.BUTTON_DOWN, buttonDownHandler); addChild(downButton) var upButton:Button = new Button(); upButton.label = &quot;+&quot;; upButton.autoRepeat = true; upButton.setSize(20, 20); upButton.move(40, 30); upButton.addEventListener(ComponentEvent.BUTTON_DOWN, buttonDownHandler); addChild(upButton); function buttonDownHandler(event:ComponentEvent):void { var value:Number = Number(myLabel.text); switch (event.currentTarget) { case downButton: value--; break; case upButton: value++; break; } myLabel.text = value.toString(); }"/>
<page href="fl/controls/BaseButton.html#event:change" title="BaseButton.change" text="change Dispatched when the value of the selected property of a toggle Button component changes. A toggle Button component is a Button component whose toggle property is set to true. The CheckBox and RadioButton components dispatch this event after there is a change in the selected property. The following example demonstrates how you can create a toggle button using the toggle property and listening for the change event to determine when a button is selected: import fl.controls.Button; var myButton:Button = new Button(); myButton.toggle = true; myButton.move(10, 10); myButton.addEventListener(Event.CHANGE, changeHandler); addChild(myButton); function changeHandler(event:Event):void { trace(&quot;Button toggled (selected:&quot; + event.currentTarget.selected + &quot;)&quot;); }"/>
<page href="fl/controls/BaseButton.html#style:disabledSkin" title="BaseButton.disabledSkin" text="disabledSkin Name of the class to use as the skin for the background and border when the button is not selected and is disabled."/>
<page href="fl/controls/BaseButton.html#style:downSkin" title="BaseButton.downSkin" text="downSkin Name of the class to use as the skin for the background and border when the button is not selected and the mouse button is down."/>
<page href="fl/controls/BaseButton.html#style:overSkin" title="BaseButton.overSkin" text="overSkin Name of the class to use as the skin for the background and border when the button is not selected and the mouse is over the component."/>
<page href="fl/controls/BaseButton.html#style:repeatDelay" title="BaseButton.repeatDelay" text="repeatDelay The number of milliseconds to wait after the buttonDown event is first dispatched before sending a second buttonDown event."/>
<page href="fl/controls/BaseButton.html#style:repeatInterval" title="BaseButton.repeatInterval" text="repeatInterval The interval, in milliseconds, between buttonDown events that are dispatched after the delay that is specified by the repeatDelay style."/>
<page href="fl/controls/BaseButton.html#style:selectedDisabledSkin" title="BaseButton.selectedDisabledSkin" text="selectedDisabledSkin Name of the class to use as the skin for the background and border when a toggle button is selected and disabled."/>
<page href="fl/controls/BaseButton.html#style:selectedDownSkin" title="BaseButton.selectedDownSkin" text="selectedDownSkin Name of the class to use as the skin for the background and border when a toggle button is selected and the mouse button is down."/>
<page href="fl/controls/BaseButton.html#style:selectedOverSkin" title="BaseButton.selectedOverSkin" text="selectedOverSkin Name of the class to use as the skin for the background and border when a toggle button is selected and the mouse is over the component."/>
<page href="fl/controls/BaseButton.html#style:selectedUpSkin" title="BaseButton.selectedUpSkin" text="selectedUpSkin Name of the class to use as the skin for the background and border when a toggle button is selected and the mouse is not over the component."/>
<page href="fl/controls/BaseButton.html#style:upSkin" title="BaseButton.upSkin" text="upSkin Name of the class to use as the skin for the background and border when the button is not selected and the mouse is not over the component."/>
<page href="fl/controls/ComboBox.html" title="ComboBox class" text="ComboBox The ComboBox component contains a drop-down list from which the user can select one value. Its functionality is similar to that of the SELECT form element in HTML. The ComboBox component can be editable, in which case the user can type entries that are not in the list into the TextInput portion of the ComboBox component."/>
<page href="fl/controls/ComboBox.html#ComboBox()" title="ComboBox.ComboBox()" text="ComboBox Creates a new ComboBox component instance."/>
<page href="fl/controls/ComboBox.html#addItem()" title="ComboBox.addItem()" text="addItem Appends an item to the end of the list of items. An item should contain label and data properties; however, items that contain other properties can also be added to the list. By default, the label property of an item is used to display the label of the row; the data property is used to store the data of the row. item The item to be added to the data provider."/>
<page href="fl/controls/ComboBox.html#addItemAt()" title="ComboBox.addItemAt()" text="addItemAt Inserts an item into the list at the specified index location. The indices of items at or after the specified index location are incremented by 1. item index The item to be added to the list. The index at which to add the item."/>
<page href="fl/controls/ComboBox.html#close()" title="ComboBox.close()" text="close Closes the drop-down list. Note: Calling this method causes the close event to be dispatched. If the ComboBox is already closed, calling this method has no effect. The following example creates a ComboBox component instance and toggles the drop-down menu's visibility using the open() and close() methods: import fl.controls.ComboBox; var myComboBox:ComboBox = new ComboBox(); myComboBox.addItem({label:&quot;Item 1&quot;}); myComboBox.addItem({label:&quot;Item 2&quot;}); myComboBox.addItem({label:&quot;Item 3&quot;}); myComboBox.move(10, 10); myComboBox.addEventListener(Event.OPEN, openHandler); myComboBox.addEventListener(Event.CLOSE, closeHandler); addChild(myComboBox); var isOpen:Boolean = false; var timer:Timer = new Timer(1000); timer.addEventListener(TimerEvent.TIMER, timerHandler); timer.start(); function openHandler(event:Event):void { isOpen = true; } function closeHandler(event:Event):void { isOpen = false; } function timerHandler(event:TimerEvent):void { if (isOpen) { myComboBox.close(); } else { myComboBox.open(); } }"/>
<page href="fl/controls/ComboBox.html#getItemAt()" title="ComboBox.getItemAt()" text="getItemAt Retrieves the item at the specified index. index The index of the item to be retrieved. The following example creates a ComboBox component instance and uses a for loop and the getItemAt() method to copy items from the ComboBox into a DataGrid component: import fl.controls.ComboBox; import fl.controls.DataGrid; import fl.controls.dataGridClasses.DataGridColumn; var myComboBox:ComboBox = new ComboBox(); myComboBox.addItem({label:&quot;Item 1&quot;, price:0.34}); myComboBox.addItem({label:&quot;Item 2&quot;, price:13.19}); myComboBox.addItem({label:&quot;item 3&quot;, price:2.96}); myComboBox.addItem({label:&quot;Item 4&quot;, price:3.49}); myComboBox.addItem({label:&quot;Item 5&quot;, price:1.27}); myComboBox.move(10, 10); addChild(myComboBox); var indexCol:DataGridColumn = new DataGridColumn(&quot;index&quot;); indexCol.headerText = &quot;&quot;; indexCol.sortOptions = Array.NUMERIC; var labelCol:DataGridColumn = new DataGridColumn(&quot;label&quot;); labelCol.sortOptions = Array.CASEINSENSITIVE; var priceCol:DataGridColumn = new DataGridColumn(&quot;price&quot;); priceCol.sortOptions = Array.NUMERIC; var myDataGrid:DataGrid = new DataGrid(); myDataGrid.addColumn(indexCol); myDataGrid.addColumn(labelCol); myDataGrid.addColumn(priceCol); myDataGrid.move(10, 40); myDataGrid.rowCount = myComboBox.length; myDataGrid.width = 180; addChild(myDataGrid); var i:uint; var item:Object; for (i = 0; i &lt; myComboBox.length; i++) { item = myComboBox.getItemAt(i); myDataGrid.addItem({index:i, label:item.label, price:item.price}); }"/>
<page href="fl/controls/ComboBox.html#getStyleDefinition()" title="ComboBox.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/controls/ComboBox.html#itemToLabel()" title="ComboBox.itemToLabel()" text="itemToLabel Retrieves the string that the renderer displays for the given data object based on the labelField and labelFunction properties. Note: The labelField is not used if the labelFunction property is set to a callback function. item The object to be rendered."/>
<page href="fl/controls/ComboBox.html#open()" title="ComboBox.open()" text="open Opens the drop-down list. Note: Calling this method causes the open event to be dispatched. If the ComboBox component is already open, calling this method has no effect."/>
<page href="fl/controls/ComboBox.html#removeAll()" title="ComboBox.removeAll()" text="removeAll Removes all items from the list. The following example uses a Button component instance to remove the items from a ComboBox using the removeAll() method: import fl.controls.Button; import fl.controls.ComboBox; import fl.controls.TextInput; var greenTF:TextFormat; var redTF:TextFormat; var myTextInput:TextInput; var addButton:Button; var myComboBox:ComboBox; var removeButton:Button; greenTF = new TextFormat(); greenTF.color = 0x006600; redTF = new TextFormat(); redTF.color = 0xFF0000; myTextInput = new TextInput(); myTextInput.maxChars = 20; myTextInput.restrict = &quot;a-zA-Z&quot;; myTextInput.move(10, 10); addChild(myTextInput); addButton = new Button(); addButton.label = &quot;(+) Add&quot;; addButton.setStyle(&quot;textFormat&quot;, greenTF); addButton.move(120, 10); addButton.addEventListener(MouseEvent.CLICK, addClickHandler); addChild(addButton); myComboBox = new ComboBox(); myComboBox.move(10, 40); addChild(myComboBox); removeButton = new Button(); removeButton.label = &quot;(-) Remove All&quot;; removeButton.setStyle(&quot;textFormat&quot;, redTF); removeButton.move(120, 40); removeButton.addEventListener(MouseEvent.CLICK, removeClickHandler); addChild(removeButton); function addClickHandler(event:MouseEvent):void { if (myTextInput.length &gt; 0) { trace(&quot;adding item...&quot;); myComboBox.addItem({label:myTextInput.text}); myComboBox.sortItemsOn(&quot;label&quot;, Array.CASEINSENSITIVE); myTextInput.text = &quot;&quot;; } } function removeClickHandler(event:MouseEvent):void { trace(&quot;removing all items...&quot;); myComboBox.removeAll(); }"/>
<page href="fl/controls/ComboBox.html#removeItem()" title="ComboBox.removeItem()" text="removeItem Removes the specified item from the list. item The item to be removed. The following example demonstrates how to remove an item from a list once it is clicked: import fl.controls.List; import fl.events.ListEvent; var myList:List = new List(); myList.addItem( { label: &quot;Carrot&quot; } ); myList.addItem( { label: &quot;Turnip&quot; } ); myList.addItem( { label: &quot;Tomato&quot; } ); myList.addItem( { label: &quot;Blueberry&quot; } ); myList.addEventListener(ListEvent.ITEM_CLICK,removeSelectedItem); addChild(myList); function removeSelectedItem(e:ListEvent):void { myList.removeItem(e.item); }"/>
<page href="fl/controls/ComboBox.html#removeItemAt()" title="ComboBox.removeItemAt()" text="removeItemAt Removes the item at the specified index position. The index locations of items whose indices are greater than the specified index advance in the array by 1. This is a method of the List component that is available from an instance of the ComboBox component. index Index of the item to be removed. The specified index is less than 0 or greater than or equal to the length of the data provider."/>
<page href="fl/controls/ComboBox.html#replaceItemAt()" title="ComboBox.replaceItemAt()" text="replaceItemAt Replaces the item at the specified index location with another item. This method modifies the data provider of the List component. If the data provider is shared with other components, the data that is provided to those components is also updated. item index The item to replace the item at the specified index location. The index position of the item to be replaced. The following example replaces the currently selected item in a ComboBox with the value from a TextInput component using the replaceItemAt() method: import fl.controls.Button; import fl.controls.ComboBox; import fl.controls.TextArea; import fl.controls.TextInput; var myComboBox:ComboBox = new ComboBox(); myComboBox.prompt = &quot;Select a user...&quot;; myComboBox.addItem({label:&quot;Person 1&quot;}); myComboBox.addItem({label:&quot;Person 2&quot;}); myComboBox.addItem({label:&quot;Person 3&quot;}); myComboBox.addItem({label:&quot;Person 4&quot;}); myComboBox.width = 150; myComboBox.move(10, 10); myComboBox.addEventListener(Event.CHANGE, changeHandler); addChild(myComboBox); var myTextInput:TextInput = new TextInput(); myTextInput.restrict = &quot;a-zA-Z0-9&quot;; myTextInput.maxChars = 12; myTextInput.move(10, 40); addChild(myTextInput) var myButton:Button = new Button(); myButton.label = &quot;Replace item&quot;; myButton.addEventListener(MouseEvent.CLICK, clickHandler); myButton.move(120, 40); addChild(myButton); var myTextArea:TextArea = new TextArea(); myTextArea.editable = false; myTextArea.setSize(320, 240); myTextArea.move(10, 70); addChild(myTextArea); function changeHandler(event:Event):void { myTextInput.text = myComboBox.selectedLabel; } function clickHandler(event:MouseEvent):void { var cIndex:int = myComboBox.selectedIndex; if (cIndex &gt; -1) { var newItem:Object = {label:myTextInput.text}; var oldItem:Object = myComboBox.replaceItemAt(newItem, cIndex); myComboBox.selectedIndex = cIndex; myTextArea.appendText(&quot;[index:&quot; + cIndex + &quot;] old:'&quot; + oldItem.label +&quot;', new:'&quot; + newItem.label + &quot;'\n&quot;); myTextArea.verticalScrollPosition = myTextArea.maxVerticalScrollPosition; } }"/>
<page href="fl/controls/ComboBox.html#sortItems()" title="ComboBox.sortItems()" text="sortItems Sorts the elements of the current data provider. This method performs a sort based on the Unicode values of the elements. ASCII is a subset of Unicode. sortArgs The arguments against which to sort. The following example sorts the items in a ComboBox instance according to each item's label text. The items to be sorted are passed to a custom sorting function, upperCaseSort(), which compares two item's label properties and returns a Boolean value depending on the order that the item should appear: import fl.controls.ComboBox; var cb:ComboBox = new ComboBox(); cb.addItem( { label: &quot;Mercury&quot; } ); cb.addItem( { label: &quot;Venus&quot; } ); cb.addItem( { label: &quot;Earth&quot; } ); cb.addItem( { label: &quot;planet&quot; } ); cb.sortItems(upperCaseSort); addChild(cb); function upperCaseSort(a:Object, b:Object):Boolean { return a.label.toUpperCase() &gt; b.label.toUpperCase(); }"/>
<page href="fl/controls/ComboBox.html#sortItemsOn()" title="ComboBox.sortItemsOn()" text="sortItemsOn Sorts the elements of the current data provider by one or more of its fields. field options The field on which to sort. Sort arguments that are used to override the default sort behavior. Separate two or more arguments with the bitwise OR (|) operator. The following examples are based on a ComboBox instance named cb that contains four elements labeled &quot;Apples&quot;, &quot;Bananas&quot;, &quot;cherries&quot;, and &quot;Grapes&quot;: import fl.controls.ComboBox; var cb:ComboBox = new ComboBox(); addChild(cb); // First, populate the ComboBox with the elements. cb.addItem( { label: &quot;Bananas&quot; } ); cb.addItem( { label: &quot;Apples&quot; } ); cb.addItem( { label: &quot;cherries&quot; } ); cb.addItem( { label: &quot;Grapes&quot; } ); // The following statement sorts using the order parameter set to &quot;ASC&quot;, // and results in a sort that places &quot;cherries&quot; at the bottom of the list // because the sort is case-sensitive. cb.sortItemsOn(&quot;label&quot;, &quot;ASC&quot;); // resulting order: Apples, Bananas, Grapes, cherries // The following statement sorts using the order parameter set to &quot;DESC&quot;, // and results in a sort that places &quot;cherries&quot; at the top of the list // because the sort is case-sensitive. cb.sortItemsOn(&quot;label&quot;, &quot;DESC&quot;); // resulting order: cherries, Grapes, Bananas, Apples // The following statement sorts using the optionsFlag parameter set to // Array.CASEINSENSITIVE. Note that an ascending sort is the default setting. cb.sortItemsOn(&quot;label&quot;, Array.CASEINSENSITIVE); // resulting order: Apples, Bananas, cherries, Grapes // The following statement sorts using the optionsFlag parameter set to // Array.CASEINSENSITIVE | Array.DESCENDING. cb.sortItemsOn(&quot;label&quot;, Array.CASEINSENSITIVE | Array.DESCENDING); // resulting order: Grapes, cherries, Bananas, Apples"/>
<page href="fl/controls/ComboBox.html#dataProvider" title="ComboBox.dataProvider" text="dataProvider Gets or sets the data model of the list of items to be viewed. A data provider can be shared by multiple list-based components. Changes to the data provider are immediately available to all components that use it as a data source. The following example demonstrates how to set a data provider for a ComboBox. As the data provider is updated, the ComboBox is updated: import fl.controls.ComboBox; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); var cb:ComboBox = new ComboBox(); cb.dataProvider = dp; addChild(cb); var counter = 0; var t:Timer = new Timer(500); t.addEventListener(TimerEvent.TIMER,addAnotherItem); t.start(); function addAnotherItem(e:TimerEvent = null):void { dp.addItem( { label: &quot;Item &quot; + counter++ } ); }"/>
<page href="fl/controls/ComboBox.html#dropdown" title="ComboBox.dropdown" text="dropdown Gets a reference to the List component that the ComboBox component contains. The List subcomponent is not instantiated within the ComboBox until it must be displayed. However, the list is created when the dropdown property is accessed."/>
<page href="fl/controls/ComboBox.html#dropdownWidth" title="ComboBox.dropdownWidth" text="dropdownWidth Gets or sets the maximum width of the drop-down list, in pixels. The default value of this property is the width of the ComboBox component (the width of the TextInput instance plus the width of the BaseButton instance). The following example creates a ComboBox component instance and sets its dropdownWidth property based on the value of a Slider component: import fl.controls.ComboBox; import fl.controls.Slider; import fl.events.SliderEvent; var mySlider:Slider = new Slider(); mySlider.minimum = 50; mySlider.maximum = 150; mySlider.liveDragging = true; mySlider.snapInterval = 5; mySlider.tickInterval = 10; mySlider.addEventListener(SliderEvent.CHANGE, changeHandler); mySlider.move(10, 10); addChild(mySlider); var myComboBox:ComboBox = new ComboBox(); myComboBox.addItem({label:&quot;Item A&quot;}); myComboBox.addItem({label:&quot;Item B&quot;}); myComboBox.move(10, 30); addChild(myComboBox); mySlider.value = myComboBox.dropdownWidth; function changeHandler(event:SliderEvent):void { myComboBox.dropdownWidth = event.value; }"/>
<page href="fl/controls/ComboBox.html#editable" title="ComboBox.editable" text="editable Gets or sets a Boolean value that indicates whether the ComboBox component is editable or read-only. A value of true indicates that the ComboBox component is editable; a value of false indicates that it is not. In an editable ComboBox component, a user can enter values into the text box that do not appear in the drop-down list. The text box displays the text of the item in the list. If a ComboBox component is not editable, text cannot be entered into the text box. The following example creates a new editable ComboBox instance that adds custom items to the data provider when the enter event is dispatched: import fl.controls.ComboBox; import fl.data.DataProvider; import fl.events.ComponentEvent; var dp:DataProvider = new DataProvider(); var myComboBox:ComboBox = new ComboBox; myComboBox.dataProvider = dp; myComboBox.editable = true; myComboBox.addEventListener(ComponentEvent.ENTER, enterHandler); myComboBox.move(10, 10); addChild(myComboBox); function enterHandler(event:ComponentEvent):void { var myCB:ComboBox = event.currentTarget as ComboBox; dp.addItem({label:myCB.text}); myCB.text = &quot;&quot;; myCB.sortItemsOn(&quot;label&quot;, Array.CASEINSENSITIVE); }"/>
<page href="fl/controls/ComboBox.html#labelField" title="ComboBox.labelField" text="labelField Gets or sets the name of the field in the dataProvider object to be displayed as the label for the TextInput field and drop-down list. By default, the component displays the label property of each dataProvider item. If the dataProvider items do not contain a label property, you can set the labelField property to use a different property. Note: The labelField property is not used if the labelFunction property is set to a callback function. The following example creates a ComboBox and sets the labelField property to set a custom label field: import fl.controls.ComboBox; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem({firstName:&quot;Jane&quot;, lastName:&quot;Doe&quot;}); dp.addItem({firstName:&quot;Bill&quot;, lastName:&quot;Smith&quot;}); dp.addItem({firstName:&quot;Tim&quot;, lastName:&quot;Jones&quot;}); dp.sortOn([&quot;firstName&quot;,&quot;lastName&quot;]); var myComboBox:ComboBox = new ComboBox(); myComboBox.dataProvider = dp; myComboBox.labelField = &quot;firstName&quot;; myComboBox.move(10, 10); addChild(myComboBox);"/>
<page href="fl/controls/ComboBox.html#labelFunction" title="ComboBox.labelFunction" text="labelFunction Gets or sets the function to be used to obtain the label for the item. By default, the component displays the label property for a dataProvider item. But some data sets may not have a label field or may not have a field whose value can be used as a label without modification. For example, a given data set might store full names but maintain them in lastName and firstName fields. In such a case, this property could be used to set a callback function that concatenates the values of the lastName and firstName fields into a full name string to be displayed. Note: The labelField property is not used if the labelFunction property is set to a callback function. This example sets the labelFunction property of a list to a function that formats the string to be displayed in each cell: import fl.data.DataProvider; import fl.controls.List; var myDataProvider:DataProvider = new DataProvider(); myDataProvider.addItem({name:&quot;User A&quot;, price:0.43}); myDataProvider.addItem({name:&quot;User B&quot;, price:0.34}); var users:List = new List(); users.dataProvider = myDataProvider; users.labelFunction = myLabelFunction; addChild(users); function myLabelFunction(item:Object):String { return item.name + &quot; ($&quot; + item.price.toFixed(2) + &quot;)&quot;; }"/>
<page href="fl/controls/ComboBox.html#length" title="ComboBox.length" text="length Gets the number of items in the list. This property belongs to the List component but can be accessed from a ComboBox instance. The following example creates a ComboBox and sets its rowCount property based on how many items are in the ComboBox: import fl.controls.ComboBox; var myComboBox:ComboBox = new ComboBox(); myComboBox.addItem({label:&quot;Item A&quot;}); myComboBox.addItem({label:&quot;Item B&quot;}); myComboBox.addItem({label:&quot;Item C&quot;}); myComboBox.addItem({label:&quot;Item D&quot;}); myComboBox.addItem({label:&quot;Item E&quot;}); myComboBox.addItem({label:&quot;Item F&quot;}); myComboBox.rowCount = myComboBox.length / 2; addChild(myComboBox);"/>
<page href="fl/controls/ComboBox.html#prompt" title="ComboBox.prompt" text="prompt Gets or sets the prompt for the ComboBox component. This prompt is a string that is displayed in the TextInput portion of the ComboBox when the selectedIndex is -1. It is usually a string like &quot;Select one...&quot;. If a prompt is not set, the ComboBox component sets the selectedIndex property to 0 and displays the first item in the dataProvider property. The following example creates a ComboBox component instance, sets its prompt property and resizes the combo box to fit the width of the prompt text: import fl.controls.ComboBox; var cbStyles:Object = ComboBox.getStyleDefinition(); var bW:Number = cbStyles.buttonWidth as Number var myComboBox:ComboBox = new ComboBox(); myComboBox.prompt = &quot;Please select an option...&quot;; myComboBox.addItem({label:&quot;Option 1&quot;}); myComboBox.addItem({label:&quot;Option 2&quot;}); myComboBox.drawNow(); myComboBox.width = myComboBox.textField.textWidth + 35; myComboBox.dropdownWidth = myComboBox.width - bW; myComboBox.move(10, 10); addChild(myComboBox);"/>
<page href="fl/controls/ComboBox.html#restrict" title="ComboBox.restrict" text="restrict Gets or sets the characters that a user can enter in the text field. If the value of the restrict property is a string of characters, you can enter only characters in the string into the text field. The string is read from left to right. If the value of the restrict property is null, you can enter any character. If the value of the restrict property is an empty string (&quot;&quot;), you cannot enter any character. You can specify a range by using the hyphen (-) character. This restricts only user interaction; a script can put any character into the text field. The following example creates an editable ComboBox component that allows only hexadecimal colors to be entered using the restrict property: import fl.controls.ComboBox; import fl.data.DataProvider; import fl.events.ComponentEvent; var dp:DataProvider = new DataProvider(); var myComboBox:ComboBox = new ComboBox(); myComboBox.dataProvider = dp; myComboBox.editable = true; myComboBox.restrict = &quot;0-9A-F&quot;; myComboBox.textField.maxChars = 6; myComboBox.addEventListener(ComponentEvent.ENTER, enterHandler); myComboBox.move(10, 10); addChild(myComboBox); function enterHandler(event:ComponentEvent):void { var colorStr:String = ComboBox(event.currentTarget).text; var colorNum:uint = uint(&quot;0x&quot; + colorStr); dp.addItem({label:colorStr, value:colorNum}); dp.sortOn(&quot;value&quot;, Array.NUMERIC); event.currentTarget.text = &quot;&quot;; }"/>
<page href="fl/controls/ComboBox.html#rowCount" title="ComboBox.rowCount" text="rowCount Gets or sets the maximum number of rows that can appear in a drop-down list that does not have a scroll bar. If the number of items in the drop-down list exceeds this value, the list is resized and a scroll bar is displayed, if necessary. If the number of items in the drop-down list is less than this value, the drop-down list is resized to accommodate the number of items that it contains. This behavior differs from that of the List component, which always shows the number of rows specified by its rowCount property, even if this includes empty space. The following example uses a Slider component to set the rowCount property for a ComboBox component: import fl.controls.ComboBox; import fl.controls.Slider; import fl.events.SliderEvent; var numItems:uint = 8; var mySlider:Slider = new Slider(); mySlider.tickInterval = 1; mySlider.snapInterval = 1; mySlider.minimum = 1; mySlider.maximum = numItems; mySlider.liveDragging = true; mySlider.move(10, 10); mySlider.addEventListener(SliderEvent.CHANGE, changeHandler); addChild(mySlider); var myComboBox:ComboBox = new ComboBox(); myComboBox.move(10, 30); addChild(myComboBox); var i:uint; for (i = 0; i &lt; numItems; i++) { myComboBox.addItem({label:&quot;Item &quot; + i}); } function changeHandler(event:SliderEvent):void { myComboBox.rowCount = event.value; }"/>
<page href="fl/controls/ComboBox.html#selectedIndex" title="ComboBox.selectedIndex" text="selectedIndex Gets or sets the index of the item that is selected in a single-selection list. A single-selection list is a list in which only one item can be selected at a time. A value of -1 indicates that no item is selected; if multiple selections are made, this value is equal to the index of the item that was selected last in the group of selected items. When ActionScript is used to set this property, the item at the specified index replaces the current selection. When the selection is changed programmatically, a change event object is not dispatched. The following example uses a Slider component to set the ComboBox component instance's selectedIndex property: import fl.controls.ComboBox; import fl.controls.Slider; import fl.data.DataProvider; import fl.events.SliderEvent; var items:XML = &lt;items&gt; &lt;item label=&quot;Item 1&quot; /&gt; &lt;item label=&quot;Item 2&quot; /&gt; &lt;item label=&quot;Item 3&quot; /&gt; &lt;item label=&quot;Item 4&quot; /&gt; &lt;/items&gt;; var dp:DataProvider = new DataProvider(items); var mySlider:Slider = new Slider(); mySlider.liveDragging = true; mySlider.tickInterval = 1; mySlider.snapInterval = 1; mySlider.minimum = 0; mySlider.maximum = dp.length - 1; mySlider.width = 100; mySlider.move(10, 10); mySlider.addEventListener(SliderEvent.CHANGE, changeHandler); addChild(mySlider); var myComboBox:ComboBox = new ComboBox(); myComboBox.dataProvider = dp; myComboBox.move(10, 30); addChild(myComboBox); function changeHandler(event:SliderEvent):void { myComboBox.selectedIndex = event.value; }"/>
<page href="fl/controls/ComboBox.html#selectedItem" title="ComboBox.selectedItem" text="selectedItem Gets or sets the value of the item that is selected in the drop-down list. If the user enters text into the text box of an editable ComboBox component, the selectedItem property is undefined. This property has a value only if the user selects an item or if ActionScript is used to select an item from the drop-down list. If the ComboBox component is not editable, the value of the selectedItem property is always valid. If there are no items in the drop-down list of an editable ComboBox component, the value of this property is null. The following example uses a Button component to copy items from a ComboBox to a List: import fl.controls.Button; import fl.controls.ComboBox; import fl.controls.List; var myComboBox:ComboBox = new ComboBox(); myComboBox.prompt = &quot;Select an item&quot;; myComboBox.addItem({label:&quot;Item A&quot;}); myComboBox.addItem({label:&quot;Item B&quot;}); myComboBox.addItem({label:&quot;Item C&quot;}); myComboBox.move(10, 10); addChild(myComboBox); var myButton:Button = new Button(); myButton.label = &quot;Copy&quot;; myButton.move(myComboBox.x + myComboBox.width + 10, myComboBox.y); myButton.addEventListener(MouseEvent.CLICK, clickHandler); addChild(myButton); var myList:List = new List(); myList.rowCount = myList.length; myList.selectable = false; myList.move(myComboBox.x, myComboBox.y + myComboBox.height + 10); addChild(myList); function clickHandler(event:MouseEvent):void { if (myComboBox.selectedIndex &gt; -1) { myList.addItem(myComboBox.selectedItem); myList.rowCount = myList.length; } }"/>
<page href="fl/controls/ComboBox.html#selectedLabel" title="ComboBox.selectedLabel" text="selectedLabel Gets the string that is displayed in the TextInput portion of the ComboBox component. This value is calculated from the data by using the labelField or labelFunction property. The following example uses a Label component to display the selectedLabel property for a ComboBox: import fl.controls.ComboBox; import fl.controls.Label; var myComboBox:ComboBox = new ComboBox(); myComboBox.prompt = &quot;Select a user:&quot;; myComboBox.addItem({firstName:&quot;Jane&quot;, lastName:&quot;Doe&quot;}); myComboBox.addItem({firstName:&quot;Bill&quot;, lastName:&quot;Smith&quot;}); myComboBox.addItem({firstName:&quot;Tim&quot;, lastName:&quot;Jones&quot;}); myComboBox.labelFunction = nameLabelFunction; myComboBox.width = 120; myComboBox.move(10, 10); myComboBox.addEventListener(Event.CHANGE, changeHandler); addChild(myComboBox); var myLabel:Label = new Label(); myLabel.text = &quot;&quot;; myLabel.autoSize = TextFieldAutoSize.LEFT; myLabel.move(myComboBox.x, myComboBox.y + myComboBox.height); addChild(myLabel); function changeHandler(event:Event):void { var cb:ComboBox = event.currentTarget as ComboBox; myLabel.text = &quot;selectedLabel: &quot; + cb.selectedLabel; } function nameLabelFunction(item:Object):String { return item.lastName + &quot;, &quot; + item.firstName; }"/>
<page href="fl/controls/ComboBox.html#text" title="ComboBox.text" text="text Gets or sets the text that the text box contains in an editable ComboBox component. For ComboBox components that are not editable, this value is read-only. The following example creates an editable ComboBox that displays the text being entered into a TextArea component instance: import fl.controls.ComboBox; import fl.controls.TextArea; import fl.events.ComponentEvent; var myComboBox:ComboBox = new ComboBox(); myComboBox.editable = true; myComboBox.addEventListener(TextEvent.TEXT_INPUT, textInputHandler); myComboBox.addEventListener(ComponentEvent.ENTER, enterHandler); myComboBox.width = 300; myComboBox.move(10, 10); addChild(myComboBox); var myTextArea:TextArea = new TextArea(); myTextArea.wordWrap = false; myTextArea.setSize(300, 200); myTextArea.move(myComboBox.x, myComboBox.y + myComboBox.height + 10); addChild(myTextArea) function textInputHandler(event:TextEvent):void { myTextArea.appendText(event.type + &quot;:\n&quot;); myTextArea.appendText(&quot;\t&quot; + event.currentTarget.text + &quot;\n&quot;); myTextArea.appendText(&quot;\t&quot; + event.text + &quot;\n&quot;); myTextArea.appendText(&quot;\n&quot;); autoScroll(myTextArea); } function enterHandler(event:ComponentEvent):void { myTextArea.appendText(event.type + &quot;:\n&quot;); myTextArea.appendText(&quot;\t&quot; + event.currentTarget.text + &quot;\n&quot;); myTextArea.appendText(&quot;\n&quot;); autoScroll(myTextArea); } function autoScroll(ta:TextArea):void { ta.verticalScrollPosition = ta.maxVerticalScrollPosition; }"/>
<page href="fl/controls/ComboBox.html#textField" title="ComboBox.textField" text="textField Gets a reference to the TextInput component that the ComboBox component contains. Use this property to access and manipulate the underlying TextInput component. For example, you can use this property to change the selection of the text box or to restrict the set of characters that can be entered into it. The following example creates an editable ComboBox component that allows only 8 characters to be entered: import fl.controls.ComboBox; var myComboBox:ComboBox = new ComboBox(); myComboBox.editable = true; myComboBox.textField.maxChars = 8; myComboBox.move(10, 10); addChild(myComboBox);"/>
<page href="fl/controls/ComboBox.html#value" title="ComboBox.value" text="value Gets the label of an item in an editable ComboBox component. For a ComboBox component that is not editable, this property gets the data that the item contains. The following example uses a Label component to display the value property for an editable ComboBox: import fl.controls.ComboBox; import fl.controls.Label; var myComboBox:ComboBox = new ComboBox(); myComboBox.prompt = &quot;Select a user:&quot;; myComboBox.addItem({firstName:&quot;Jane&quot;, lastName:&quot;Doe&quot;}); myComboBox.addItem({firstName:&quot;Bill&quot;, lastName:&quot;Smith&quot;}); myComboBox.addItem({firstName:&quot;Tim&quot;, lastName:&quot;Jones&quot;}); myComboBox.labelFunction = nameLabelFunction; myComboBox.width = 120; myComboBox.move(10, 10); myComboBox.addEventListener(Event.CHANGE, changeHandler); myComboBox.editable = true; addChild(myComboBox); var myLabel:Label = new Label(); myLabel.text = &quot;&quot;; myLabel.autoSize = TextFieldAutoSize.LEFT; myLabel.move(myComboBox.x, myComboBox.y + myComboBox.height); addChild(myLabel); function changeHandler(event:Event):void { var cb:ComboBox = event.currentTarget as ComboBox; myLabel.text = &quot;value: &quot; + cb.value; } function nameLabelFunction(item:Object):String { var str:String; if (item == null) { str = myComboBox.value; } else { str = item.lastName + &quot;, &quot; + item.firstName; } return str; }"/>
<page href="fl/controls/ComboBox.html#event:change" title="ComboBox.change" text="change Dispatched when the user changes the selection in the ComboBox component or, if the ComboBox component is editable, each time the user enters a keystroke in the text field."/>
<page href="fl/controls/ComboBox.html#event:close" title="ComboBox.close" text="close Dispatched when the drop-down list is dismissed for any reason. The following example creates a ComboBox component instance and toggles the drop-down menu's visibility using the open() and close() methods: import fl.controls.ComboBox; var myComboBox:ComboBox = new ComboBox(); myComboBox.addItem({label:&quot;Item 1&quot;}); myComboBox.addItem({label:&quot;Item 2&quot;}); myComboBox.addItem({label:&quot;Item 3&quot;}); myComboBox.move(10, 10); myComboBox.addEventListener(Event.OPEN, openHandler); myComboBox.addEventListener(Event.CLOSE, closeHandler); addChild(myComboBox); var isOpen:Boolean = false; var timer:Timer = new Timer(1000); timer.addEventListener(TimerEvent.TIMER, timerHandler); timer.start(); function openHandler(event:Event):void { isOpen = true; } function closeHandler(event:Event):void { isOpen = false; } function timerHandler(event:TimerEvent):void { if (isOpen) { myComboBox.close(); } else { myComboBox.open(); } }"/>
<page href="fl/controls/ComboBox.html#event:enter" title="ComboBox.enter" text="enter Dispatched if the editable property is set to true and the user presses the Enter key while typing in the editable text field."/>
<page href="fl/controls/ComboBox.html#event:itemRollOut" title="ComboBox.itemRollOut" text="itemRollOut Dispatched when the user rolls the pointer off of an item in the component."/>
<page href="fl/controls/ComboBox.html#event:itemRollOver" title="ComboBox.itemRollOver" text="itemRollOver Dispatched when the user rolls the pointer over an item in the component. The following example creates a ComboBox component that opens when the user rolls over the component instance: import fl.controls.ComboBox; import fl.controls.TextArea; import fl.events.ListEvent; var myComboBox:ComboBox = new ComboBox(); myComboBox.addItem({label:&quot;Item 1&quot;}); myComboBox.addItem({label:&quot;Item 2&quot;}); myComboBox.addItem({label:&quot;Item 3&quot;}); myComboBox.move(10, 10); myComboBox.addEventListener(Event.OPEN, openHandler); myComboBox.addEventListener(Event.CLOSE, closeHandler); myComboBox.addEventListener(ListEvent.ITEM_ROLL_OVER, itemRollOverHandler); myComboBox.addEventListener(ListEvent.ITEM_ROLL_OUT, itemRollOutHandler); myComboBox.addEventListener(MouseEvent.ROLL_OVER, rollOverHandler); myComboBox.addEventListener(MouseEvent.ROLL_OUT, rollOutHandler); myComboBox.dropdown.addEventListener(MouseEvent.ROLL_OVER, dropdownRollOverHandler) myComboBox.dropdown.addEventListener(MouseEvent.ROLL_OUT, dropdownRollOutHandler); addChild(myComboBox); var myTextArea:TextArea = new TextArea(); myTextArea.editable = false; myTextArea.setSize(320, 240); myTextArea.move(120, 10); addChild(myTextArea); function openHandler(event:Event):void { logEvent(&quot;ComboBox open&quot;); } function closeHandler(event:Event):void { logEvent(&quot;ComboBox close&quot;); } function itemRollOverHandler(event:ListEvent):void { var rowIdx:uint = event.rowIndex as uint; logEvent(&quot;ComboBox itemRollOver: &quot; + &quot;`&quot; + myComboBox.getItemAt(rowIdx).label + &quot;`&quot;); } function itemRollOutHandler(event:ListEvent):void { var rowIdx:uint = event.rowIndex as uint; logEvent(&quot;ComboBox itemRollOut: &quot; + &quot;`&quot; + myComboBox.getItemAt(rowIdx).label + &quot;`&quot;); } function rollOverHandler(event:MouseEvent):void { logEvent(&quot;ComboBox rollOver&quot;); myComboBox.open(); } function rollOutHandler(event:MouseEvent):void { logEvent(&quot;ComboBox rollOut&quot;); myComboBox.close(); } function dropdownRollOverHandler(event:MouseEvent):void { logEvent(&quot;ComboBox.dropdown rollOver&quot;); // reopen ComboBox after it gets closed by the ComboBox rollOut event myComboBox.open(); } function dropdownRollOutHandler(event:MouseEvent):void { logEvent(&quot;ComboBox.dropdown rollOut&quot;); myComboBox.close(); } function logEvent(text:String):void { myTextArea.appendText(text + &quot;\n&quot;); myTextArea.verticalScrollPosition = myTextArea.maxVerticalScrollPosition; }"/>
<page href="fl/controls/ComboBox.html#event:open" title="ComboBox.open" text="open Dispatched when the user clicks the drop-down button to display the drop-down list. Also dispatched when the user clicks the text field, if the ComboBox component is not editable. The following example creates a Button component that opens a ComboBox component's drop-down list using the open() method. The dropdown menu closes after 1 second unless the user mouses over the ComboBox or its dropdown menu: import fl.controls.Button; import fl.controls.ComboBox; var myComboBox:ComboBox = new ComboBox(); myComboBox.addItem({label:&quot;Item 1&quot;}); myComboBox.addItem({label:&quot;Item 2&quot;}); myComboBox.addItem({label:&quot;Item 3&quot;}); myComboBox.move(10, 10); myComboBox.addEventListener(MouseEvent.ROLL_OVER, rollOverHandler); myComboBox.dropdown.addEventListener(MouseEvent.ROLL_OVER, rollOverHandler); myComboBox.dropdown.addEventListener(MouseEvent.ROLL_OUT, rollOutHandler); addChild(myComboBox); var myButton:Button = new Button(); myButton.emphasized = true; myButton.label = &quot;open ComboBox&quot;; myButton.move(120, 10); myButton.addEventListener(MouseEvent.CLICK, clickHandler); addChild(myButton); var closeTimer:Timer = new Timer(1000, 1); closeTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timerCompleteHandler); function clickHandler(event:MouseEvent):void { myComboBox.open(); closeTimer.reset(); closeTimer.start(); } function timerCompleteHandler(event:TimerEvent):void { myComboBox.close(); } function rollOverHandler(event:MouseEvent):void { closeTimer.stop(); } function rollOutHandler(event:MouseEvent):void { myComboBox.close(); }"/>
<page href="fl/controls/ComboBox.html#event:scroll" title="ComboBox.scroll" text="scroll Dispatched when the user scrolls the drop-down list of the ComboBox component."/>
<page href="fl/controls/ComboBox.html#style:buttonWidth" title="ComboBox.buttonWidth" text="buttonWidth The space that separates the right edge of the component from the text representing the selected item, in pixels. The button is part of the background skin."/>
<page href="fl/controls/ComboBox.html#style:cellRenderer" title="ComboBox.cellRenderer" text="cellRenderer The class that provides the cell renderer for each item in the component."/>
<page href="fl/controls/ComboBox.html#style:contentPadding" title="ComboBox.contentPadding" text="contentPadding Padding between the content (the component and scroll bar), and the outside edge of the background, in pixels."/>
<page href="fl/controls/ComboBox.html#style:disabledAlpha" title="ComboBox.disabledAlpha" text="disabledAlpha The alpha value to set the list to when the enabled property is false."/>
<page href="fl/controls/ComboBox.html#style:disabledSkin" title="ComboBox.disabledSkin" text="disabledSkin The name of the class that provides the background that appears in the ComboBox component when the enabled property of the component is set to false."/>
<page href="fl/controls/ComboBox.html#style:downArrowDisabledSkin" title="ComboBox.downArrowDisabledSkin" text="downArrowDisabledSkin Name of the class to use as the skin for the down arrow button of the scroll bar when it is disabled. If you change the skin, either graphically or programmatically, you should ensure that the new skin is the same height (for horizontal scroll bars) or width (for vertical scroll bars) as the track."/>
<page href="fl/controls/ComboBox.html#style:downArrowDownSkin" title="ComboBox.downArrowDownSkin" text="downArrowDownSkin Name of the class to use as the skin for the down arrow button of the scroll bar when you click the arrow button. If you change the skin, either graphically or programmatically, you should ensure that the new skin is the same height (for horizontal scroll bars) or width (for vertical scroll bars) as the track."/>
<page href="fl/controls/ComboBox.html#style:downArrowOverSkin" title="ComboBox.downArrowOverSkin" text="downArrowOverSkin Name of the class to use as the skin for the down arrow button of the scroll bar when the mouse pointer is over the arrow button. If you change the skin, either graphically or programmatically, you should ensure that the new skin is the same height (for horizontal scroll bars) or width (for vertical scroll bars) as the track."/>
<page href="fl/controls/ComboBox.html#style:downArrowUpSkin" title="ComboBox.downArrowUpSkin" text="downArrowUpSkin Name of the class to use as the skin for the down arrow button of the scroll bar. If you change the skin, either graphically or programmatically, you should ensure that the new skin is the same height (for horizontal scroll bars) or width (for vertical scroll bars) as the track."/>
<page href="fl/controls/ComboBox.html#style:downSkin" title="ComboBox.downSkin" text="downSkin The name of the class that provides the background that appears in the ComboBox component when the mouse is down."/>
<page href="fl/controls/ComboBox.html#style:embedFonts" title="ComboBox.embedFonts" text="embedFonts Indicates whether embedded font outlines are used to render the text field. If this value is true, Flash Player renders the text field by using embedded font outlines. If this value is false, Flash Player renders the text field by using device fonts. If you set the embedFonts property to true for a text field, you must specify a font for that text by using the font property of a TextFormat object that is applied to the text field. If the specified font is not embedded in the SWF file, the text is not displayed."/>
<page href="fl/controls/ComboBox.html#style:overSkin" title="ComboBox.overSkin" text="overSkin The name of the class that provides the background that appears in the ComboBox component when the mouse is over it."/>
<page href="fl/controls/ComboBox.html#style:repeatDelay" title="ComboBox.repeatDelay" text="repeatDelay The number of milliseconds to wait after the buttonDown event is first dispatched before sending a second buttonDown event."/>
<page href="fl/controls/ComboBox.html#style:repeatInterval" title="ComboBox.repeatInterval" text="repeatInterval The interval, in milliseconds, between buttonDown events that are dispatched after the delay that is specified by the repeatDelay style."/>
<page href="fl/controls/ComboBox.html#style:textPadding" title="ComboBox.textPadding" text="textPadding The space that separates the border from the text representing the selected item, in pixels."/>
<page href="fl/controls/ComboBox.html#style:thumbArrowUpSkin" title="ComboBox.thumbArrowUpSkin" text="thumbArrowUpSkin Name of the class to use as the skin used for the thumb of the scroll bar."/>
<page href="fl/controls/ComboBox.html#style:thumbDisabledSkin" title="ComboBox.thumbDisabledSkin" text="thumbDisabledSkin The skin that is used to indicate the disabled state of the thumb."/>
<page href="fl/controls/ComboBox.html#style:thumbDownSkin" title="ComboBox.thumbDownSkin" text="thumbDownSkin Name of the class to use as the skin for the thumb of the scroll bar when you click the thumb."/>
<page href="fl/controls/ComboBox.html#style:thumbIcon" title="ComboBox.thumbIcon" text="thumbIcon Name of the class to use as the icon for the thumb of the scroll bar."/>
<page href="fl/controls/ComboBox.html#style:thumbOverSkin" title="ComboBox.thumbOverSkin" text="thumbOverSkin Name of the class to use as the skin for the thumb of the scroll bar when the mouse pointer is over the thumb."/>
<page href="fl/controls/ComboBox.html#style:trackDisabledSkin" title="ComboBox.trackDisabledSkin" text="trackDisabledSkin The skin that is used to indicate a disabled track."/>
<page href="fl/controls/ComboBox.html#style:trackDownSkin" title="ComboBox.trackDownSkin" text="trackDownSkin The skin that is used to indicate the down state of a disabled skin."/>
<page href="fl/controls/ComboBox.html#style:trackOverSkin" title="ComboBox.trackOverSkin" text="trackOverSkin The skin that is used to indicate the mouseover state for the scroll track."/>
<page href="fl/controls/ComboBox.html#style:trackUpSkin" title="ComboBox.trackUpSkin" text="trackUpSkin The skin used to indicate the mouse up state for the scroll track."/>
<page href="fl/controls/ComboBox.html#style:upArrowDisabledSkin" title="ComboBox.upArrowDisabledSkin" text="upArrowDisabledSkin Name of the class to use as the skin for the up arrow button of the scroll bar when it is disabled. If you change the skin, either graphically or programmatically, you should ensure that the new skin is the same height (for horizontal scroll bars) or width (for vertical scroll bars) as the track."/>
<page href="fl/controls/ComboBox.html#style:upArrowDownSkin" title="ComboBox.upArrowDownSkin" text="upArrowDownSkin Name of the class to use as the skin for the up arrow button of the scroll bar when you click the arrow button. If you change the skin, either graphically or programmatically, you should ensure that the new skin is the same height (for horizontal scroll bars) or width (for vertical scroll bars) as the track."/>
<page href="fl/controls/ComboBox.html#style:upArrowOverSkin" title="ComboBox.upArrowOverSkin" text="upArrowOverSkin Name of the class to use as the skin for the up arrow button of the scroll bar when the mouse pointer is over the arrow button. If you change the skin, either graphically or programmatically, you should ensure that the new skin is the same height (for horizontal scroll bars) or width (for vertical scroll bars) as the track."/>
<page href="fl/controls/ComboBox.html#style:upArrowUpSkin" title="ComboBox.upArrowUpSkin" text="upArrowUpSkin Name of the class to use as the skin for the up arrow button of the scroll bar. If you change the skin, either graphically or programmatically, you should ensure that the new skin is the same height (for horizontal scroll bars) or width (for vertical scroll bars) as the track."/>
<page href="fl/controls/ComboBox.html#style:upSkin" title="ComboBox.upSkin" text="upSkin The name of the class that provides the background of the ComboBox component."/>
<page href="fl/controls/TextArea.html" title="TextArea class" text="TextArea The TextArea component is a multiline text field with a border and optional scroll bars. The TextArea component supports the HTML rendering capabilities of Adobe Flash Player."/>
<page href="fl/controls/TextArea.html#TextArea()" title="TextArea.TextArea()" text="TextArea Creates a new TextArea component instance."/>
<page href="fl/controls/TextArea.html#appendText()" title="TextArea.appendText()" text="appendText Appends the specified string after the last character that the TextArea component contains. This method is more efficient than concatenating two strings by using an addition assignment on a text property--for example, myTextArea.text += moreText. This method is particularly useful when the TextArea component contains a significant amount of content. text The string to be appended to the existing text."/>
<page href="fl/controls/TextArea.html#drawFocus()" title="TextArea.drawFocus()" text="drawFocus Shows or hides the focus indicator on this component. The UIComponent class implements this method by creating and positioning an instance of the class that is specified by the focusSkin style. focused Indicates whether to show or hide the focus indicator. If this value is true, the focus indicator is shown; if this value is false, the focus indicator is hidden."/>
<page href="fl/controls/TextArea.html#getLineMetrics()" title="TextArea.getLineMetrics()" text="getLineMetrics Retrieves information about a specified line of text. lineIndex The line number for which information is to be retrieved."/>
<page href="fl/controls/TextArea.html#getStyleDefinition()" title="TextArea.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/controls/TextArea.html#setSelection()" title="TextArea.setSelection()" text="setSelection Sets the range of a selection made in a text area that has focus. The selection range begins at the index that is specified by the start parameter, and ends at the index that is specified by the end parameter. The selected text is treated as a zero-based string of characters in which the first selected character is located at index 0, the second character at index 1, and so on. This method has no effect if the text field does not have focus. setSelection endIndex The index location of the first character in the selection. The index position of the last character in the selection."/>
<page href="fl/controls/TextArea.html#alwaysShowSelection" title="TextArea.alwaysShowSelection" text="alwaysShowSelection Gets or sets a Boolean value that indicates whether Flash Player highlights a selection in the text field when the text field does not have focus. If this value is set to true and the text field does not have focus, Flash Player highlights the selection in gray. If this value is set to false and the text field does not have focus, Flash Player does not highlight the selection."/>
<page href="fl/controls/TextArea.html#condenseWhite" title="TextArea.condenseWhite" text="condenseWhite Gets or sets a Boolean value that indicates whether extra white space is removed from a TextArea component that contains HTML text. Examples of extra white space in the component include spaces and line breaks. A value of true indicates that extra white space is removed; a value of false indicates that extra white space is not removed. This property affects only text that is set by using the htmlText property; it does not affect text that is set by using the text property. If you use the text property to set text, the condenseWhite property is ignored. If the condenseWhite property is set 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. The following example uses a CheckBox component to toggle a TextArea component's condenseWhite property: import fl.controls.CheckBox; import fl.controls.ScrollPolicy; import fl.controls.TextArea; var str:String; var plainTextArea:TextArea = new TextArea(); plainTextArea.verticalScrollPolicy = ScrollPolicy.ON; plainTextArea.setSize(260, 360); plainTextArea.move(10, 10); addChild(plainTextArea); var htmlTextArea:TextArea = new TextArea(); htmlTextArea.verticalScrollPolicy = ScrollPolicy.ON; htmlTextArea.condenseWhite = true; htmlTextArea.setSize(260, 360); htmlTextArea.move(280, 10); addChild(htmlTextArea); var condenseCheckBox:CheckBox = new CheckBox(); condenseCheckBox.textField.autoSize = TextFieldAutoSize.LEFT; condenseCheckBox.label = &quot;condenseWhite:&quot;; condenseCheckBox.selected = htmlTextArea.condenseWhite; condenseCheckBox.move(htmlTextArea.x, htmlTextArea.y + htmlTextArea.height); condenseCheckBox.addEventListener(MouseEvent.CLICK, clickHandler); addChild(condenseCheckBox); var urlLdr:URLLoader = new URLLoader(); urlLdr.addEventListener(Event.COMPLETE, completeHandler); urlLdr.dataFormat = URLLoaderDataFormat.TEXT; urlLdr.load(new URLRequest(&quot;http://www.helpexamples.com/flash/lorem.html&quot;)); function completeHandler(event:Event):void { str = event.target.data as String; plainTextArea.text = str; htmlTextArea.htmlText = str; } function clickHandler(event:MouseEvent):void { var sel:Boolean = event.currentTarget.selected; htmlTextArea.condenseWhite = sel; htmlTextArea.htmlText = str; }"/>
<page href="fl/controls/TextArea.html#displayAsPassword" title="TextArea.displayAsPassword" text="displayAsPassword Gets or sets a Boolean value that indicates whether the TextArea component instance is the text field for a password. A value of true indicates that the current instance was created to contain a password; a value of false indicates that it was not. If the value of this property is true, the characters that the user enters in the text area cannot be seen. Instead, an asterisk is displayed in place of each character that the user enters. Additionally, the Cut and Copy commands and their keyboard shortcuts are disabled to prevent the recovery of a password from an unattended computer."/>
<page href="fl/controls/TextArea.html#editable" title="TextArea.editable" text="editable Gets or sets a Boolean value that indicates whether the user can edit the text in the component. A value of true indicates that the user can edit the text that the component contains; a value of false indicates that it cannot."/>
<page href="fl/controls/TextArea.html#enabled" title="TextArea.enabled" text="enabled Gets or sets a value that indicates whether the component can accept user interaction. A value of true indicates that the component can accept user interaction; a value of false indicates that it cannot. If you set the enabled property to false, the color of the container is dimmed and user input is blocked (with the exception of the Label and ProgressBar components)."/>
<page href="fl/controls/TextArea.html#horizontalScrollBar" title="TextArea.horizontalScrollBar" text="horizontalScrollBar Gets a reference to the horizontal scroll bar."/>
<page href="fl/controls/TextArea.html#horizontalScrollPolicy" title="TextArea.horizontalScrollPolicy" text="horizontalScrollPolicy Gets or sets the scroll policy for the horizontal scroll bar. This can be one of the following values: ScrollPolicy.ON: The horizontal scroll bar is always on. ScrollPolicy.OFF: The scroll bar is always off. ScrollPolicy.AUTO: The scroll bar turns on when it is needed. The following example creates a TextArea component instance and sets its horizontalScrollPolicy property to ScrollPolicy.ON so the horizontal scroll bar will always be visible, regardless of the amount of content currently in the text area: import fl.controls.TextArea; import fl.controls.ScrollPolicy; var myTextArea:TextArea = new TextArea(); myTextArea.wordWrap = false; myTextArea.horizontalScrollPolicy = ScrollPolicy.ON; myTextArea.text = &quot;The quick brown fox jumped over the lazy dog.&quot;; myTextArea.setSize(320, 120); myTextArea.move(10, 10); addChild(myTextArea);"/>
<page href="fl/controls/TextArea.html#horizontalScrollPosition" title="TextArea.horizontalScrollPosition" text="horizontalScrollPosition Gets or sets the change in the position of the scroll bar thumb, in pixels, after the user scrolls the text field horizontally. If this value is 0, the text field was not horizontally scrolled."/>
<page href="fl/controls/TextArea.html#htmlText" title="TextArea.htmlText" text="htmlText Gets or sets the HTML representation of the string that the text field contains. The following example creates a TextArea component instance and uses various HTML tags to style the text: import fl.controls.TextArea; var myText:String = &quot;&quot;; myText += &quot;&lt;p&gt;You can use the &lt;b&gt; tag to create &lt;b&gt;bold&lt;/b&gt; text.&lt;/p&gt;&quot;; myText += &quot;&lt;p&gt;You can use the &lt;i&gt; tag to create &lt;i&gt;italic&lt;/i&gt; text.&lt;/p&gt;&quot;; myText += &quot;&lt;p&gt;You can use the &lt;u&gt; tag to create &lt;u&gt;underlined&lt;/a&gt; text.&lt;/p&gt;&quot;; myText += &quot;&lt;p&gt;You can use the &lt;a&gt; tag to create &lt;a href='http://www.adobe.com'&gt;links to other sites&lt;/a&gt;.&lt;/p&gt;&quot;; myText += &quot;&lt;p&gt;You can use the &lt;br&gt; tag to create&lt;br&gt;new lines of text&lt;br&gt;whenever you want.&lt;/p&gt;&quot;; myText += &quot;&lt;p&gt;You can use the &lt;font&gt; tag to specificy different font &lt;font color='#FF0000'&gt;colors&lt;/font&gt;, &lt;font size='16'&gt;sizes&lt;/font&gt;, or &lt;font face='Times New Roman'&gt;faces&lt;/font&gt;.&lt;/p&gt;&quot;; myText += &quot;&lt;p&gt;You can use the &lt;img&gt; tag to load images or SWF files:&lt;br&gt;&lt;img src='http://www.helpexamples.com/flash/images/logo.png'&gt;.&lt;/p&gt;&quot;; var myTextArea:TextArea = new TextArea(); myTextArea.htmlText = myText; myTextArea.setSize(320, 240); myTextArea.move(10, 10); addChild(myTextArea);"/>
<page href="fl/controls/TextArea.html#imeMode" title="TextArea.imeMode" text="imeMode Gets or sets the mode of the input method editor (IME). The IME makes it possible for users to use a QWERTY keyboard to enter characters from the Chinese, Japanese, and Korean character sets. Flash sets the IME to the specified mode when the component gets focus, and restores it to the original value after the component loses focus. The flash.system.IMEConversionMode class defines constants for the valid values for this property. Set this property to null to prevent the use of the IME with the component."/>
<page href="fl/controls/TextArea.html#length" title="TextArea.length" text="length Gets the count of characters that the TextArea component contains."/>
<page href="fl/controls/TextArea.html#maxChars" title="TextArea.maxChars" text="maxChars Gets or sets the maximum number of characters that a user can enter in the text field. The following example creates a TextArea component instance and sets its maxChars property to limit the amount of text that can entered into the text area: import fl.controls.Label; import fl.controls.TextArea; var myTextArea:TextArea = new TextArea(); myTextArea.maxChars = 500; myTextArea.setSize(320, 240); myTextArea.move(10, 10); myTextArea.addEventListener(TextEvent.TEXT_INPUT, textInputHandler); addChild(myTextArea); var charCountLabel:Label = new Label(); charCountLabel.autoSize = TextFieldAutoSize.LEFT; charCountLabel.move(myTextArea.x, myTextArea.y + myTextArea.height); addChild(charCountLabel); charCountLabel.text = myTextArea.length + &quot; of &quot; + myTextArea.maxChars; function textInputHandler(event:TextEvent):void { updateCount(); } function updateCount():void { charCountLabel.text = myTextArea.length + &quot; of &quot; + myTextArea.maxChars; }"/>
<page href="fl/controls/TextArea.html#maxHorizontalScrollPosition" title="TextArea.maxHorizontalScrollPosition" text="maxHorizontalScrollPosition Gets the maximum value of the horizontalScrollPosition property."/>
<page href="fl/controls/TextArea.html#maxVerticalScrollPosition" title="TextArea.maxVerticalScrollPosition" text="maxVerticalScrollPosition Gets the maximum value of the verticalScrollPosition property."/>
<page href="fl/controls/TextArea.html#restrict" title="TextArea.restrict" text="restrict Gets or sets the string of characters that the text field accepts from a user. Note that characters that are not included in this string are accepted in the text field if they are entered programmatically. The characters in the string are read from left to right. You can specify a character range by using the hyphen (-) character. If the value of this property is null, the text field accepts all characters. If this property is set to an empty string (&quot;&quot;), the text field accepts no characters. If the string begins with a caret (^) character, all characters are initially accepted and succeeding characters in the string are excluded from the set of accepted characters. If the string does not begin with a caret (^) character, no characters are initially accepted and succeeding characters in the string are included in the set of accepted characters."/>
<page href="fl/controls/TextArea.html#selectionBeginIndex" title="TextArea.selectionBeginIndex" text="selectionBeginIndex Gets the index position of the first selected character in a selection of one or more characters. The index position of a selected character is zero-based and calculated from the first character that appears in the text area. If there is no selection, this value is set to the position of the caret."/>
<page href="fl/controls/TextArea.html#selectionEndIndex" title="TextArea.selectionEndIndex" text="selectionEndIndex Gets the index position of the last selected character in a selection of one or more characters. The index position of a selected character is zero-based and calculated from the first character that appears in the text area. If there is no selection, this value is set to the position of the caret."/>
<page href="fl/controls/TextArea.html#text" title="TextArea.text" text="text Gets or sets a string which contains the text that is currently in the TextInput component. This property contains text that is unformatted and does not have HTML tags. To retrieve this text formatted as HTML, use the htmlText property."/>
<page href="fl/controls/TextArea.html#textField" title="TextArea.textField" text="textField A reference to the internal text field of the TextArea component."/>
<page href="fl/controls/TextArea.html#textHeight" title="TextArea.textHeight" text="textHeight Gets the height of the text, in pixels. The following example creates a TextArea component instance and displays the textWidth and textHeight properties whenever the change event is dispatched: import fl.controls.Label; import fl.controls.TextArea; var myTextArea:TextArea = new TextArea() myTextArea.setSize(320, 240); myTextArea.move(10, 10); myTextArea.addEventListener(Event.CHANGE, changeHandler); addChild(myTextArea); var widthLabel:Label = new Label(); widthLabel.autoSize = TextFieldAutoSize.LEFT; widthLabel.text = &quot;textWidth: &quot; + myTextArea.textWidth; widthLabel.move(340, 10); addChild(widthLabel); var heightLabel:Label = new Label(); heightLabel.autoSize = TextFieldAutoSize.LEFT; heightLabel.text = &quot;textHeight: &quot; + myTextArea.textHeight; heightLabel.move(340, 30); addChild(heightLabel); function changeHandler(event:Event):void { widthLabel.text = &quot;textWidth: &quot; + myTextArea.textWidth; heightLabel.text = &quot;textHeight: &quot; + myTextArea.textHeight; }"/>
<page href="fl/controls/TextArea.html#textWidth" title="TextArea.textWidth" text="textWidth Gets the width of the text, in pixels. The following example creates a TextArea component instance and displays the textWidth and textHeight properties whenever the change event is dispatched: import fl.controls.Label; import fl.controls.TextArea; var myTextArea:TextArea = new TextArea() myTextArea.setSize(320, 240); myTextArea.move(10, 10); myTextArea.addEventListener(Event.CHANGE, changeHandler); addChild(myTextArea); var widthLabel:Label = new Label(); widthLabel.autoSize = TextFieldAutoSize.LEFT; widthLabel.text = &quot;textWidth: &quot; + myTextArea.textWidth; widthLabel.move(340, 10); addChild(widthLabel); var heightLabel:Label = new Label(); heightLabel.autoSize = TextFieldAutoSize.LEFT; heightLabel.text = &quot;textHeight: &quot; + myTextArea.textHeight; heightLabel.move(340, 30); addChild(heightLabel); function changeHandler(event:Event):void { widthLabel.text = &quot;textWidth: &quot; + myTextArea.textWidth; heightLabel.text = &quot;textHeight: &quot; + myTextArea.textHeight; }"/>
<page href="fl/controls/TextArea.html#verticalScrollBar" title="TextArea.verticalScrollBar" text="verticalScrollBar Gets a reference to the vertical scroll bar. The following example creates a TextArea component instance and sets the pageSize property on the components vertical scroll bar: import fl.controls.TextArea; import fl.events.ScrollEvent; var myTextArea:TextArea = new TextArea(); myTextArea.setSize(160, 120); myTextArea.move(10, 10); myTextArea.verticalScrollBar.pageSize = 1; myTextArea.addEventListener(ScrollEvent.SCROLL, scrollHandler); addChild(myTextArea); var myURLLoader:URLLoader = new URLLoader(); myURLLoader.addEventListener(Event.COMPLETE, completeHandler); myURLLoader.load(new URLRequest(&quot;http://www.helpexamples.com/flash/lorem.txt&quot;)); function scrollHandler(event:ScrollEvent):void { trace(&quot;scroll: &quot; + myTextArea.verticalScrollPosition + &quot; of &quot; + myTextArea.maxVerticalScrollPosition); } function completeHandler(event:Event):void { var txt:String = URLLoader(event.currentTarget).data as String; myTextArea.text = txt; }"/>
<page href="fl/controls/TextArea.html#verticalScrollPolicy" title="TextArea.verticalScrollPolicy" text="verticalScrollPolicy Gets or sets the scroll policy for the vertical scroll bar. This can be one of the following values: ScrollPolicy.ON: The scroll bar is always on. ScrollPolicy.OFF: The scroll bar is always off. ScrollPolicy.AUTO: The scroll bar turns on when it is needed. The following example creates a TextArea component instance and sets its verticalScrollPolicy property to ScrollPolicy.ON so the vertical scroll bar will always be visible, regardless of the amount of content currently in the text area: import fl.controls.TextArea; import fl.controls.ScrollPolicy; var myTextArea:TextArea = new TextArea(); myTextArea.verticalScrollPolicy = ScrollPolicy.ON; myTextArea.text = &quot;The quick brown fox jumped over the lazy dog.&quot;; myTextArea.setSize(160, 120); myTextArea.move(10, 10); addChild(myTextArea);"/>
<page href="fl/controls/TextArea.html#verticalScrollPosition" title="TextArea.verticalScrollPosition" text="verticalScrollPosition Gets or sets the change in the position of the scroll bar thumb, in pixels, after the user scrolls the text field vertically. If this value is 1, the text field was not vertically scrolled. The following example uses a Slider component to scroll the contents of a TextArea component: import fl.controls.ScrollPolicy; import fl.controls.Slider; import fl.controls.SliderDirection import fl.controls.TextArea; import fl.events.ScrollEvent; import fl.events.SliderEvent; var myTextArea:TextArea = new TextArea(); myTextArea.horizontalScrollPolicy = ScrollPolicy.OFF; myTextArea.verticalScrollPolicy = ScrollPolicy.OFF; myTextArea.setSize(320, 240); myTextArea.move(10, 10); myTextArea.addEventListener(ScrollEvent.SCROLL, scrollHandler); addChild(myTextArea) var mySlider:Slider = new Slider(); mySlider.liveDragging = true; mySlider.snapInterval = 1; mySlider.tickInterval = 1; mySlider.width = myTextArea.width; mySlider.move(myTextArea.x, myTextArea.y + myTextArea.height + 10); var urlLdr:URLLoader = new URLLoader(); urlLdr.addEventListener(Event.COMPLETE, completeHandler); urlLdr.dataFormat = URLLoaderDataFormat.TEXT; urlLdr.load(new URLRequest(&quot;http://www.helpexamples.com/flash/text/lorem.txt&quot;)); function completeHandler(event:Event):void { var txt:String = event.target.data as String; myTextArea.text = txt; myTextArea.drawNow(); mySlider.minimum = myTextArea.verticalScrollPosition; mySlider.maximum = myTextArea.maxVerticalScrollPosition; mySlider.addEventListener(SliderEvent.CHANGE, changeHandler); addChild(mySlider); } function scrollHandler(event:ScrollEvent):void { trace(&quot;scrolled:&quot;); mySlider.value = event.position; } function changeHandler(event:SliderEvent):void { trace(&quot;changed:&quot;); myTextArea.verticalScrollPosition = event.value; }"/>
<page href="fl/controls/TextArea.html#wordWrap" title="TextArea.wordWrap" text="wordWrap Gets or sets a Boolean value that indicates whether the text wraps at the end of the line. A value of true indicates that the text wraps; a value of false indicates that the text does not wrap."/>
<page href="fl/controls/TextArea.html#event:change" title="TextArea.change" text="change Dispatched when the text in the TextArea component changes."/>
<page href="fl/controls/TextArea.html#event:enter" title="TextArea.enter" text="enter Dispatched when the user presses the Enter key while in the component."/>
<page href="fl/controls/TextArea.html#event:scroll" title="TextArea.scroll" text="scroll Dispatched when the content is scrolled. The following example loads text into a TextArea component and traces the scroll direction, scroll position and maximum scroll position when the user scrolls the TextArea: import fl.controls.ScrollBarDirection; import fl.controls.TextArea; import fl.events.ScrollEvent; var myTextArea:TextArea = new TextArea(); myTextArea.setSize(320, 240); myTextArea.move(10, 10); myTextArea.addEventListener(ScrollEvent.SCROLL, scrollHandler); addChild(myTextArea); var urlLdr:URLLoader = new URLLoader(); urlLdr.addEventListener(Event.COMPLETE, completeHandler); urlLdr.dataFormat = URLLoaderDataFormat.TEXT; urlLdr.load(new URLRequest(&quot;http://www.helpexamples.com/flash/text/lorem.txt&quot;)); function completeHandler(event:Event):void { var txt:String = event.target.data as String; myTextArea.text = txt; } function scrollHandler(event:ScrollEvent):void { var myTA:TextArea = event.currentTarget as TextArea; var pos:Number = event.position; var maxPos:Number; if (event.direction == ScrollBarDirection.VERTICAL) { maxPos = myTA.maxVerticalScrollPosition; } else { maxPos = myTA.maxHorizontalScrollPosition; } trace(&quot;scroll: &quot; + event.direction + &quot; (&quot; + pos.toFixed(2) + &quot; of &quot; + maxPos + &quot;)&quot;); }"/>
<page href="fl/controls/TextArea.html#event:textInput" title="TextArea.textInput" text="textInput Dispatched when the user enters, deletes, or pastes text into the component."/>
<page href="fl/controls/TextArea.html#style:disabledSkin" title="TextArea.disabledSkin" text="disabledSkin The class that provides the background for the TextArea component when its enabled property is set to false."/>
<page href="fl/controls/TextArea.html#style:embedFonts" title="TextArea.embedFonts" text="embedFonts Indicates whether embedded font outlines are used to render the text field. If this value is true, Flash Player renders the text field by using embedded font outlines. If this value is false, Flash Player renders the text field by using device fonts. If you set the embedFonts property to true for a text field, you must specify a font for that text by using the font property of a TextFormat object that is applied to the text field. If the specified font is not embedded in the SWF file, the text is not displayed."/>
<page href="fl/controls/TextArea.html#style:textPadding" title="TextArea.textPadding" text="textPadding The padding that separates the component border from the text, in pixels."/>
<page href="fl/controls/TextArea.html#style:upSkin" title="TextArea.upSkin" text="upSkin The class that provides the background for the TextArea component."/>
<page href="fl/controls/ButtonLabelPlacement.html" title="ButtonLabelPlacement class" text="ButtonLabelPlacement The ButtonLabelPlacement class defines constants for the values of the labelPlacement property of a Button, CheckBox, or RadioButton component."/>
<page href="fl/controls/ButtonLabelPlacement.html#BOTTOM" title="ButtonLabelPlacement.BOTTOM" text="BOTTOM The label appears below the icon."/>
<page href="fl/controls/ButtonLabelPlacement.html#LEFT" title="ButtonLabelPlacement.LEFT" text="LEFT The label appears to the left of the icon."/>
<page href="fl/controls/ButtonLabelPlacement.html#RIGHT" title="ButtonLabelPlacement.RIGHT" text="RIGHT The label appears to the right of the icon."/>
<page href="fl/controls/ButtonLabelPlacement.html#TOP" title="ButtonLabelPlacement.TOP" text="TOP The label appears above the icon."/>
<page href="fl/controls/ProgressBarDirection.html" title="ProgressBarDirection class" text="ProgressBarDirection The ProgressBarDirection class defines the values for the direction property of the ProgressBar class."/>
<page href="fl/controls/ProgressBarDirection.html#LEFT" title="ProgressBarDirection.LEFT" text="LEFT Fill the progress bar from right to left."/>
<page href="fl/controls/ProgressBarDirection.html#RIGHT" title="ProgressBarDirection.RIGHT" text="RIGHT Fill the progress bar from left to right."/>
<page href="fl/controls/ColorPicker.html" title="ColorPicker class" text="ColorPicker The ColorPicker component displays a list of one or more swatches from which the user can select a color. By default, the component displays a single swatch of color on a square button. When the user clicks this button, a panel opens to display the complete list of swatches."/>
<page href="fl/controls/ColorPicker.html#ColorPicker()" title="ColorPicker.ColorPicker()" text="ColorPicker Creates an instance of the ColorPicker class."/>
<page href="fl/controls/ColorPicker.html#close()" title="ColorPicker.close()" text="close Hides the color palette. Calling this method causes the close event to be dispatched. If the color palette is already closed or disabled, this method has no effect."/>
<page href="fl/controls/ColorPicker.html#getStyleDefinition()" title="ColorPicker.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/controls/ColorPicker.html#open()" title="ColorPicker.open()" text="open Shows the color palette. Calling this method causes the open event to be dispatched. If the color palette is already open or disabled, this method has no effect. The following example creates a ColorPicker component instance and calls the open() method when the user rolls the mouse over the instance: import fl.controls.ColorPicker; var myColorPicker:ColorPicker = new ColorPicker(); myColorPicker.editable = false; myColorPicker.addEventListener(MouseEvent.ROLL_OVER, rollOverHandler); myColorPicker.move(10, 10); addChild(myColorPicker); function rollOverHandler(event:MouseEvent):void { event.currentTarget.open(); }"/>
<page href="fl/controls/ColorPicker.html#colors" title="ColorPicker.colors" text="colors Gets or sets the array of custom colors that the ColorPicker component provides. The ColorPicker component draws and displays the colors that are described in this array. Note: The maximum number of colors that the ColorPicker component can display is 1024. By default, this array contains 216 autogenerated colors. The following example creates a color picker that is restricted to shades of green: import fl.controls.ColorPicker; var cp:ColorPicker = new ColorPicker(); cp.colors = [ 0x001100, 0x003300, 0x005500, 0x007700, 0x009900, 0x00BB00, 0x00DD00, 0x00FF00 ]; addChild(cp);"/>
<page href="fl/controls/ColorPicker.html#editable" title="ColorPicker.editable" text="editable Gets or sets a Boolean value that indicates whether the internal text field of the ColorPicker component is editable. A value of true indicates that the internal text field is editable; a value of false indicates that it is not."/>
<page href="fl/controls/ColorPicker.html#enabled" title="ColorPicker.enabled" text="enabled Gets or sets a value that indicates whether the component can accept user interaction. A value of true indicates that the component can accept user interaction; a value of false indicates that it cannot. If you set the enabled property to false, the color of the container is dimmed and user input is blocked (with the exception of the Label and ProgressBar components)."/>
<page href="fl/controls/ColorPicker.html#hexValue" title="ColorPicker.hexValue" text="hexValue Gets the string value of the current color selection. The following example displays the selected color's hexadecimal value when the color is changed: import fl.controls.ColorPicker; import fl.events.ColorPickerEvent; var myColorPicker:ColorPicker = new ColorPicker(); myColorPicker.addEventListener(ColorPickerEvent.CHANGE, changeHandler); myColorPicker.move(10, 10); addChild(myColorPicker); function changeHandler(event:ColorPickerEvent):void { trace(&quot;color changed:&quot;, event.color, &quot;(#&quot; + event.target.hexValue + &quot;)&quot;); }"/>
<page href="fl/controls/ColorPicker.html#imeMode" title="ColorPicker.imeMode" text="imeMode Gets or sets the mode of the input method editor (IME). The IME makes it possible for users to use a QWERTY keyboard to enter characters from the Chinese, Japanese, and Korean character sets. Flash sets the IME to the specified mode when the component gets focus, and restores it to the original value after the component loses focus. The flash.system.IMEConversionMode class defines constants for the valid values for this property. Set this property to null to prevent the use of the IME with the component."/>
<page href="fl/controls/ColorPicker.html#selectedColor" title="ColorPicker.selectedColor" text="selectedColor Gets or sets the swatch that is currently highlighted in the palette of the ColorPicker component. The following example creates a ColorPicker component instance that displays its selectedColor and hexValue properties when changed: import fl.controls.ColorPicker; import fl.events.ColorPickerEvent; var myColorPicker:ColorPicker = new ColorPicker(); myColorPicker.addEventListener(ColorPickerEvent.CHANGE, changeHandler); myColorPicker.setSize(60, 60); myColorPicker.move(10, 10); addChild(myColorPicker); function changeHandler(event:ColorPickerEvent):void { var myCP:ColorPicker = event.currentTarget as ColorPicker; trace(&quot;{ColorPickerEvent}.color:&quot;, event.color); trace(&quot;{ColorPicker}.selectedColor:&quot;, myCP.selectedColor); trace(&quot;{ColorPicker}.hexValue:&quot;, myCP.hexValue); }"/>
<page href="fl/controls/ColorPicker.html#showTextField" title="ColorPicker.showTextField" text="showTextField Gets or sets a Boolean value that indicates whether the internal text field of the ColorPicker component is displayed. A value of true indicates that the internal text field is displayed; a value of false indicates that it is not. The following example uses a CheckBox component to toggle the value of a ColorPicker component's showTextField property: import fl.controls.CheckBox; import fl.controls.ColorPicker; var myCheckBox:CheckBox = new CheckBox(); myCheckBox.textField.autoSize = TextFieldAutoSize.LEFT; myCheckBox.label = &quot;showTextField:&quot;; myCheckBox.move(10, 10); myCheckBox.selected = true; myCheckBox.addEventListener(Event.CHANGE, changeHandler); addChild(myCheckBox); var myColorPicker:ColorPicker = new ColorPicker(); myColorPicker.showTextField = myCheckBox.selected; myColorPicker.move(myCheckBox.x, myCheckBox.y + myCheckBox.height); myColorPicker.open(); addChild(myColorPicker); function changeHandler(event:Event):void { myColorPicker.showTextField = myCheckBox.selected; try { myColorPicker.open(); } catch (error:*) { trace(&quot;Caught&quot;); } }"/>
<page href="fl/controls/ColorPicker.html#textField" title="ColorPicker.textField" text="textField A reference to the internal text field of the ColorPicker component."/>
<page href="fl/controls/ColorPicker.html#event:change" title="ColorPicker.change" text="change Dispatched when the user clicks a color in the palette. The following example displays the selected color's hexadecimal value when the color is changed: import fl.controls.ColorPicker; import fl.events.ColorPickerEvent; var myColorPicker:ColorPicker = new ColorPicker(); myColorPicker.addEventListener(ColorPickerEvent.CHANGE, changeHandler); myColorPicker.move(10, 10); addChild(myColorPicker); function changeHandler(event:ColorPickerEvent):void { trace(&quot;color changed:&quot;, event.color, &quot;(#&quot; + event.target.hexValue + &quot;)&quot;); }"/>
<page href="fl/controls/ColorPicker.html#event:close" title="ColorPicker.close" text="close Dispatched when the user closes the color palette."/>
<page href="fl/controls/ColorPicker.html#event:enter" title="ColorPicker.enter" text="enter Dispatched when the user presses the Enter key after editing the internal text field of the ColorPicker component. The following example creates an editable ComboBox component instance that traces the selectedColor and hexValue properties when the user presses the Enter key in the internal text field: import fl.controls.ColorPicker; import fl.events.ColorPickerEvent; var myColorPicker:ColorPicker = new ColorPicker(); myColorPicker.move(10, 10); myColorPicker.addEventListener(ColorPickerEvent.ENTER, enterHandler); addChild(myColorPicker); function enterHandler(event:ColorPickerEvent):void { trace(&quot;color: &quot; + event.color); trace(&quot;selectedColor: &quot; + myColorPicker.selectedColor); trace(&quot;hexValue: &quot; + myColorPicker.hexValue); trace(&quot;&quot;); }"/>
<page href="fl/controls/ColorPicker.html#event:itemRollOut" title="ColorPicker.itemRollOut" text="itemRollOut Dispatched when the user rolls out of a swatch in the color palette."/>
<page href="fl/controls/ColorPicker.html#event:itemRollOver" title="ColorPicker.itemRollOver" text="itemRollOver Dispatched when the user rolls over a swatch in the color palette."/>
<page href="fl/controls/ColorPicker.html#event:open" title="ColorPicker.open" text="open Dispatched when the user opens the color palette. The following example creates a ColorPicker component instance and calls the open() method when the user rolls the mouse over the instance: import fl.controls.ColorPicker; var myColorPicker:ColorPicker = new ColorPicker(); myColorPicker.editable = false; myColorPicker.addEventListener(MouseEvent.ROLL_OVER, rollOverHandler); myColorPicker.move(10, 10); addChild(myColorPicker); function rollOverHandler(event:MouseEvent):void { event.currentTarget.open(); }"/>
<page href="fl/controls/ColorPicker.html#style:background" title="ColorPicker.background" text="background The class that provides the background of the palette that appears in the ColorPicker component."/>
<page href="fl/controls/ColorPicker.html#style:backgroundPadding" title="ColorPicker.backgroundPadding" text="backgroundPadding The padding that appears around the group of color swatches, in pixels."/>
<page href="fl/controls/ColorPicker.html#style:colorWell" title="ColorPicker.colorWell" text="colorWell The class that provides the skin for the color well when it is filled with a color."/>
<page href="fl/controls/ColorPicker.html#style:columnCount" title="ColorPicker.columnCount" text="columnCount The number of columns to be drawn in the ColorPicker color palette."/>
<page href="fl/controls/ColorPicker.html#style:disabledSkin" title="ColorPicker.disabledSkin" text="disabledSkin The class that provides the skin for a disabled button in the ColorPicker."/>
<page href="fl/controls/ColorPicker.html#style:downSkin" title="ColorPicker.downSkin" text="downSkin The class that provides the skin for the ColorPicker button when it is in the down position."/>
<page href="fl/controls/ColorPicker.html#style:embedFonts" title="ColorPicker.embedFonts" text="embedFonts Indicates whether embedded font outlines are used to render the text field. If this value is true, Flash Player renders the text field by using embedded font outlines. If this value is false, Flash Player renders the text field by using device fonts. If you set the embedFonts property to true for a text field, you must specify a font for that text by using the font property of a TextFormat object that is applied to the text field. If the specified font is not embedded in the SWF file, the text is not displayed."/>
<page href="fl/controls/ColorPicker.html#style:overSkin" title="ColorPicker.overSkin" text="overSkin The class that provides the skin for the color well when the pointing device rolls over it."/>
<page href="fl/controls/ColorPicker.html#style:swatchHeight" title="ColorPicker.swatchHeight" text="swatchHeight The height of each swatch, in pixels."/>
<page href="fl/controls/ColorPicker.html#style:swatchPadding" title="ColorPicker.swatchPadding" text="swatchPadding Defines the padding that appears around each swatch in the color palette, in pixels."/>
<page href="fl/controls/ColorPicker.html#style:swatchSelectedSkin" title="ColorPicker.swatchSelectedSkin" text="swatchSelectedSkin The class that provides the skin which is used to highlight the currently selected color."/>
<page href="fl/controls/ColorPicker.html#style:swatchSkin" title="ColorPicker.swatchSkin" text="swatchSkin The class that provides the skin which is used to draw the swatches contained in the ColorPicker component."/>
<page href="fl/controls/ColorPicker.html#style:swatchWidth" title="ColorPicker.swatchWidth" text="swatchWidth The width of each swatch, in pixels."/>
<page href="fl/controls/ColorPicker.html#style:textFieldSkin" title="ColorPicker.textFieldSkin" text="textFieldSkin The class that provides the background for the text field of the ColorPicker component."/>
<page href="fl/controls/ColorPicker.html#style:textPadding" title="ColorPicker.textPadding" text="textPadding The padding that appears around the color TextField, in pixels."/>
<page href="fl/controls/ColorPicker.html#style:upSkin" title="ColorPicker.upSkin" text="upSkin The class that provides the skin for the ColorPicker button when it is in the up position."/>
<page href="fl/controls/ScrollBar.html" title="ScrollBar class" text="ScrollBar The ScrollBar component provides the end user with a way to control the portion of data that is displayed when there is too much data to fit in the display area. The scroll bar consists of four parts: two arrow buttons, a track, and a thumb. The position of the thumb and display of the buttons depends on the current state of the scroll bar. The scroll bar uses four parameters to calculate its display state: a minimum range value; a maximum range value; a current position that must be within the range values; and a viewport size that must be equal to or less than the range and represents the number of items in the range that can be displayed at the same time."/>
<page href="fl/controls/ScrollBar.html#ScrollBar()" title="ScrollBar.ScrollBar()" text="ScrollBar Creates a new ScrollBar component instance."/>
<page href="fl/controls/ScrollBar.html#getStyleDefinition()" title="ScrollBar.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat());"/>
<page href="fl/controls/ScrollBar.html#setScrollProperties()" title="ScrollBar.setScrollProperties()" text="setScrollProperties Sets the range and viewport size of the ScrollBar component. The ScrollBar component updates the state of the arrow buttons and size of the scroll thumb accordingly. All of the scroll properties are relative to the scale of the minScrollPosition and the maxScrollPosition. Each number between the maximum and minumum values represents one scroll position. pageSize minScrollPosition maxScrollPosition pageScrollSize Size of one page. Determines the size of the thumb, and the increment by which the scroll bar moves when the arrows are clicked. Bottom of the scrolling range. Top of the scrolling range. Increment to move when a track is pressed, in pixels."/>
<page href="fl/controls/ScrollBar.html#setSize()" title="ScrollBar.setSize()" text="setSize Sets the component to the specified width and height. width height The width of the component, in pixels. The height of the component, in pixels."/>
<page href="fl/controls/ScrollBar.html#direction" title="ScrollBar.direction" text="direction Gets or sets a value that indicates whether the scroll bar scrolls horizontally or vertically. Valid values are ScrollBarDirection.HORIZONTAL and ScrollBarDirection.VERTICAL."/>
<page href="fl/controls/ScrollBar.html#enabled" title="ScrollBar.enabled" text="enabled Gets or sets a Boolean value that indicates whether the scroll bar is enabled. A value of true indicates that the scroll bar is enabled; a value of false indicates that it is not."/>
<page href="fl/controls/ScrollBar.html#height" title="ScrollBar.height" text="height Gets or sets the height of the component, in pixels. Setting this property causes a resize event to be dispatched. See the resize event for detailed information about when it is dispatched. If the scaleY property of the component is not 1.0, the height of the component that is obtained from its internal coordinates will not match the height value from the parent coordinates. For example, a component that is 100 pixels in height and has a scaleY of 2 has a value of 100 pixels in the parent, but internally stores a value indicating that it is 50 pixels in height."/>
<page href="fl/controls/ScrollBar.html#lineScrollSize" title="ScrollBar.lineScrollSize" text="lineScrollSize Gets or sets a value that represents the increment by which to scroll the page when the scroll bar track is pressed. The pageScrollSize is measured in increments between the minScrollPosition and the maxScrollPosition values. If this value is set to 0, the value of the pageSize property is used."/>
<page href="fl/controls/ScrollBar.html#maxScrollPosition" title="ScrollBar.maxScrollPosition" text="maxScrollPosition Gets or sets a number that represents the maximum scroll position. The scrollPosition value represents a relative position between the minScrollPosition and the maxScrollPosition values. This property is set by the component that contains the scroll bar, and is the maximum value. Usually this property describes the number of pixels between the bottom of the component and the bottom of the content, but this property is often set to a different value to change the behavior of the scrolling. For example, the TextArea component sets this property to the maxScrollH value of the text field, so that the scroll bar scrolls appropriately by line of text."/>
<page href="fl/controls/ScrollBar.html#minScrollPosition" title="ScrollBar.minScrollPosition" text="minScrollPosition Gets or sets a number that represents the minimum scroll position. The scrollPosition value represents a relative position between the minScrollPosition and the maxScrollPosition values. This property is set by the component that contains the scroll bar, and is usually zero."/>
<page href="fl/controls/ScrollBar.html#pageScrollSize" title="ScrollBar.pageScrollSize" text="pageScrollSize Gets or sets a value that represents the increment by which the page is scrolled when the scroll bar track is pressed. The pageScrollSize value is measured in increments between the minScrollPosition and the maxScrollPosition values. If this value is set to 0, the value of the pageSize property is used."/>
<page href="fl/controls/ScrollBar.html#pageSize" title="ScrollBar.pageSize" text="pageSize Gets or sets the number of lines that a page contains. The lineScrollSize is measured in increments between the minScrollPosition and the maxScrollPosition. If this property is 0, the scroll bar will not scroll."/>
<page href="fl/controls/ScrollBar.html#scrollPosition" title="ScrollBar.scrollPosition" text="scrollPosition Gets or sets the current scroll position and updates the position of the thumb. The scrollPosition value represents a relative position between the minScrollPosition and maxScrollPosition values."/>
<page href="fl/controls/ScrollBar.html#width" title="ScrollBar.width" text="width Gets or sets the width of the component, in pixels. Setting this property causes a resize event to be dispatched. See the resize event for detailed information about when it is dispatched. If the scaleX property of the component is not 1.0, the width of the component that is obtained from its internal coordinates will not match the width value from the parent coordinates. For example, a component that is 100 pixels in width and has a scaleX of 2 has a value of 100 pixels in the parent, but internally stores a value indicating that it is 50 pixels wide."/>
<page href="fl/controls/ScrollBar.html#event:scroll" title="ScrollBar.scroll" text="scroll Dispatched when the ScrollBar instance's scrollPosition property changes."/>
<page href="fl/controls/ScrollBar.html#style:downArrowDisabledSkin" title="ScrollBar.downArrowDisabledSkin" text="downArrowDisabledSkin Name of the class to use as the skin for the down arrow button of the scroll bar when it is disabled. If you change the skin, either graphically or programmatically, you should ensure that the new skin is the same height (for horizontal scroll bars) or width (for vertical scroll bars) as the track."/>
<page href="fl/controls/ScrollBar.html#style:downArrowDownSkin" title="ScrollBar.downArrowDownSkin" text="downArrowDownSkin Name of the class to use as the skin for the down arrow button of the scroll bar when you click the arrow button. If you change the skin, either graphically or programmatically, you should ensure that the new skin is the same height (for horizontal scroll bars) or width (for vertical scroll bars) as the track."/>
<page href="fl/controls/ScrollBar.html#style:downArrowOverSkin" title="ScrollBar.downArrowOverSkin" text="downArrowOverSkin Name of the class to use as the skin for the down arrow button of the scroll bar when the mouse pointer is over the arrow button. If you change the skin, either graphically or programmatically, you should ensure that the new skin is the same height (for horizontal scroll bars) or width (for vertical scroll bars) as the track."/>
<page href="fl/controls/ScrollBar.html#style:downArrowUpSkin" title="ScrollBar.downArrowUpSkin" text="downArrowUpSkin Name of the class to use as the skin for the down arrow button of the scroll bar. If you change the skin, either graphically or programmatically, you should ensure that the new skin is the same height (for horizontal scroll bars) or width (for vertical scroll bars) as the track."/>
<page href="fl/controls/ScrollBar.html#style:repeatDelay" title="ScrollBar.repeatDelay" text="repeatDelay The number of milliseconds to wait after the buttonDown event is first dispatched before sending a second buttonDown event."/>
<page href="fl/controls/ScrollBar.html#style:repeatInterval" title="ScrollBar.repeatInterval" text="repeatInterval The interval, in milliseconds, between buttonDown events that are dispatched after the delay that is specified by the repeatDelay style."/>
<page href="fl/controls/ScrollBar.html#style:thumbDisabledSkin" title="ScrollBar.thumbDisabledSkin" text="thumbDisabledSkin The skin that is used to indicate the disabled state of the thumb."/>
<page href="fl/controls/ScrollBar.html#style:thumbDownSkin" title="ScrollBar.thumbDownSkin" text="thumbDownSkin Name of the class to use as the skin for the thumb of the scroll bar when you click the thumb."/>
<page href="fl/controls/ScrollBar.html#style:thumbIcon" title="ScrollBar.thumbIcon" text="thumbIcon Name of the class to use as the icon for the thumb of the scroll bar."/>
<page href="fl/controls/ScrollBar.html#style:thumbOverSkin" title="ScrollBar.thumbOverSkin" text="thumbOverSkin Name of the class to use as the skin for the thumb of the scroll bar when the mouse pointer is over the thumb."/>
<page href="fl/controls/ScrollBar.html#style:thumbUpSkin" title="ScrollBar.thumbUpSkin" text="thumbUpSkin Name of the class to use as the skin used for the thumb of the scroll bar."/>
<page href="fl/controls/ScrollBar.html#style:trackDisabledSkin" title="ScrollBar.trackDisabledSkin" text="trackDisabledSkin The skin that is used to indicate a disabled track."/>
<page href="fl/controls/ScrollBar.html#style:trackDownSkin" title="ScrollBar.trackDownSkin" text="trackDownSkin The skin that is used to indicate the down state of a disabled skin."/>
<page href="fl/controls/ScrollBar.html#style:trackOverSkin" title="ScrollBar.trackOverSkin" text="trackOverSkin The skin that is used to indicate the mouseover state for the scroll track."/>
<page href="fl/controls/ScrollBar.html#style:trackUpSkin" title="ScrollBar.trackUpSkin" text="trackUpSkin The skin used to indicate the mouse up state for the scroll track."/>
<page href="fl/controls/ScrollBar.html#style:upArrowDisabledSkin" title="ScrollBar.upArrowDisabledSkin" text="upArrowDisabledSkin Name of the class to use as the skin for the up arrow button of the scroll bar when it is disabled. If you change the skin, either graphically or programmatically, you should ensure that the new skin is the same height (for horizontal scroll bars) or width (for vertical scroll bars) as the track."/>
<page href="fl/controls/ScrollBar.html#style:upArrowDownSkin" title="ScrollBar.upArrowDownSkin" text="upArrowDownSkin Name of the class to use as the skin for the up arrow button of the scroll bar when you click the arrow button. If you change the skin, either graphically or programmatically, you should ensure that the new skin is the same height (for horizontal scroll bars) or width (for vertical scroll bars) as the track."/>
<page href="fl/controls/ScrollBar.html#style:upArrowOverSkin" title="ScrollBar.upArrowOverSkin" text="upArrowOverSkin Name of the class to use as the skin for the up arrow button of the scroll bar when the mouse pointer is over the arrow button. If you change the skin, either graphically or programmatically, you should ensure that the new skin is the same height (for horizontal scroll bars) or width (for vertical scroll bars) as the track."/>
<page href="fl/controls/ScrollBar.html#style:upArrowUpSkin" title="ScrollBar.upArrowUpSkin" text="upArrowUpSkin Name of the class to use as the skin for the up arrow button of the scroll bar. If you change the skin, either graphically or programmatically, you should ensure that the new skin is the same height (for horizontal scroll bars) or width (for vertical scroll bars) as the track."/>
<page href="fl/controls/RadioButton.html" title="RadioButton class" text="RadioButton The RadioButton component lets you force a user to make a single selection from a set of choices. This component must be used in a group of at least two RadioButton instances. Only one member of the group can be selected at any given time. Selecting one radio button in a group deselects the currently selected radio button in the group. You set the groupName parameter to indicate which group a radio button belongs to. When the user clicks or tabs into a RadioButton component group, only the selected radio button receives focus. A radio button can be enabled or disabled. A disabled radio button does not receive mouse or keyboard input."/>
<page href="fl/controls/RadioButton.html#RadioButton()" title="RadioButton.RadioButton()" text="RadioButton Creates a new RadioButton component instance."/>
<page href="fl/controls/RadioButton.html#drawFocus()" title="RadioButton.drawFocus()" text="drawFocus Shows or hides the focus indicator around this component instance. focused Show or hide the focus indicator."/>
<page href="fl/controls/RadioButton.html#getStyleDefinition()" title="RadioButton.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/controls/RadioButton.html#autoRepeat" title="RadioButton.autoRepeat" text="autoRepeat A radio button never auto-repeats by definition, so the autoRepeat property is set to false in the constructor and cannot be changed."/>
<page href="fl/controls/RadioButton.html#group" title="RadioButton.group" text="group The RadioButtonGroup object to which this RadioButton belongs. The following example demonstrates how to create radio buttons that have different groupings: import fl.controls.RadioButton; import fl.controls.RadioButtonGroup; var rbg1:RadioButtonGroup = new RadioButtonGroup(&quot;group1&quot;); var rbg2:RadioButtonGroup = new RadioButtonGroup(&quot;group2&quot;); var rb1:RadioButton = new RadioButton(); var rb2:RadioButton = new RadioButton(); var rb3:RadioButton = new RadioButton(); var rb4:RadioButton = new RadioButton(); rb1.group = rbg1; rb2.group = rbg1; rb3.group = rbg2; rb4.group = rbg2; rb1.move(10,10); rb2.move(10,50); rb3.move(150,10); rb4.move(150,50); addChild(rb1); addChild(rb2); addChild(rb3); addChild(rb4);"/>
<page href="fl/controls/RadioButton.html#groupName" title="RadioButton.groupName" text="groupName The group name for a radio button instance or group. You can use this property to get or set a group name for a radio button instance or for a radio button group. The following example demonstrates how to determine the group name of a radio button that was clicked: import fl.controls.RadioButton; import fl.controls.RadioButtonGroup; var rbg1:RadioButtonGroup = new RadioButtonGroup(&quot;group1&quot;); var rbg2:RadioButtonGroup = new RadioButtonGroup(&quot;group2&quot;); var rb1:RadioButton = new RadioButton(); var rb2:RadioButton = new RadioButton(); var rb3:RadioButton = new RadioButton(); var rb4:RadioButton = new RadioButton(); rb1.addEventListener(MouseEvent.CLICK, announceGroup); rb2.addEventListener(MouseEvent.CLICK, announceGroup); rb3.addEventListener(MouseEvent.CLICK, announceGroup); rb4.addEventListener(MouseEvent.CLICK, announceGroup); rb1.group = rb2.group = rbg1; rb3.group = rb4.group = rbg2; rb1.move(10,10); rb2.move(10,50); rb3.move(150,10); rb4.move(150,50); addChild(rb1); addChild(rb2); addChild(rb3); addChild(rb4); function announceGroup(e:MouseEvent):void { var rb:RadioButton = e.target as RadioButton; trace(rb.groupName); }"/>
<page href="fl/controls/RadioButton.html#selected" title="RadioButton.selected" text="selected Indicates whether a radio button is currently selected (true) or deselected (false)."/>
<page href="fl/controls/RadioButton.html#toggle" title="RadioButton.toggle" text="toggle A radio button is a toggle button; its toggle property is set to true in the constructor and cannot be changed. This property cannot be set on the RadioButton."/>
<page href="fl/controls/RadioButton.html#value" title="RadioButton.value" text="value A user-defined value that is associated with a radio button."/>
<page href="fl/controls/RadioButton.html#event:change" title="RadioButton.change" text="change Dispatched when the radio button instance's selected property changes. The following example creates three ComboBox component instances and listens for the click and change events: import fl.controls.RadioButton; var radio1:RadioButton = new RadioButton(); radio1.label = &quot;Option A&quot;; radio1.move(10, 10); radio1.addEventListener(MouseEvent.CLICK, clickHandler); radio1.addEventListener(Event.CHANGE, changeHandler); addChild(radio1); var radio2:RadioButton = new RadioButton(); radio2.label = &quot;Option B&quot;; radio2.move(10, 30); radio2.addEventListener(MouseEvent.CLICK, clickHandler); radio2.addEventListener(Event.CHANGE, changeHandler); addChild(radio2); var radio3:RadioButton = new RadioButton(); radio3.label = &quot;Option C&quot;; radio3.move(10, 50); radio3.addEventListener(MouseEvent.CLICK, clickHandler); radio3.addEventListener(Event.CHANGE, changeHandler); addChild(radio3); function clickHandler(event:MouseEvent):void { trace(&quot;click:&quot;, event.currentTarget.label); } function changeHandler(event:Event):void { trace(&quot;change:&quot;, event.currentTarget.label); }"/>
<page href="fl/controls/RadioButton.html#event:click" title="RadioButton.click" text="click Dispatched when the user clicks the radio button with the mouse or spacebar. The following example creates three ComboBox component instances and listens for the click and change events: import fl.controls.RadioButton; var radio1:RadioButton = new RadioButton(); radio1.label = &quot;Option A&quot;; radio1.move(10, 10); radio1.addEventListener(MouseEvent.CLICK, clickHandler); radio1.addEventListener(Event.CHANGE, changeHandler); addChild(radio1); var radio2:RadioButton = new RadioButton(); radio2.label = &quot;Option B&quot;; radio2.move(10, 30); radio2.addEventListener(MouseEvent.CLICK, clickHandler); radio2.addEventListener(Event.CHANGE, changeHandler); addChild(radio2); var radio3:RadioButton = new RadioButton(); radio3.label = &quot;Option C&quot;; radio3.move(10, 50); radio3.addEventListener(MouseEvent.CLICK, clickHandler); radio3.addEventListener(Event.CHANGE, changeHandler); addChild(radio3); function clickHandler(event:MouseEvent):void { trace(&quot;click:&quot;, event.currentTarget.label); } function changeHandler(event:Event):void { trace(&quot;change:&quot;, event.currentTarget.label); }"/>
<page href="fl/controls/RadioButton.html#style:disabledIcon" title="RadioButton.disabledIcon" text="disabledIcon Name of the class to use as the icon when the button is not disabled."/>
<page href="fl/controls/RadioButton.html#style:downIcon" title="RadioButton.downIcon" text="downIcon Name of the class to use as the icon when the button is not selected and the mouse button is down."/>
<page href="fl/controls/RadioButton.html#style:icon" title="RadioButton.icon" text="icon Name of the class to use as the icon when a toggle button is not selected and the mouse is not over the button."/>
<page href="fl/controls/RadioButton.html#style:overIcon" title="RadioButton.overIcon" text="overIcon Name of the class to use as the icon when the button is not selected and the mouse is over the component."/>
<page href="fl/controls/RadioButton.html#style:selectedDisabledIcon" title="RadioButton.selectedDisabledIcon" text="selectedDisabledIcon Name of the class to use as the icon when the button is selected and disabled."/>
<page href="fl/controls/RadioButton.html#style:selectedDownIcon" title="RadioButton.selectedDownIcon" text="selectedDownIcon Name of the class to use as the icon when the button is selected and the mouse button is down."/>
<page href="fl/controls/RadioButton.html#style:selectedOverIcon" title="RadioButton.selectedOverIcon" text="selectedOverIcon Name of the class to use as the icon when the button is selected and the mouse is over the component."/>
<page href="fl/controls/RadioButton.html#style:selectedUpIcon" title="RadioButton.selectedUpIcon" text="selectedUpIcon Name of the class to use as the icon when the button is selected and the mouse button is up."/>
<page href="fl/controls/RadioButton.html#style:textPadding" title="RadioButton.textPadding" text="textPadding The spacing between the text and the edges of the component, and the spacing between the text and the icon, in pixels."/>
<page href="fl/controls/RadioButton.html#style:upIcon" title="RadioButton.upIcon" text="upIcon Name of the class to use as the icon when a toggle button is not selected and the mouse is not over the button."/>
<page href="fl/controls/UIScrollBar.html" title="UIScrollBar class" text="UIScrollBar The UIScrollBar class includes all of the scroll bar functionality, but adds a scrollTarget() method so it can be attached to a TextField component instance. Note: When you use ActionScript to update properties of the TextField component that affect the text layout, you must call the update() method on the UIScrollBar component instance to refresh its scroll properties. Examples of text layout properties that belong to the TextField component include width, height, and wordWrap."/>
<page href="fl/controls/UIScrollBar.html#UIScrollBar()" title="UIScrollBar.UIScrollBar()" text="UIScrollBar Creates a new UIScrollBar component instance."/>
<page href="fl/controls/UIScrollBar.html#getStyleDefinition()" title="UIScrollBar.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat());"/>
<page href="fl/controls/UIScrollBar.html#setScrollProperties()" title="UIScrollBar.setScrollProperties()" text="setScrollProperties Sets the range and viewport size of the ScrollBar component. The ScrollBar component updates the state of the arrow buttons and size of the scroll thumb accordingly. All of the scroll properties are relative to the scale of the minScrollPosition and the maxScrollPosition. Each number between the maximum and minumum values represents one scroll position. pageSize minScrollPosition maxScrollPosition pageScrollSize Size of one page. Determines the size of the thumb, and the increment by which the scroll bar moves when the arrows are clicked. Bottom of the scrolling range. Top of the scrolling range. Increment to move when a track is pressed, in pixels."/>
<page href="fl/controls/UIScrollBar.html#update()" title="UIScrollBar.update()" text="update Forces the scroll bar to update its scroll properties immediately. This is necessary after text in the specified scrollTarget text field is added using ActionScript, and the scroll bar needs to be refreshed. The following example creates a UIScrollBar component instance that is used to scroll a dynamic text field: import fl.controls.UIScrollBar; var myTextField:TextField = new TextField(); myTextField.wordWrap = true; myTextField.width = 160; myTextField.height = 120; myTextField.border = true; myTextField.x = 10; myTextField.y = 10; addChild(myTextField); var vScrollBar:UIScrollBar = new UIScrollBar(); vScrollBar.scrollTarget = myTextField; vScrollBar.height = myTextField.height; vScrollBar.move(myTextField.x + myTextField.width, myTextField.y); addChild(vScrollBar); var myURLLoader:URLLoader = new URLLoader(); myURLLoader.addEventListener(Event.COMPLETE, completeHandler); myURLLoader.load(new URLRequest(&quot;http://www.helpexamples.com/flash/lorem.txt&quot;)); function completeHandler(event:Event):void { var txt:String = URLLoader(event.currentTarget).data as String; myTextField.text = txt; vScrollBar.update(); }"/>
<page href="fl/controls/UIScrollBar.html#direction" title="UIScrollBar.direction" text="direction Gets or sets a value that indicates whether the scroll bar scrolls horizontally or vertically. Valid values are ScrollBarDirection.HORIZONTAL and ScrollBarDirection.VERTICAL. The following example dynamically loads some text into a text field and creates a horizontal and vertical scroll bar: import fl.controls.UIScrollBar; import fl.controls.ScrollBarDirection; var url:String = &quot;http://www.helpexamples.com/flash/text/lorem.txt&quot;; var uLdr:URLLoader = new URLLoader(new URLRequest(url)); uLdr.addEventListener(Event.COMPLETE, completeHandler); var tf:TextField = new TextField(); tf.width = 320; tf.height = 140; tf.x = 10; tf.y = 10; tf.border = true; tf.multiline = true; tf.wordWrap = false; addChild(tf) var hScrollBar:UIScrollBar = new UIScrollBar(); hScrollBar.direction = ScrollBarDirection.HORIZONTAL; hScrollBar.move(tf.x, tf.y + tf.height); hScrollBar.width = tf.width; hScrollBar.scrollTarget = tf; addChild(hScrollBar); var vScrollBar:UIScrollBar = new UIScrollBar(); vScrollBar.direction = ScrollBarDirection.VERTICAL; vScrollBar.move(tf.x + tf.width, tf.y); vScrollBar.height = tf.height; vScrollBar.scrollTarget = tf; addChild(vScrollBar); function completeHandler(event:Event):void { tf.text = event.target.data; hScrollBar.update(); vScrollBar.update(); }"/>
<page href="fl/controls/UIScrollBar.html#scrollTarget" title="UIScrollBar.scrollTarget" text="scrollTarget Registers a TextField component instance with the ScrollBar component instance. The following example creates a UIScrollBar and links it to a text field using the scrollTarget property: import fl.controls.UIScrollBar; var url:String = &quot;http://www.helpexamples.com/flash/text/lorem.txt&quot;; var tf:TextField = new TextField(); tf.x = 10; tf.y = 10; tf.width = 500; tf.height = 380; tf.wordWrap = true; addChild(tf); var myScrollBar:UIScrollBar = new UIScrollBar(); myScrollBar.move(tf.x + tf.width, tf.y); myScrollBar.height = tf.height; myScrollBar.scrollTarget = tf; addChild(myScrollBar); var uLdr:URLLoader = new URLLoader(); uLdr.addEventListener(Event.COMPLETE, completeHandler); uLdr.load(new URLRequest(url)); function completeHandler(event:Event):void { tf.text = URLLoader(event.target).data; myScrollBar.update(); }"/>
<page href="fl/controls/Label.html" title="Label class" text="Label A Label component displays one or more lines of plain or HTML-formatted text that can be formatted for alignment and size. Label components do not have borders and cannot receive focus. A live preview of each Label instance reflects the changes that were made to parameters in the Property inspector or Component inspector during authoring. Because a Label component does not have a border, the only way to see the live preview for a Label instance is to set its text property. The autoSize property is not supported in live preview."/>
<page href="fl/controls/Label.html#Label()" title="Label.Label()" text="Label Creates a new Label component instance."/>
<page href="fl/controls/Label.html#getStyleDefinition()" title="Label.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/controls/Label.html#autoSize" title="Label.autoSize" text="autoSize Gets or sets a string that indicates how a label is sized and aligned to fit the value of its text property. The following are valid values: TextFieldAutoSize.NONE: The label is not resized or aligned to fit the text. TextFieldAutoSize.LEFT: The right and bottom sides of the label are resized to fit the text. The left and top sides are not resized. TextFieldAutoSize.CENTER: The left and right sides of the label resize to fit the text. The horizontal center of the label stays anchored at its original horizontal center position. TextFieldAutoSize.RIGHT: The left and bottom sides of the label are resized to fit the text. The top and right sides are not resized. The following example demonstrates the difference between setting autoSize to left, center, or right: import flash.text.TextFieldAutoSize; import fl.controls.Label; var testString:String = &quot;Lorem ipsum dolor sit amet.&quot;; var label1:Label = new Label(); var label2:Label = new Label(); var label3:Label = new Label(); label1.move(10,10); label2.move(10,50); label3.move(10,90); label1.width = stage.stageWidth - 20; label2.width = stage.stageWidth - 20; label3.width = stage.stageWidth - 20; label1.text = testString; label2.text = testString; label3.text = testString; label1.autoSize = TextFieldAutoSize.LEFT; label2.autoSize = TextFieldAutoSize.CENTER; label3.autoSize = TextFieldAutoSize.RIGHT; addChild(label1); addChild(label2); addChild(label3);"/>
<page href="fl/controls/Label.html#condenseWhite" title="Label.condenseWhite" text="condenseWhite Gets or sets a value that indicates whether extra white space such as spaces and line breaks should be removed from a Label component that contains HTML text. A value of true indicates that white space is to be removed; a value of false indicates that it remains. The condenseWhite property affects only text that was set by using the htmlText property, not the text property. If you set text by using the text property, the condenseWhite property is ignored. If you set the condenseWhite property to true, you must use standard HTML commands, such as &lt;br&gt; and &lt;p&gt;, to break the lines of the text in the text field. The following example demonstrates the difference between a label that condenses white space and one that does not: import fl.controls.Label; var testString:String = &quot; Hello World&quot;; var label1:Label = new Label(); label1.move(10,10); label1.htmlText = testString; addChild(label1); var label2:Label = new Label(); label2.move(10,40); label2.condenseWhite = true; label2.htmlText = testString; addChild(label2);"/>
<page href="fl/controls/Label.html#height" title="Label.height" text="height Gets or sets the height of the component, in pixels. Setting this property causes a resize event to be dispatched. See the resize event for detailed information about when it is dispatched. If the scaleY property of the component is not 1.0, the height of the component that is obtained from its internal coordinates will not match the height value from the parent coordinates. For example, a component that is 100 pixels in height and has a scaleY of 2 has a value of 100 pixels in the parent, but internally stores a value indicating that it is 50 pixels in height."/>
<page href="fl/controls/Label.html#htmlText" title="Label.htmlText" text="htmlText Gets or sets the text to be displayed by the Label component, including HTML markup that expresses the styles of that text. You can specify HTML text in this property by using the subset of HTML tags that are supported by the TextField object. If the default value of the text property is changed in the Property inspector, this changed value takes precedence over any value in the htmlText property field in the Property inspector. To use the htmlText property in the Property inspector, the text property field must contain the value Label, exactly as shown. When coding with ActionScript, you do not need to set the value of the text property; the default value is Label."/>
<page href="fl/controls/Label.html#selectable" title="Label.selectable" text="selectable Gets or sets a value that indicates whether the text can be selected. A value of true indicates that it can be selected; a value of false indicates that it cannot. Text that can be selected can be copied from the Label component by the user."/>
<page href="fl/controls/Label.html#text" title="Label.text" text="text Gets or sets the plain text to be displayed by the Label component. Note that characters that represent HTML markup have no special meaning in the string and will appear as they were entered. To display text that contains HTML tags, use the htmlText property. The HTML replaces any text that you set by using the htmlText property, and the text property returns a plain text version of the HTML text, with the HTML tags removed. If the text property is changed from the default value in the property inspector, it takes precedence over the htmlText property in the property inspector."/>
<page href="fl/controls/Label.html#textField" title="Label.textField" text="textField A reference to the internal text field of the Label component."/>
<page href="fl/controls/Label.html#width" title="Label.width" text="width Gets or sets the width of the component, in pixels. Setting this property causes a resize event to be dispatched. See the resize event for detailed information about when it is dispatched. If the scaleX property of the component is not 1.0, the width of the component that is obtained from its internal coordinates will not match the width value from the parent coordinates. For example, a component that is 100 pixels in width and has a scaleX of 2 has a value of 100 pixels in the parent, but internally stores a value indicating that it is 50 pixels wide."/>
<page href="fl/controls/Label.html#wordWrap" title="Label.wordWrap" text="wordWrap Gets or sets a value that indicates whether the text field supports word wrapping. A value of true indicates that it does; a value of false indicates that it does not. The following example creates a multiline Label component instance and sets its text property to the contents of an external text file: import fl.controls.Label; var url:String = &quot;http://www.helpexamples.com/flash/text/lorem.txt&quot;; myLabel.autoSize = TextFieldAutoSize.LEFT; myLabel.width = 530; myLabel.move(10, 10); myLabel.wordWrap = true; var ldr:URLLoader = new URLLoader(); ldr.addEventListener(Event.COMPLETE, completeHandler); ldr.load(new URLRequest(url)); function completeHandler(event:Event):void { myLabel.text = URLLoader(event.currentTarget).data; }"/>
<page href="fl/controls/Label.html#event:resize" title="Label.resize" text="resize Dispatched after there is a change in the width or height of the component. Note: This event does not occur if you use ActionScript code to change the label text. The following example creates a new Label instance and listens for the resize event: import fl.controls.Label; import fl.events.ComponentEvent; var myLabel:Label = new Label(); myLabel.text = &quot;The quick brown fox jumped over the lazy dog.&quot;; myLabel.autoSize = TextFieldAutoSize.LEFT; myLabel.wordWrap = true; myLabel.move(10, 10); myLabel.addEventListener(ComponentEvent.RESIZE, resizeHandler); addChild(myLabel); function resizeHandler(event:ComponentEvent):void { var lbl:Label = event.currentTarget as Label; trace(&quot;width:&quot; + lbl.width, &quot;height:&quot; + lbl.height); // width:100 height:46 }"/>
<page href="fl/controls/Label.html#style:embedFonts" title="Label.embedFonts" text="embedFonts Indicates whether embedded font outlines are used to render the text field. If this value is true, Flash Player renders the text field by using embedded font outlines. If this value is false, Flash Player renders the text field by using device fonts. If you set the embedFonts property to true for a text field, you must specify a font for that text by using the font property of a TextFormat object that is applied to the text field. If the specified font is not embedded in the SWF file, the text is not displayed."/>
<page href="fl/controls/List.html" title="List class" text="List The List component displays list-based information and is ideally suited for the display of arrays of information. The List component consists of items, rows, and a data provider, which are described as follows: Item: An ActionScript object that usually contains a descriptive label property and a data property that stores the data associated with that item. Row: A component that is used to display the item. Data provider: A component that models the items that the List component displays. By default, the List component uses the CellRenderer class to supply the rows in which list items are displayed. You can create these rows programmatically; this is usually done by subclassing the CellRenderer class. The CellRenderer class implements the ICellRenderer interface, which provides the set of properties and methods that the List component uses to manipulate its rows and to send data and state information to each row for display. This includes information about data sizing and selection. The List component provides methods that act on its data provider--for example, the addItem() and removeItem() methods. You can use these and other methods to manipulate the data of any array that exists in the same frame as a List component and then broadcast the changes to multiple views. If a List component is not provided with an external data provider, these methods automatically create an instance of a data provider and expose it through the List.dataProvider property. The List component renders each row by using a Sprite that implements the ICellRenderer interface. To specify this renderer, use the List.cellRenderer property. You can also build an Array instance or get one from a server and use it as a data model for multiple lists, combo boxes, data grids, and so on."/>
<page href="fl/controls/List.html#List()" title="List.List()" text="List Creates a new List component instance."/>
<page href="fl/controls/List.html#getStyleDefinition()" title="List.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/controls/List.html#itemToLabel()" title="List.itemToLabel()" text="itemToLabel Retrieves the string that the renderer displays for the given data object based on the labelField and labelFunction properties. Note: The labelField is not used if the labelFunction property is set to a callback function. item The object to be rendered. The following example demonstrates how to determine the label of a list item when the mouse hovers over it: import fl.controls.List; import fl.data.DataProvider; import fl.events.ListEvent; var myDataProvider:DataProvider = new DataProvider(); myDataProvider.addItem({label:&quot;Carrot&quot;, price:0.43}); myDataProvider.addItem({label:&quot;Tomato&quot;, price:0.34}); myDataProvider.addItem({label:&quot;Blueberry&quot;, price:0.72}); myDataProvider.addItem({label:&quot;Turnip&quot;, price:0.24}); var myList:List = new List(); myList.setSize(300,80); myList.dataProvider = myDataProvider; myList.labelFunction = myLabelFunction; myList.addEventListener(ListEvent.ITEM_ROLL_OVER, announceLabel); addChild(myList); function myLabelFunction(item:Object):String { return item.label + &quot; - Current price: ($&quot; + item.price.toFixed(2) + &quot;)&quot;; } function announceLabel(e:ListEvent):void { var list:List = e.target as List; var item:Object = e.item; trace(&quot;Label: &quot; + item.label); trace(&quot;Label displayed: &quot; + list.itemToLabel(item)); }"/>
<page href="fl/controls/List.html#scrollToIndex()" title="List.scrollToIndex()" text="scrollToIndex Scrolls the list to the item at the specified index. If the index is out of range, the scroll position does not change. newCaretIndex The index location to scroll to."/>
<page href="fl/controls/List.html#iconField" title="List.iconField" text="iconField Gets or sets the item field that provides the icon for the item. Note: The iconField is not used if the iconFunction property is set to a callback function. The following example creates a list with an icon for each item. A symbol named RedBox must exist in the library and have &quot;Export for ActionScript&quot; toggled in its symbol properties: import fl.data.DataProvider; import fl.controls.List; var dp:DataProvider = new DataProvider(); dp.addItem( { iconSource:RedBox, label:&quot;Item 1&quot; } ); dp.addItem( { iconSource:RedBox, label:&quot;Item 2&quot; } ); dp.addItem( { iconSource:RedBox, label:&quot;Item 3&quot; } ); var list:List = new List(); list.iconField = &quot;iconSource&quot;; list.dataProvider = dp; addChild(list);"/>
<page href="fl/controls/List.html#iconFunction" title="List.iconFunction" text="iconFunction Gets or sets the function to be used to obtain the icon for the item. Note: The iconField is not used if the iconFunction property is set to a callback function. The following example uses the iconFunction property to provide an icon to a limited number of items in a list. A symbol named RedBox must exist in the library and have &quot;Export for ActionScript&quot; toggled in its symbol properties for this example to function correctly: import fl.data.DataProvider; import fl.controls.List; var dp:DataProvider = new DataProvider(); dp.addItem( { label:&quot;Item 1&quot; } ); dp.addItem( { label:&quot;Item 2&quot; } ); dp.addItem( { label:&quot;Item 3&quot; } ); var list:List = new List(); list.iconFunction = determineIcon; list.dataProvider = dp; addChild(list); function determineIcon(item:Object):String { if(item.label == &quot;Item 2&quot;) { return &quot;RedBox&quot;; } else { return null; } }"/>
<page href="fl/controls/List.html#labelField" title="List.labelField" text="labelField Gets or sets the name of the field in the dataProvider object to be displayed as the label for the TextInput field and drop-down list. By default, the component displays the label property of each dataProvider item. If the dataProvider items do not contain a label property, you can set the labelField property to use a different property. Note: The labelField property is not used if the labelFunction property is set to a callback function. The following example displays each item in a list with the abbreviatedLabel property rather than the default label property: import fl.data.DataProvider; import fl.controls.List; var dp:DataProvider = new DataProvider(); dp.addItem( { abbreviatedLabel:&quot;NY&quot;, label:&quot;New York&quot; } ); dp.addItem( { abbreviatedLabel:&quot;CA&quot;, label:&quot;California&quot; } ); dp.addItem( { abbreviatedLabel:&quot;WA&quot;, label:&quot;Washington&quot; } ); dp.addItem( { abbreviatedLabel:&quot;CT&quot;, label:&quot;Connecticut&quot; } ); dp.addItem( { abbreviatedLabel:&quot;VT&quot;, label:&quot;Vermont&quot; } ); var list:List = new List(); list.setSize(40,100); list.labelField = &quot;abbreviatedLabel&quot; list.dataProvider = dp; addChild(list);"/>
<page href="fl/controls/List.html#labelFunction" title="List.labelFunction" text="labelFunction Gets or sets the function to be used to obtain the label for the item. By default, the component displays the label property for a dataProvider item. But some data sets may not have a label field or may not have a field whose value can be used as a label without modification. For example, a given data set might store full names but maintain them in lastName and firstName fields. In such a case, this property could be used to set a callback function that concatenates the values of the lastName and firstName fields into a full name string to be displayed. Note: The labelField property is not used if the labelFunction property is set to a callback function. This example sets the labelFunction property of a list to a function that formats the string to be displayed in each cell: import fl.data.DataProvider; import fl.controls.List; var myDataProvider:DataProvider = new DataProvider(); myDataProvider.addItem({name:&quot;User A&quot;, price:0.43}); myDataProvider.addItem({name:&quot;User B&quot;, price:0.34}); var users:List = new List(); users.dataProvider = myDataProvider; users.labelFunction = myLabelFunction; addChild(users); function myLabelFunction(item:Object):String { return item.name + &quot; ($&quot; + item.price.toFixed(2) + &quot;)&quot;; }"/>
<page href="fl/controls/List.html#rowCount" title="List.rowCount" text="rowCount Gets or sets the number of rows that are at least partially visible in the list. This example sets the size of a list and determines the number of potentially visible rows by tracing the rowCount property: import fl.data.DataProvider; import fl.controls.List; var dp:DataProvider = new DataProvider(); var i:uint; for(i=0; i&lt;100; i++) { dp.addItem( { label: &quot;Item &quot; + i } ); } var list:List = new List(); list.setSize(100,300); list.dataProvider = dp; addChild(list); trace(list.rowCount); // 15"/>
<page href="fl/controls/List.html#rowHeight" title="List.rowHeight" text="rowHeight Gets or sets the height of each row in the list, in pixels."/>
<page href="fl/controls/ScrollBarDirection.html" title="ScrollBarDirection class" text="ScrollBarDirection Defines the values for the direction property of the ScrollBar component."/>
<page href="fl/controls/ScrollBarDirection.html#HORIZONTAL" title="ScrollBarDirection.HORIZONTAL" text="HORIZONTAL Indicates that the ScrollBar component instance is used for horizontal scrolling."/>
<page href="fl/controls/ScrollBarDirection.html#VERTICAL" title="ScrollBarDirection.VERTICAL" text="VERTICAL Indicates that the ScrollBar component instance is used for vertical scrolling."/>
<page href="fl/controls/SliderDirection.html" title="SliderDirection class" text="SliderDirection The orientation of the Slider component."/>
<page href="fl/controls/SliderDirection.html#HORIZONTAL" title="SliderDirection.HORIZONTAL" text="HORIZONTAL Position the Slider component on the horizontal axis. The following example creates a horizontal slider: import fl.controls.Slider; import fl.controls.SliderDirection; var hSlider:Slider = new Slider(); hSlider.direction = SliderDirection.HORIZONTAL; hSlider.snapInterval = 1; hSlider.tickInterval = hSlider.snapInterval; hSlider.move(10, 10); addChild(hSlider);"/>
<page href="fl/controls/SliderDirection.html#VERTICAL" title="SliderDirection.VERTICAL" text="VERTICAL Position the Slider component on the vertical axis. The following example creates a vertical slider: import fl.controls.Slider; import fl.controls.SliderDirection; var vSlider:Slider = new Slider(); vSlider.direction = SliderDirection.VERTICAL; vSlider.snapInterval = 1; vSlider.tickInterval = vSlider.snapInterval; vSlider.move(30, 100); addChild(vSlider);"/>
<page href="fl/controls/SelectableList.html" title="SelectableList class" text="SelectableList The SelectableList is the base class for all list-based components--for example, the List, TileList, DataGrid, and ComboBox components. This class provides methods and properties that are used for the rendering and layout of rows, and to set scroll bar styles and data providers. Note: This class does not create a component; it is exposed only so that it can be extended."/>
<page href="fl/controls/SelectableList.html#SelectableList()" title="SelectableList.SelectableList()" text="SelectableList Creates a new SelectableList instance."/>
<page href="fl/controls/SelectableList.html#addItem()" title="SelectableList.addItem()" text="addItem Appends an item to the end of the list of items. An item should contain label and data properties; however, items that contain other properties can also be added to the list. By default, the label property of an item is used to display the label of the row; the data property is used to store the data of the row. item The item to be added to the data provider."/>
<page href="fl/controls/SelectableList.html#addItemAt()" title="SelectableList.addItemAt()" text="addItemAt Inserts an item into the list at the specified index location. The indices of items at or after the specified index location are incremented by 1. item index The item to be added to the list. The index at which to add the item. The specified index is less than 0 or greater than or equal to the length of the data provider."/>
<page href="fl/controls/SelectableList.html#clearRendererStyle()" title="SelectableList.clearRendererStyle()" text="clearRendererStyle Clears a style that is set on the renderers in the list. name column The name of the style to be cleared."/>
<page href="fl/controls/SelectableList.html#clearSelection()" title="SelectableList.clearSelection()" text="clearSelection Clears the currently selected item in the list and sets the selectedIndex property to -1. The following example creates a List component instance and clears the currently selected list items when a Button component is clicked: import fl.controls.Button; import fl.controls.List; import fl.data.DataProvider; var data:XML = &lt;items&gt; &lt;item label=&quot;Person A&quot; id=&quot;p001&quot; /&gt; &lt;item label=&quot;Person B&quot; id=&quot;p002&quot; /&gt; &lt;item label=&quot;Person C&quot; id=&quot;p003&quot; /&gt; &lt;/items&gt;; var dp:DataProvider = new DataProvider(data); var myList:List = new List(); myList.allowMultipleSelection = false; myList.dataProvider = dp; myList.move(10, 10); myList.selectedIndex = 0; addChild(myList); var clearButton:Button = new Button(); clearButton.label = &quot;Clear selection&quot;; clearButton.move(120, 10); clearButton.addEventListener(MouseEvent.CLICK, clickHandler); addChild(clearButton); function clickHandler(event:MouseEvent):void { trace(&quot;selectedIndex (before):&quot;, myList.selectedIndex); myList.clearSelection(); trace(&quot;selectedIndex (after):&quot;, myList.selectedIndex); }"/>
<page href="fl/controls/SelectableList.html#getItemAt()" title="SelectableList.getItemAt()" text="getItemAt Retrieves the item at the specified index. index The index of the item to be retrieved. The specified index is less than 0 or greater than or equal to the length of the data provider."/>
<page href="fl/controls/SelectableList.html#getNextIndexAtLetter()" title="SelectableList.getNextIndexAtLetter()" text="getNextIndexAtLetter Returns the index of the next item in the dataProvider in which the label's first character matches a specified string character. If the search reaches the end of the dataProvider without searching all the items, it will loop back to the start. The search does not include the startIndex. firstLetter startIndex The string character to search for The index in the dataProvider to start at."/>
<page href="fl/controls/SelectableList.html#getRendererStyle()" title="SelectableList.getRendererStyle()" text="getRendererStyle Retrieves a style that is set on the renderers in the list. name column The name of the style to be retrieved. The value of the style to be retrieved."/>
<page href="fl/controls/SelectableList.html#getStyleDefinition()" title="SelectableList.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/controls/SelectableList.html#invalidateItem()" title="SelectableList.invalidateItem()" text="invalidateItem Invalidates a specific item renderer. item The item in the data provider to invalidate."/>
<page href="fl/controls/SelectableList.html#invalidateItemAt()" title="SelectableList.invalidateItemAt()" text="invalidateItemAt Invalidates the renderer for the item at the specified index. index The index of the item in the data provider to invalidate."/>
<page href="fl/controls/SelectableList.html#invalidateList()" title="SelectableList.invalidateList()" text="invalidateList Invalidates the whole list, forcing the list items to be redrawn."/>
<page href="fl/controls/SelectableList.html#isItemSelected()" title="SelectableList.isItemSelected()" text="isItemSelected Checks whether the specified item is selected in the list. item The item to check."/>
<page href="fl/controls/SelectableList.html#itemToCellRenderer()" title="SelectableList.itemToCellRenderer()" text="itemToCellRenderer Retrieves the ICellRenderer for a given item object, if there is one. This method always returns null. item The item in the data provider. The following example demonstrates how to acquire the cell renderer for an item that is selected within a list: import fl.controls.List; import fl.controls.listClasses.ListData; import fl.controls.listClasses.CellRenderer; import fl.events.ListEvent; var sampleItem1:Object = { label:&quot;John Alpha&quot; }; var sampleItem2:Object = { label:&quot;Mary Bravo&quot; }; var sampleItem3:Object = { label:&quot;Trevor Gamma&quot; }; var sampleItem4:Object = { label:&quot;Susan Delta&quot; }; var myList:List; myList = new List(); myList.move(10,10); myList.addItem(sampleItem1); myList.addItem(sampleItem2); myList.addItem(sampleItem3); myList.addItem(sampleItem4); myList.addEventListener(ListEvent.ITEM_CLICK, listItemSelected); addChild(myList); function listItemSelected(e:ListEvent):void { var cr:CellRenderer = myList.itemToCellRenderer(e.item) as CellRenderer; var listData:ListData = cr.listData; trace(&quot;You have selected row: &quot; + listData.row); }"/>
<page href="fl/controls/SelectableList.html#itemToLabel()" title="SelectableList.itemToLabel()" text="itemToLabel Retrieves the string that the renderer displays for the given data object based on the label properties of the object. This method is intended to be overwritten in sub-components. For example, List has a labelField and a labelFunction to derive the label. item"/>
<page href="fl/controls/SelectableList.html#removeAll()" title="SelectableList.removeAll()" text="removeAll Removes all items from the list."/>
<page href="fl/controls/SelectableList.html#removeItem()" title="SelectableList.removeItem()" text="removeItem Removes the specified item from the list. item The item to be removed. The item could not be found."/>
<page href="fl/controls/SelectableList.html#removeItemAt()" title="SelectableList.removeItemAt()" text="removeItemAt Removes the item at the specified index position. The indices of items after the specified index location are decremented by 1. index The index of the item in the data provider to be removed."/>
<page href="fl/controls/SelectableList.html#replaceItemAt()" title="SelectableList.replaceItemAt()" text="replaceItemAt Replaces the item at the specified index location with another item. This method modifies the data provider of the List component. If the data provider is shared with other components, the data that is provided to those components is also updated. item index The item to replace the item at the specified index location. The index position of the item to be replaced. The specified index is less than 0 or greater than or equal to the length of the data provider."/>
<page href="fl/controls/SelectableList.html#scrollToIndex()" title="SelectableList.scrollToIndex()" text="scrollToIndex Scrolls the list to the item at the specified index. If the index is out of range, the scroll position does not change. newCaretIndex The index location to scroll to."/>
<page href="fl/controls/SelectableList.html#scrollToSelected()" title="SelectableList.scrollToSelected()" text="scrollToSelected Scrolls the list to the item at the location indicated by the current value of the selectedIndex property."/>
<page href="fl/controls/SelectableList.html#setRendererStyle()" title="SelectableList.setRendererStyle()" text="setRendererStyle Sets a style on the renderers in the list. name style column The name of the style to be set. The value of the style to be set. The following example creates a List component and uses the setRendererStyle() method to apply a text format to the list items: import fl.controls.List; var myTextFormat:TextFormat = new TextFormat(); myTextFormat.font = &quot;Comic Sans MS&quot;; var myList:List = new List(); myList.addItem({label:&quot;The quick brown fox...&quot;}); myList.addItem({label:&quot;The quick brown fox...&quot;}); myList.addItem({label:&quot;The quick brown fox...&quot;}); myList.addItem({label:&quot;The quick brown fox...&quot;}); myList.addItem({label:&quot;The quick brown fox...&quot;}); myList.addItem({label:&quot;The quick brown fox...&quot;}); myList.setRendererStyle(&quot;textFormat&quot;, myTextFormat); myList.width = 150; myList.move(10, 10); addChild(myList);"/>
<page href="fl/controls/SelectableList.html#sortItems()" title="SelectableList.sortItems()" text="sortItems Sorts the elements of the current data provider. This method performs a sort based on the Unicode values of the elements. ASCII is a subset of Unicode. sortArgs The arguments against which to sort."/>
<page href="fl/controls/SelectableList.html#sortItemsOn()" title="SelectableList.sortItemsOn()" text="sortItemsOn Sorts the elements of the current data provider by one or more of its fields. field options The field on which to sort. Sort arguments that are used to override the default sort behavior. Separate two or more arguments with the bitwise OR (|) operator. The following example sorts a list based on a value in the data provider using the sortItemsOn() method: import fl.controls.List; import fl.data.DataProvider; var players:XML = &lt;players&gt; &lt;player name=&quot;Player Q&quot; avg=&quot;0.237&quot; /&gt; &lt;player name=&quot;Player W&quot; avg=&quot;0.352&quot; /&gt; &lt;player name=&quot;Player E&quot; avg=&quot;0.268&quot; /&gt; &lt;player name=&quot;Player R&quot; avg=&quot;0.311&quot; /&gt; &lt;player name=&quot;Player T&quot; avg=&quot;0.293&quot; /&gt; &lt;player name=&quot;Player Y&quot; avg=&quot;0.33&quot; /&gt; &lt;/players&gt;; var dp:DataProvider = new DataProvider(players); var playerList:List = new List(); playerList.labelFunction = myLabelFunction; playerList.dataProvider = dp; playerList.sortItemsOn(&quot;avg&quot;, Array.NUMERIC | Array.DESCENDING); playerList.move(10, 10); playerList.setSize(160, 120); addChild(playerList); function myLabelFunction(item:Object):String { return item.name + &quot; (&quot; + Number(item.avg).toFixed(3) + &quot;)&quot;; }"/>
<page href="fl/controls/SelectableList.html#allowMultipleSelection" title="SelectableList.allowMultipleSelection" text="allowMultipleSelection Gets a Boolean value that indicates whether more than one list item can be selected at a time. A value of true indicates that multiple selections can be made at one time; a value of false indicates that only one item can be selected at one time. The following example creates a new List instance and traces the selectedIndex and selectedIndices properties when the selected items in the list change: import fl.controls.List; import fl.data.DataProvider; var items:XML = &lt;items&gt; &lt;item label=&quot;Item A&quot; /&gt; &lt;item label=&quot;Item B&quot; /&gt; &lt;item label=&quot;Item C&quot; /&gt; &lt;/items&gt;; var dp:DataProvider = new DataProvider(items); var myList:List = new List(); myList.dataProvider = dp; myList.allowMultipleSelection = true; myList.move(10, 10); myList.setSize(320, 240); myList.addEventListener(Event.CHANGE, changeHandler); addChild(myList); function changeHandler(event:Event):void { var lst:List = event.currentTarget as List; trace(&quot;change:&quot;); trace(&quot;\t&quot; + &quot;selectedIndex:&quot;, lst.selectedIndex); trace(&quot;\t&quot; + &quot;selectedIndices:&quot;, lst.selectedIndices); trace(&quot;\t&quot; + &quot;Number selected items:&quot;, lst.selectedIndices.length); }"/>
<page href="fl/controls/SelectableList.html#dataProvider" title="SelectableList.dataProvider" text="dataProvider Gets or sets the data model of the list of items to be viewed. A data provider can be shared by multiple list-based components. Changes to the data provider are immediately available to all components that use it as a data source."/>
<page href="fl/controls/SelectableList.html#length" title="SelectableList.length" text="length Gets the number of items in the data provider. The following example creates a List component instance and sets the rowCount property to the current number of items in the list: import fl.controls.List; var myList:List = new List(); myList.addItem({label:&quot;Item A&quot;}); myList.addItem({label:&quot;Item B&quot;}); myList.addItem({label:&quot;Item C&quot;}); myList.addItem({label:&quot;Item D&quot;}); myList.rowCount = myList.length; myList.move(10, 10); addChild(myList);"/>
<page href="fl/controls/SelectableList.html#maxHorizontalScrollPosition" title="SelectableList.maxHorizontalScrollPosition" text="maxHorizontalScrollPosition Gets or sets the number of pixels that the list scrolls to the right when the horizontalScrollPolicy property is set to ScrollPolicy.ON."/>
<page href="fl/controls/SelectableList.html#rowCount" title="SelectableList.rowCount" text="rowCount Gets the number of rows that are at least partially visible in the list. Note: This property must be overridden in any class that extends SelectableList. This example sets the size of a list and determines the number of potentially visible rows by tracing the rowCount property: import fl.data.DataProvider; import fl.controls.List; var dp:DataProvider = new DataProvider(); var i:uint; for(i=0; i&lt;100; i++) { dp.addItem( { label: &quot;Item &quot; + i } ); } var list:List = new List(); list.setSize(100,300); list.dataProvider = dp; addChild(list); trace(list.rowCount); // 15"/>
<page href="fl/controls/SelectableList.html#selectable" title="SelectableList.selectable" text="selectable Gets or sets a Boolean value that indicates whether the items in the list can be selected. A value of true indicates that the list items can be selected; a value of false indicates that they cannot be."/>
<page href="fl/controls/SelectableList.html#selectedIndex" title="SelectableList.selectedIndex" text="selectedIndex Gets or sets the index of the item that is selected in a single-selection list. A single-selection list is a list in which only one item can be selected at a time. A value of -1 indicates that no item is selected; if multiple selections are made, this value is equal to the index of the item that was selected last in the group of selected items. When ActionScript is used to set this property, the item at the specified index replaces the current selection. When the selection is changed programmatically, a change event object is not dispatched. This example traces the label and row index of any item in a list that was clicked: import fl.controls.List; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); var i:uint; for (i = 0; i &lt; 5; i++) { dp.addItem( { label: &quot;Sample Name&quot;} ); } var list:List = new List(); list.dataProvider = dp; list.addEventListener(Event.CHANGE,announceClickedItem) addChild(list); function announceClickedItem(e:Event):void { trace(&quot;You have clicked: &quot; + list.selectedItem.label + &quot; in row &quot; + list.selectedIndex); }"/>
<page href="fl/controls/SelectableList.html#selectedIndices" title="SelectableList.selectedIndices" text="selectedIndices Gets or sets an array that contains the items that were selected from a multiple-selection list. To replace the current selection programmatically, you can make an explicit assignment to this property. You can clear the current selection by setting this property to an empty array or to a value of undefined. If no items are selected from the list of items, this property is undefined. The sequence of values in the array reflects the order in which the items were selected from the multiple-selection list. For example, if you click the second item from the list, then the third item, and finally the first item, this property contains an array of values in the following sequence: [1,2,0]."/>
<page href="fl/controls/SelectableList.html#selectedItem" title="SelectableList.selectedItem" text="selectedItem Gets or sets the item that was selected from a single-selection list. For a multiple-selection list in which multiple items are selected, this property contains the item that was selected last. If no selection is made, the value of this property is null. This example traces the label and row index of any item in a list that was clicked: import fl.controls.List; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); var i:uint; for (i = 0; i &lt; 5; i++) { dp.addItem( { label: &quot;Sample Name&quot;} ); } var list:List = new List(); list.dataProvider = dp; list.addEventListener(Event.CHANGE,announceClickedItem) addChild(list); function announceClickedItem(e:Event):void { trace(&quot;You have clicked: &quot; + list.selectedItem.label + &quot; in row &quot; + list.selectedIndex); }"/>
<page href="fl/controls/SelectableList.html#selectedItems" title="SelectableList.selectedItems" text="selectedItems Gets or sets an array that contains the objects for the items that were selected from the multiple-selection list. For a single-selection list, the value of this property is an array containing the one selected item. In a single-selection list, the allowMultipleSelection property is set to false. The following example creates to List component instances and copies the selected items from list A to list B: import fl.controls.List; import fl.data.DataProvider; var listA:List = new List(); listA.allowMultipleSelection = true; listA.addItem({label:&quot;Item A&quot;}); listA.addItem({label:&quot;Item B&quot;}); listA.addItem({label:&quot;Item C&quot;}); listA.addItem({label:&quot;Item D&quot;}); listA.addItem({label:&quot;Item E&quot;}); listA.addItem({label:&quot;Item F&quot;}); listA.addItem({label:&quot;Item G&quot;}); listA.move(10, 10); listA.addEventListener(Event.CHANGE, changeHandler); addChild(listA); var listB:List = new List(); listB.selectable = false; listB.move(120, 10); addChild(listB); function changeHandler(event:Event):void { if (listA.selectedItems.length &gt; 0) { listB.dataProvider = new DataProvider(listA.selectedItems); } }"/>
<page href="fl/controls/SelectableList.html#event:change" title="SelectableList.change" text="change Dispatched when a different item is selected in the list."/>
<page href="fl/controls/SelectableList.html#event:itemClick" title="SelectableList.itemClick" text="itemClick Dispatched when the user clicks an item in the component. The click event is dispatched before the value of the component is changed. To identify the row and column that were clicked, use the properties of the event object; do not use the selectedIndex and selectedItem properties."/>
<page href="fl/controls/SelectableList.html#event:itemDoubleClick" title="SelectableList.itemDoubleClick" text="itemDoubleClick Dispatched when the user clicks an item in the component twice in rapid succession. Unlike the click event, the doubleClick event is dispatched after the selectedIndex of the component is changed."/>
<page href="fl/controls/SelectableList.html#event:itemRollOut" title="SelectableList.itemRollOut" text="itemRollOut Dispatched when the user rolls the pointer off of an item in the component."/>
<page href="fl/controls/SelectableList.html#event:itemRollOver" title="SelectableList.itemRollOver" text="itemRollOver Dispatched when the user rolls the pointer over an item in the component."/>
<page href="fl/controls/SelectableList.html#event:rollOut" title="SelectableList.rollOut" text="rollOut Dispatched when the user rolls the pointer off of the component."/>
<page href="fl/controls/SelectableList.html#event:rollOver" title="SelectableList.rollOver" text="rollOver Dispatched when the user rolls the pointer over the component."/>
<page href="fl/controls/SelectableList.html#event:scroll" title="SelectableList.scroll" text="scroll Dispatched when the user scrolls horizontally or vertically."/>
<page href="fl/controls/SelectableList.html#style:cellRenderer" title="SelectableList.cellRenderer" text="cellRenderer The class that provides the cell renderer for each item in the component."/>
<page href="fl/controls/SelectableList.html#style:contentPadding" title="SelectableList.contentPadding" text="contentPadding The padding that separates the border of the list from its contents, in pixels."/>
<page href="fl/controls/SelectableList.html#style:disabledAlpha" title="SelectableList.disabledAlpha" text="disabledAlpha The alpha value to set the list to when the enabled property is false."/>
<page href="fl/controls/SelectableList.html#style:skin" title="SelectableList.skin" text="skin The class that provides the skin for the background of the component."/>
<page href="fl/controls/RadioButtonGroup.html" title="RadioButtonGroup class" text="RadioButtonGroup The RadioButtonGroup class defines a group of RadioButton components to act as a single component. When one radio button is selected, no other radio buttons from the same group can be selected."/>
<page href="fl/controls/RadioButtonGroup.html#RadioButtonGroup()" title="RadioButtonGroup.RadioButtonGroup()" text="RadioButtonGroup Creates a new RadioButtonGroup instance. This is usually done automatically when a radio button is instantiated. name The name of the radio button group."/>
<page href="fl/controls/RadioButtonGroup.html#addRadioButton()" title="RadioButtonGroup.addRadioButton()" text="addRadioButton Adds a radio button to the internal radio button array for use with radio button group indexing, which allows for the selection of a single radio button in a group of radio buttons. This method is used automatically by radio buttons, but can also be manually used to explicitly add a radio button to a group. radioButton The RadioButton instance to be added to the current radio button group."/>
<page href="fl/controls/RadioButtonGroup.html#getGroup()" title="RadioButtonGroup.getGroup()" text="getGroup Retrieves a reference to the specified radio button group. name The name of the group for which to retrieve a reference. The following example demonstrates how to determine which radio button in a group is selected: import fl.controls.RadioButton; import fl.controls.RadioButtonGroup; var rbg1:RadioButtonGroup = new RadioButtonGroup(&quot;group1&quot;); var rb1:RadioButton = new RadioButton(); rb1.label = &quot;Choice A&quot;; rb1.group = rbg1; rb1.move(10, 10); rb1.addEventListener(MouseEvent.CLICK, announceCurrentGroup); addChild(rb1); var rb2:RadioButton = new RadioButton(); rb2.label = &quot;Choice B&quot;; rb2.group = rbg1; rb2.move(10, 30); rb2.addEventListener(MouseEvent.CLICK, announceCurrentGroup); addChild(rb2); function announceCurrentGroup(e:MouseEvent):void { var group:RadioButtonGroup = RadioButtonGroup.getGroup(&quot;group1&quot;); trace(&quot;The currently selected radio button is: &quot; + group.selection.label); }"/>
<page href="fl/controls/RadioButtonGroup.html#getRadioButtonAt()" title="RadioButtonGroup.getRadioButtonAt()" text="getRadioButtonAt Retrieves the RadioButton component at the specified index location. index The index of the RadioButton component in the RadioButtonGroup component, where the index of the first component is 0. The specified index is less than 0 or greater than or equal to the length of the data provider."/>
<page href="fl/controls/RadioButtonGroup.html#getRadioButtonIndex()" title="RadioButtonGroup.getRadioButtonIndex()" text="getRadioButtonIndex Returns the index of the specified RadioButton instance. radioButton The RadioButton instance to locate in the current RadioButtonGroup."/>
<page href="fl/controls/RadioButtonGroup.html#removeRadioButton()" title="RadioButtonGroup.removeRadioButton()" text="removeRadioButton Clears the RadioButton instance from the internal list of radio buttons. radioButton The RadioButton instance to remove."/>
<page href="fl/controls/RadioButtonGroup.html#name" title="RadioButtonGroup.name" text="name Gets the instance name of the radio button."/>
<page href="fl/controls/RadioButtonGroup.html#numRadioButtons" title="RadioButtonGroup.numRadioButtons" text="numRadioButtons Gets the number of radio buttons in this radio button group."/>
<page href="fl/controls/RadioButtonGroup.html#selectedData" title="RadioButtonGroup.selectedData" text="selectedData Gets or sets the selected radio button's value property. If no radio button is currently selected, this property is null. The following example creates a new RadioButtonGroup and listens for its change event: import fl.controls.RadioButton; import fl.controls.RadioButtonGroup; var myRadioGroup:RadioButtonGroup = new RadioButtonGroup(&quot;options&quot;); myRadioGroup.addEventListener(Event.CHANGE, changeHandler); var radio1:RadioButton = new RadioButton(); radio1.label = &quot;Option A&quot;; radio1.value = &quot;optionA&quot;; radio1.group = myRadioGroup; radio1.move(10, 10); addChild(radio1); var radio2:RadioButton = new RadioButton(); radio2.label = &quot;Option B&quot;; radio2.value = &quot;optionB&quot;; radio2.group = myRadioGroup; radio2.move(10, 30); addChild(radio2); var radio3:RadioButton = new RadioButton(); radio3.label = &quot;Option C&quot;; radio3.value = &quot;optionC&quot;; radio3.group = myRadioGroup; radio3.move(10, 50); addChild(radio3); function changeHandler(event:Event):void { var rbg:RadioButtonGroup = event.target as RadioButtonGroup; if (rbg.selectedData != null) { trace(rbg.selectedData); } else { trace(&quot;no value specified.&quot;); } }"/>
<page href="fl/controls/RadioButtonGroup.html#selection" title="RadioButtonGroup.selection" text="selection Gets or sets a reference to the radio button that is currently selected from the radio button group. The following example creates a new radio button group that contains two radio buttons. When the currently selected radio button changes, the selected radio button's label and value are traced: import fl.controls.RadioButton; import fl.controls.RadioButtonGroup; var radioGroup:RadioButtonGroup = new RadioButtonGroup(&quot;rbg&quot;); radioGroup.addEventListener(Event.CHANGE, changeHandler); var radio1:RadioButton = new RadioButton(); radio1.group = radioGroup; radio1.label = &quot;Option A&quot;; radio1.value = 1; radio1.move(10, 10); addChild(radio1); var radio2:RadioButton = new RadioButton(); radio2.group = radioGroup; radio2.label = &quot;Option B&quot;; radio2.value = 2; radio2.move(10, 30); addChild(radio2); function changeHandler(event:Event):void { var rg:RadioButtonGroup = event.currentTarget as RadioButtonGroup; trace(&quot;change:&quot;, rg.selection.label, &quot;(&quot; + rg.selectedData + &quot;)&quot;); }"/>
<page href="fl/controls/RadioButtonGroup.html#event:change" title="RadioButtonGroup.change" text="change Dispatched when the selected RadioButton instance in a group changes. The following example creates three radio buttons and adds an event listener for a radio button group's change event: import fl.controls.RadioButton; import fl.controls.RadioButtonGroup; var myRadioGroup:RadioButtonGroup = new RadioButtonGroup(&quot;options&quot;); myRadioGroup.addEventListener(Event.CHANGE, changeHandler); var radio1:RadioButton = new RadioButton(); radio1.label = &quot;Option A&quot;; radio1.group = myRadioGroup; radio1.move(10, 10); addChild(radio1); var radio2:RadioButton = new RadioButton(); radio2.label = &quot;Option B&quot;; radio2.group = myRadioGroup; radio2.move(10, 30); addChild(radio2); var radio3:RadioButton = new RadioButton(); radio3.label = &quot;Option C&quot;; radio3.group = myRadioGroup; radio3.move(10, 50); addChild(radio3); function changeHandler(event:Event):void { var rg:RadioButtonGroup = event.target as RadioButtonGroup; switch (rg.selection) { case radio1: trace(&quot;radio1&quot;); break; case radio2: trace(&quot;radio2&quot;); break; case radio3: trace(&quot;radio3&quot;); break; } }"/>
<page href="fl/controls/RadioButtonGroup.html#event:click" title="RadioButtonGroup.click" text="click Dispatched when a RadioButton instance is clicked."/>
<page href="fl/controls/listClasses/CellRenderer.html" title="CellRenderer class" text="CellRenderer The CellRenderer class defines methods and properties for list-based components to use to manipulate and display custom cell content in each of their rows. A customized cell can contain text, an existing component such as a CheckBox, or any class that you create. The list-based components that use this class include the List, DataGrid, TileList, and ComboBox components."/>
<page href="fl/controls/listClasses/CellRenderer.html#CellRenderer()" title="CellRenderer.CellRenderer()" text="CellRenderer Creates a new CellRenderer instance."/>
<page href="fl/controls/listClasses/CellRenderer.html#getStyleDefinition()" title="CellRenderer.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/controls/listClasses/CellRenderer.html#setSize()" title="CellRenderer.setSize()" text="setSize Specifies the dimensions at which the data should be rendered. These dimensions affect both the data and the cell that contains it; the cell renderer uses them to ensure that the data fits the cell and does not bleed into adjacent cells. width height The width of the object, in pixels. The height of the object, in pixels."/>
<page href="fl/controls/listClasses/CellRenderer.html#data" title="CellRenderer.data" text="data Gets or sets an Object that represents the data that is associated with a component. When this value is set, the component data is stored and the containing component is invalidated. The invalidated component is then automatically redrawn. The data property represents an object containing the item in the DataProvider that the cell represents. Typically, the data property contains standard properties, depending on the component type. In CellRenderer in a List or ComboBox component the data contains a label, icon, and data properties; a TileList: a label and a source property; a DataGrid cell contains values for each column. The data property can also contain user-specified data relevant to the specific cell. Users can extend a CellRenderer for a component to utilize different properties of the data in the rendering of the cell. Additionally, the labelField, labelFunction, iconField, iconFunction, sourceField, and sourceFunction elements can be used to specify which properties are used to draw the label, icon, and source respectively."/>
<page href="fl/controls/listClasses/CellRenderer.html#listData" title="CellRenderer.listData" text="listData Gets or sets the list properties that are applied to the cell--for example, the index and selected values. These list properties are automatically updated after the cell is invalidated."/>
<page href="fl/controls/listClasses/CellRenderer.html#selected" title="CellRenderer.selected" text="selected Gets or sets a Boolean value that indicates whether the current cell is selected. A value of true indicates that the current cell is selected; a value of false indicates that it is not."/>
<page href="fl/controls/listClasses/CellRenderer.html#style:disabledSkin" title="CellRenderer.disabledSkin" text="disabledSkin Name of the class to use as the skin for the background and border when the button is not selected and is disabled."/>
<page href="fl/controls/listClasses/CellRenderer.html#style:disabledTextFormat" title="CellRenderer.disabledTextFormat" text="disabledTextFormat The TextFormat object to use to render the component label when the button is disabled."/>
<page href="fl/controls/listClasses/CellRenderer.html#style:downSkin" title="CellRenderer.downSkin" text="downSkin Name of the class to use as the skin for the background and border when the button is not selected and the mouse button is down."/>
<page href="fl/controls/listClasses/CellRenderer.html#style:overSkin" title="CellRenderer.overSkin" text="overSkin Name of the class to use as the skin for the background and border when the button is not selected and the mouse is over the component."/>
<page href="fl/controls/listClasses/CellRenderer.html#style:selectedDisabledSkin" title="CellRenderer.selectedDisabledSkin" text="selectedDisabledSkin Name of the class to use as the skin for the background and border when a toggle button is selected and disabled."/>
<page href="fl/controls/listClasses/CellRenderer.html#style:selectedDownSkin" title="CellRenderer.selectedDownSkin" text="selectedDownSkin Name of the class to use as the skin for the background and border when a toggle button is selected and the mouse button is down."/>
<page href="fl/controls/listClasses/CellRenderer.html#style:selectedOverSkin" title="CellRenderer.selectedOverSkin" text="selectedOverSkin Name of the class to use as the skin for the background and border when a toggle button is selected and the mouse is over the component."/>
<page href="fl/controls/listClasses/CellRenderer.html#style:selectedUpSkin" title="CellRenderer.selectedUpSkin" text="selectedUpSkin Name of the class to use as the skin for the background and border when a toggle button is selected and the mouse is not over the component."/>
<page href="fl/controls/listClasses/CellRenderer.html#style:textFormat" title="CellRenderer.textFormat" text="textFormat The TextFormat object to use to render the component label."/>
<page href="fl/controls/listClasses/CellRenderer.html#style:textPadding" title="CellRenderer.textPadding" text="textPadding The spacing between the text and the edges of the component, and the spacing between the text and the icon, in pixels."/>
<page href="fl/controls/listClasses/CellRenderer.html#style:upSkin" title="CellRenderer.upSkin" text="upSkin Name of the class to use as the skin for the background and border when the button is not selected and the mouse is not over the component."/>
<page href="fl/controls/listClasses/ListData.html" title="ListData class" text="ListData ListData is a messenger class that holds information relevant to a specific cell in a list-based component. This information includes the label and icon that are associated with the cell; whether or not the cell is selected; and the position of the cell in the list by row and column. A new ListData component is created for a cell renderer each time it is invalidated."/>
<page href="fl/controls/listClasses/ListData.html#ListData()" title="ListData.ListData()" text="ListData Creates a new instance of the ListData class as specified by its parameters. label icon owner index row col The label to be displayed in this cell. The icon to be displayed in this cell. The component that owns this cell. The index of the item in the data provider. The row in which this item is being displayed. In a List or DataGrid, this value corresponds to the index. In a TileList, this value may be different than the index. The column in which this item is being displayed. In a List, this value is always 0."/>
<page href="fl/controls/listClasses/ListData.html#column" title="ListData.column" text="column The column in which the data item is displayed. In a list, this value is always 0."/>
<page href="fl/controls/listClasses/ListData.html#icon" title="ListData.icon" text="icon A class that represents the icon for the item in the List component, computed from the List class method."/>
<page href="fl/controls/listClasses/ListData.html#index" title="ListData.index" text="index The index of the item in the data provider."/>
<page href="fl/controls/listClasses/ListData.html#label" title="ListData.label" text="label The label to be displayed in the cell."/>
<page href="fl/controls/listClasses/ListData.html#owner" title="ListData.owner" text="owner A reference to the List object that owns this item."/>
<page href="fl/controls/listClasses/ListData.html#row" title="ListData.row" text="row The row in which the data item is displayed."/>
<page href="fl/controls/listClasses/TileListData.html" title="TileListData class" text="TileListData TileListData is a messenger class that holds information relevant to a specific cell in the list-based TileListData component. This information includes the label and image source that are associated with the cell; whether or not the cell is selected; and the position of the cell in the list by row and column. A new TileListData component is created for a cell renderer each time it is invalidated."/>
<page href="fl/controls/listClasses/TileListData.html#TileListData()" title="TileListData.TileListData()" text="TileListData Creates a new instance of the TileListData class as specified by its parameters. The TileListData class inherits the properties of the ListData class, and adds a source parameter for the path to the image that is associated with the cell. label icon source owner index row col The label to be displayed in this cell. The icon to be displayed in this cell. The path or class that is associated with the content to be displayed in the cell. The component that owns this cell. The index of the item in the data provider. The row in which this item is being displayed. In a List or DataGrid, this corresponds to the index. In a TileList it may be different than the index. The column in which this item is being displayed. In a List this will always be equal to 0."/>
<page href="fl/controls/listClasses/TileListData.html#source" title="TileListData.source" text="source Gets or sets an absolute or relative URL that identifies the location of the SWF or image file to load, the class name of a movie clip in the library, or a reference to a display object. The TileListData does not load the source, it only passes the value of the source on to the ImageCell. Valid image file formats include GIF, PNG, and JPEG."/>
<page href="fl/controls/listClasses/ICellRenderer.html" title="ICellRenderer interface" text="ICellRenderer The ICellRenderer interface provides the methods and properties that a cell renderer requires. All user defined cell renderers should implement this interface. All user defined cell renderers must extend either the UIComponent class or a subclass of the UIComponent class."/>
<page href="fl/controls/listClasses/ICellRenderer.html#setMouseState()" title="ICellRenderer.setMouseState()" text="setMouseState Sets the current cell to a specific mouse state. This method is necessary for the DataGrid to set the mouse state on an entire row when the user interacts with a single cell. state A string that specifies a mouse state, such as &quot;up&quot; or &quot;over&quot;."/>
<page href="fl/controls/listClasses/ICellRenderer.html#setSize()" title="ICellRenderer.setSize()" text="setSize Sets the size of the data according to the pixel values specified by the width and height parameters. width height The width to display the cell renderer at, in pixels. The height to display the cell renderer at, in pixels."/>
<page href="fl/controls/listClasses/ICellRenderer.html#data" title="ICellRenderer.data" text="data Gets or sets an Object that represents the data that is associated with a component. When this value is set, the component data is stored and the containing component is invalidated. The invalidated component is then automatically redrawn. The data property represents an object containing the item in the DataProvider that the cell represents. Typically, the data property contains standard properties, depending on the component type. In CellRenderer in a List or ComboBox component the data contains a label, icon, and data properties; a TileList: a label and a source property; a DataGrid cell contains values for each column. The data property can also contain user-specified data relevant to the specific cell. Users can extend a CellRenderer for a component to utilize different properties of the data in the rendering of the cell. Additionally, the labelField, labelFunction, iconField, iconFunction, sourceField, and sourceFunction elements can be used to specify which properties are used to draw the label, icon, and source respectively."/>
<page href="fl/controls/listClasses/ICellRenderer.html#listData" title="ICellRenderer.listData" text="listData Gets or sets the list properties that are applied to the cell--for example, the index and selected values. These list properties are automatically updated after the cell is invalidated."/>
<page href="fl/controls/listClasses/ICellRenderer.html#selected" title="ICellRenderer.selected" text="selected Gets or sets a Boolean value that indicates whether the current cell is selected. A value of true indicates that the current cell is selected; a value of false indicates that it is not."/>
<page href="fl/controls/listClasses/ImageCell.html" title="ImageCell class" text="ImageCell The ImageCell is the default cell renderer for the TileList component. An ImageCell class accepts label and source properties, and displays a thumbnail and single-line label. Note: When content is being loaded from a different domain or sandbox, the properties of the content may be inaccessible for security reasons. For more information about how domain security affects the load process, see the Loader class."/>
<page href="fl/controls/listClasses/ImageCell.html#ImageCell()" title="ImageCell.ImageCell()" text="ImageCell Creates a new ImageCell instance."/>
<page href="fl/controls/listClasses/ImageCell.html#getStyleDefinition()" title="ImageCell.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/controls/listClasses/ImageCell.html#listData" title="ImageCell.listData" text="listData Gets or sets the list properties that are applied to the cell, for example, the index and selected values. These list properties are automatically updated after the cell is invalidated. Although the listData property returns an instance of ListData, in the TileList cells receive an instance of TileListData instead, which contains a source property."/>
<page href="fl/controls/listClasses/ImageCell.html#source" title="ImageCell.source" text="source Gets or sets an absolute or relative URL that identifies the location of the SWF or image file to load, the class name of a movie clip in the library, or a reference to a display object. Valid image file formats include GIF, PNG, and JPEG."/>
<page href="fl/controls/listClasses/ImageCell.html#style:imagePadding" title="ImageCell.imagePadding" text="imagePadding The padding that separates the edge of the cell from the edge of the image, in pixels."/>
<page href="fl/controls/listClasses/ImageCell.html#style:selectedSkin" title="ImageCell.selectedSkin" text="selectedSkin The skin that is used to indicate the selected state."/>
<page href="fl/controls/listClasses/ImageCell.html#style:textOverlayAlpha" title="ImageCell.textOverlayAlpha" text="textOverlayAlpha The opacity of the overlay behind the cell label."/>
<page href="fl/controls/listClasses/ImageCell.html#style:textPadding" title="ImageCell.textPadding" text="textPadding The padding that separates the edge of the cell from the edge of the text, in pixels."/>
<page href="fl/controls/dataGridClasses/DataGridCellEditor.html" title="DataGridCellEditor class" text="DataGridCellEditor The DataGridCellEditor class defines the default item editor for a DataGrid control. You can override the default item editor by subclassing the DataGridCellEditor class, or by creating your own cell editor class."/>
<page href="fl/controls/dataGridClasses/DataGridCellEditor.html#DataGridCellEditor()" title="DataGridCellEditor.DataGridCellEditor()" text="DataGridCellEditor Creates a new DataGridCellEditor instance."/>
<page href="fl/controls/dataGridClasses/DataGridCellEditor.html#getStyleDefinition()" title="DataGridCellEditor.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/controls/dataGridClasses/DataGridCellEditor.html#setMouseState()" title="DataGridCellEditor.setMouseState()" text="setMouseState Sets the current cell to a specific mouse state. This method is necessary for the DataGrid to set the mouse state on an entire row when the user interacts with a single cell. state A string that specifies a mouse state, such as &quot;up&quot; or &quot;over&quot;."/>
<page href="fl/controls/dataGridClasses/DataGridCellEditor.html#data" title="DataGridCellEditor.data" text="data Gets or sets an Object that represents the data that is associated with a component. When this value is set, the component data is stored and the containing component is invalidated. The invalidated component is then automatically redrawn. The data property represents an object containing the item in the DataProvider that the cell represents. Typically, the data property contains standard properties, depending on the component type. In CellRenderer in a List or ComboBox component the data contains a label, icon, and data properties; a TileList: a label and a source property; a DataGrid cell contains values for each column. The data property can also contain user-specified data relevant to the specific cell. Users can extend a CellRenderer for a component to utilize different properties of the data in the rendering of the cell. Additionally, the labelField, labelFunction, iconField, iconFunction, sourceField, and sourceFunction elements can be used to specify which properties are used to draw the label, icon, and source respectively."/>
<page href="fl/controls/dataGridClasses/DataGridCellEditor.html#listData" title="DataGridCellEditor.listData" text="listData Gets or sets the list properties that are applied to the cell--for example, the index and selected values. These list properties are automatically updated after the cell is invalidated."/>
<page href="fl/controls/dataGridClasses/DataGridCellEditor.html#selected" title="DataGridCellEditor.selected" text="selected Indicates whether the cell is included in the indices that were selected by the owner. A value of true indicates that the cell is included in the specified indices; a value of false indicates that it is not. Note that this value cannot be changed in the DataGrid. The DataGridCellEditor class implements the ICellRenderer interface, which specifies that this value must be defined."/>
<page href="fl/controls/dataGridClasses/DataGridCellEditor.html#style:textFormat" title="DataGridCellEditor.textFormat" text="textFormat The TextFormat object to use to render the component label."/>
<page href="fl/controls/dataGridClasses/DataGridCellEditor.html#style:textPadding" title="DataGridCellEditor.textPadding" text="textPadding The spacing between the text and the edges of the component, and the spacing between the text and the icon, in pixels."/>
<page href="fl/controls/dataGridClasses/DataGridCellEditor.html#style:upSkin" title="DataGridCellEditor.upSkin" text="upSkin Name of the class to use as the skin for the background and border of the DataGridCellEditor."/>
<page href="fl/controls/dataGridClasses/HeaderRenderer.html" title="HeaderRenderer class" text="HeaderRenderer The HeaderRenderer class displays the column header for the current DataGrid column. This class extends the LabelButton class and adds a column property that associates the current header with its DataGrid column."/>
<page href="fl/controls/dataGridClasses/HeaderRenderer.html#HeaderRenderer()" title="HeaderRenderer.HeaderRenderer()" text="HeaderRenderer Creates a new HeaderRenderer instance."/>
<page href="fl/controls/dataGridClasses/HeaderRenderer.html#getStyleDefinition()" title="HeaderRenderer.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/controls/dataGridClasses/HeaderRenderer.html#column" title="HeaderRenderer.column" text="column The index of the column that belongs to this HeaderRenderer instance. You do not need to know how to get or set this property because it is internal. However, if you create your own HeaderRenderer, be sure to expose it; the HeaderRenderer is used by the DataGrid to maintain a reference between the header and the related DataGridColumn."/>
<page href="fl/controls/dataGridClasses/HeaderRenderer.html#style:selectedDisabledSkin" title="HeaderRenderer.selectedDisabledSkin" text="selectedDisabledSkin Name of the class to use as the skin for the background and border when a toggle button is selected and disabled."/>
<page href="fl/controls/dataGridClasses/HeaderRenderer.html#style:selectedDownSkin" title="HeaderRenderer.selectedDownSkin" text="selectedDownSkin Name of the class to use as the skin for the background and border when a toggle button is selected and the mouse button is down."/>
<page href="fl/controls/dataGridClasses/HeaderRenderer.html#style:selectedOverSkin" title="HeaderRenderer.selectedOverSkin" text="selectedOverSkin Name of the class to use as the skin for the background and border when a toggle button is selected and the mouse is over the component."/>
<page href="fl/controls/dataGridClasses/HeaderRenderer.html#style:selectedUpSkin" title="HeaderRenderer.selectedUpSkin" text="selectedUpSkin Name of the class to use as the skin for the background and border when a toggle button is selected and the mouse is not over the component."/>
<page href="fl/controls/dataGridClasses/DataGridColumn.html" title="DataGridColumn class" text="DataGridColumn The DataGridColumn class describes a column in a DataGrid component. There is one DataGridColumn object for every column that could be displayed on the screen, even for columns that are currently hidden or off-screen. The data provider items that belong to a DataGrid component can contain properties that are not displayed; such properties do not require a DataGridColumn. You can specify the kind of component that displays the data for a DataGridColumn. The characteristics that can be specified include the text that appears in the column header and whether the column can be edited, sorted, or resized."/>
<page href="fl/controls/dataGridClasses/DataGridColumn.html#DataGridColumn()" title="DataGridColumn.DataGridColumn()" text="DataGridColumn Creates a new DataGridColumn instance. columnName The column name to display in the column header. If no name is specified, the dataField value is used."/>
<page href="fl/controls/dataGridClasses/DataGridColumn.html#itemToLabel()" title="DataGridColumn.itemToLabel()" text="itemToLabel Returns the string that the item renderer displays for the given data object. If the DataGridColumn or its DataGrid component has a non-null labelFunction property, it applies the function to the data object. Otherwise, the method extracts the contents of the field that is specified by the dataField property, or gets the string value of the data object. If the method cannot convert the parameter to a string, it returns a single space. data The Object to be rendered."/>
<page href="fl/controls/dataGridClasses/DataGridColumn.html#toString()" title="DataGridColumn.toString()" text="toString Returns a string representation of the DataGridColumn object."/>
<page href="fl/controls/dataGridClasses/DataGridColumn.html#cellRenderer" title="DataGridColumn.cellRenderer" text="cellRenderer The class that is used to render the items in this column. The type of this property can be Class, Sprite or String. If the property type is String, the String value must be a fully qualified class name. The following example specifies a custom cell renderer for a data grid column: import fl.controls.dataGridClasses.DataGridColumn; var dgc:DataGridColumn = new DataGridColumn(&quot;Field&quot;); dgc.cellRenderer = &quot;MyCustomCellRendererClass&quot;; dg.addColumn(dgc);"/>
<page href="fl/controls/dataGridClasses/DataGridColumn.html#dataField" title="DataGridColumn.dataField" text="dataField Identifies the name of the field or property in the data provider item that is associated with the column."/>
<page href="fl/controls/dataGridClasses/DataGridColumn.html#editable" title="DataGridColumn.editable" text="editable Indicates whether the items in the column can be edited. A value of true indicates that the column items can be edited; a value of false indicates that they cannot be edited. If this property is set to true and the editable property of the DataGrid is also true, the items in a column are editable and can be individually edited by clicking an item or by navigating to the item by using the Tab and arrow keys."/>
<page href="fl/controls/dataGridClasses/DataGridColumn.html#editorDataField" title="DataGridColumn.editorDataField" text="editorDataField Identifies the name of the property of the item editor that contains the new data for the list item. For example, the default itemEditor is TextInput, so the default value of the editorDataField property is &quot;text&quot;. This value specifies the text property of the TextInput component."/>
<page href="fl/controls/dataGridClasses/DataGridColumn.html#headerRenderer" title="DataGridColumn.headerRenderer" text="headerRenderer The class that is used to render the header of this column. The type of this property can be Class, Sprite or String. If the property type is String, the string value must be a fully qualified class name."/>
<page href="fl/controls/dataGridClasses/DataGridColumn.html#headerText" title="DataGridColumn.headerText" text="headerText The column name to be displayed in the column header. By default, the DataGrid component uses the value of the dataField property as the column name. The following example creates a new data grid and specifies header text for each column: import fl.controls.DataGrid; import fl.controls.dataGridClasses.DataGridColumn; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem({name:&quot;Person A&quot;, sales:13453}); dp.addItem({name:&quot;Person B&quot;, sales:23432}); dp.addItem({name:&quot;Person C&quot;, sales:9454}); var nameCol:DataGridColumn = new DataGridColumn(&quot;name&quot;); nameCol.headerText = &quot;Employee:&quot;; var salesCol:DataGridColumn = new DataGridColumn(&quot;sales&quot;); salesCol.headerText = &quot;Sales:&quot;; salesCol.labelFunction = currencyFormatter; salesCol.sortOptions = Array.NUMERIC; var myDataGrid:DataGrid = new DataGrid(); myDataGrid.addColumn(nameCol); myDataGrid.addColumn(salesCol); myDataGrid.dataProvider = dp; myDataGrid.move(10, 10); myDataGrid.setSize(320, 240); addChild(myDataGrid); function currencyFormatter(item:Object):String { return &quot;$&quot; + item.sales.toFixed(0); }"/>
<page href="fl/controls/dataGridClasses/DataGridColumn.html#imeMode" title="DataGridColumn.imeMode" text="imeMode The mode of the input method editor (IME). The IME enables users to enter text in Chinese, Japanese, and Korean. The flash.system.IMEConversionMode class defines constants to be used as the valid values for this property. If this property is null, the mode of the IME is set to the value of the imeMode property of the DataGrid component."/>
<page href="fl/controls/dataGridClasses/DataGridColumn.html#itemEditor" title="DataGridColumn.itemEditor" text="itemEditor Indicates the class of the instances of the item editor to use for the column, when it is editable. The type of this property can be Class, Sprite or String. If the property type is String, the string value must be a fully qualified class name. The following example specifies a custom item editor for a data grid column: import fl.controls.dataGridClasses.DataGridColumn; var dgc:DataGridColumn = new DataGridColumn(&quot;Field&quot;); dgc.itemEditor = &quot;MyCustomItemEditorClass&quot;; dg.addColumn(dgc);"/>
<page href="fl/controls/dataGridClasses/DataGridColumn.html#labelFunction" title="DataGridColumn.labelFunction" text="labelFunction A function that determines the text to be displayed in this column. By default, the column displays the text for the data field that matches the column name. However, a column can also be used to display the text of more than one data field, or to display content that is not in the proper format. This can be done by using the labelFunction property to specify a callback function. If both the labelFunction and labelField properties are defined, the labelFunction takes precedence. The following example creates a data grid and defines a custom label function for one of the data grid columns: import fl.controls.DataGrid; import fl.controls.ScrollPolicy; import fl.controls.dataGridClasses.DataGridColumn; import fl.data.DataProvider; var i:uint; var totalRows:uint = 16; var dp:DataProvider = new DataProvider(); for (i = 0; i &lt; totalRows; i++) { dp.addItem({col1:getRandomNumber(), col2:getRandomNumber(), col3:getRandomNumber(), col4:getRandomNumber()}); } var c1:DataGridColumn = new DataGridColumn(&quot;col1&quot;); c1.sortOptions = Array.NUMERIC; var c2:DataGridColumn = new DataGridColumn(&quot;col2&quot;); c2.sortOptions = Array.NUMERIC; var c3:DataGridColumn = new DataGridColumn(&quot;col3&quot;); c3.sortOptions = Array.NUMERIC; c3.labelFunction = currencyFormatter; var dg:DataGrid = new DataGrid(); dg.setSize(200, 300); dg.addColumn(c1); dg.addColumn(c2); dg.addColumn(c3); dg.dataProvider = dp; addChild(dg); function getRandomNumber():Number { return Math.random() * 100; } function currencyFormatter(data:Object):String { var value:Number = Number(data.col3); return &quot;$&quot; + value.toFixed(2); }"/>
<page href="fl/controls/dataGridClasses/DataGridColumn.html#minWidth" title="DataGridColumn.minWidth" text="minWidth The minimum width of the column, in pixels. The following example displays the width of each column in the data grid whenever a column's width changes: import fl.controls.DataGrid; import fl.controls.dataGridClasses.DataGridColumn; import fl.data.DataProvider; import fl.events.DataGridEvent; var data:XML = &lt;data&gt; &lt;row col1=&quot;item 1.A&quot; col2=&quot;item 1.B&quot; col3=&quot;item 1.C&quot; /&gt; &lt;row col1=&quot;item 2.A&quot; col2=&quot;item 2.B&quot; col3=&quot;item 2.C&quot; /&gt; &lt;row col1=&quot;item 3.A&quot; col2=&quot;item 3.B&quot; col3=&quot;item 3.C&quot; /&gt; &lt;/data&gt;; var dp:DataProvider = new DataProvider(data); var c1:DataGridColumn = new DataGridColumn(&quot;col1&quot;); c1.minWidth = 100; var c2:DataGridColumn = new DataGridColumn(&quot;col2&quot;); var c3:DataGridColumn = new DataGridColumn(&quot;col3&quot;); var myDataGrid:DataGrid = new DataGrid(); myDataGrid.addColumn(c1); myDataGrid.addColumn(c2); myDataGrid.addColumn(c3); myDataGrid.dataProvider = dp; myDataGrid.move(10, 10); myDataGrid.setSize(300, 200); myDataGrid.addEventListener(DataGridEvent.COLUMN_STRETCH, columnStretchHandler); addChild(myDataGrid); function columnStretchHandler(event:DataGridEvent):void { var column:DataGridColumn; for each (column in myDataGrid.columns) { trace(column.dataField, &quot;width:&quot; + column.width, &quot;minWidth:&quot; + column.minWidth); } trace(&quot;---&quot;); }"/>
<page href="fl/controls/dataGridClasses/DataGridColumn.html#resizable" title="DataGridColumn.resizable" text="resizable Indicates whether the user is allowed to change the width of the column. A value of true indicates that the user can change the column width; a value of false indicates that the user cannot change the column width."/>
<page href="fl/controls/dataGridClasses/DataGridColumn.html#sortable" title="DataGridColumn.sortable" text="sortable Indicates whether the user can click on the header of the current column to sort the data provider. A value of true indicates that the column can be sorted by clicking on its header; a value of false indicates that it cannot be sorted by clicking on its header. The following example creates a new data grid with an unsortable column: import fl.controls.DataGrid; import fl.controls.dataGridClasses.DataGridColumn; import fl.data.DataProvider; import fl.events.DataGridEvent; var data:XML = &lt;dataProvider&gt; &lt;data col1=&quot;Person A&quot; col2=&quot;11.383&quot; /&gt; &lt;data col1=&quot;Person B&quot; col2=&quot;3.399&quot; /&gt; &lt;data col1=&quot;Person C&quot; col2=&quot;25.624&quot; /&gt; &lt;/dataProvider&gt; var dp:DataProvider = new DataProvider(data); var c1:DataGridColumn = new DataGridColumn(&quot;col1&quot;); var c2:DataGridColumn = new DataGridColumn(&quot;col2&quot;); c2.sortable = false; var myDataGrid:DataGrid = new DataGrid(); myDataGrid.addColumn(c1); myDataGrid.addColumn(c2); myDataGrid.dataProvider = dp; myDataGrid.move(10, 10); myDataGrid.setSize(160, 120); addChild(myDataGrid);"/>
<page href="fl/controls/dataGridClasses/DataGridColumn.html#sortCompareFunction" title="DataGridColumn.sortCompareFunction" text="sortCompareFunction A callback function that is called when sorting the data in the column. If this property is not specified, the data is sorted by string or number, depending on the sortOptions property. When specified, the sortCompareFunction property allows you to create your own custom sorting method for the current data grid column. The following example creates a new DataGridColumn object and specifies both a labelFunction and sortCompareFunction: import fl.controls.DataGrid; import fl.controls.dataGridClasses.DataGridColumn; import fl.data.DataProvider; var data:XML = &lt;data&gt; &lt;item name=&quot;Employee A&quot; isManager=&quot;1&quot; /&gt; &lt;item name=&quot;Employee B&quot; isManager=&quot;0&quot; /&gt; &lt;item name=&quot;Employee C&quot; isManager=&quot;1&quot; /&gt; &lt;/data&gt;; var dp:DataProvider = new DataProvider(data); var nameDGC:DataGridColumn = new DataGridColumn(&quot;name&quot;); nameDGC.sortCompareFunction = isManager; nameDGC.labelFunction = nameLabelFunction; var myDataGrid:DataGrid = new DataGrid() myDataGrid.addColumn(nameDGC); myDataGrid.dataProvider = dp; myDataGrid.width = 200; myDataGrid.rowCount = myDataGrid.length; myDataGrid.move(10, 10); addChild(myDataGrid); function nameLabelFunction(item:Object):String { var managerString:String = &quot;&quot;; if (item.isManager == &quot;1&quot;) { managerString = &quot; (Manager)&quot;; } return item.name + managerString; } function isManager(itemA:Object, itemB:Object):int { if (itemA.isManager &gt; itemB.isManager) { return -1; } else if (itemA.isManager &lt; itemB.isManager) { return 1; } else { return 0; } }"/>
<page href="fl/controls/dataGridClasses/DataGridColumn.html#sortDescending" title="DataGridColumn.sortDescending" text="sortDescending Indicates whether the DataGridColumn is to be sorted in ascending or descending order. A value of true indicates that the DataGridColumn is sorted in descending order; a value of false indicates that the DataGridColum is sorted in ascending order."/>
<page href="fl/controls/dataGridClasses/DataGridColumn.html#sortOptions" title="DataGridColumn.sortOptions" text="sortOptions One or more defined constants, identified by name or number and separated by the bitwise OR (|) operator. These constants are used to specify the sort operation. The following example uses the sortOptions property to specify that a data grid column should be sorted numerically: import fl.data.DataProvider; import fl.controls.dataGridClasses.DataGridColumn; var data:XML = &lt;players&gt; &lt;player name=&quot;Player 1&quot; score=&quot;1234&quot; /&gt; &lt;player name=&quot;Player 2&quot; score=&quot;198&quot; /&gt; &lt;player name=&quot;Player 3&quot; score=&quot;987&quot; /&gt; &lt;/players&gt;; var dp:DataProvider = new DataProvider(data); var nameDGC:DataGridColumn = new DataGridColumn(&quot;name&quot;); var scoreDGC:DataGridColumn = new DataGridColumn(&quot;score&quot;); scoreDGC.sortOptions = Array.NUMERIC; dg.addColumn(nameDGC); dg.addColumn(scoreDGC); dg.dataProvider = dp;"/>
<page href="fl/controls/dataGridClasses/DataGridColumn.html#visible" title="DataGridColumn.visible" text="visible Indicates whether the column is visible. A value of true indicates that the column is visible; a value of false indicates that the column is invisible. The following example creates a DataGrid component instance with two columns. You can toggle the visible property of each of these columns by clicking the corresponding Button instance on the Stage. import fl.controls.Button; import fl.controls.DataGrid; import fl.controls.dataGridClasses.DataGridColumn; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem({name:&quot;Person A&quot;, average:0.297}); dp.addItem({name:&quot;Person B&quot;, average:0.288}); dp.addItem({name:&quot;Person C&quot;, average:0.310}); var nameCol:DataGridColumn = new DataGridColumn(&quot;name&quot;); nameCol.headerText = &quot;Name:&quot;; var averageCol:DataGridColumn = new DataGridColumn(&quot;average&quot;); averageCol.headerText = &quot;Average:&quot;; averageCol.labelFunction = numberFormatter; averageCol.sortOptions = Array.NUMERIC; averageCol.visible = false; var myDataGrid:DataGrid = new DataGrid(); myDataGrid.addColumn(nameCol); myDataGrid.addColumn(averageCol); myDataGrid.dataProvider = dp; myDataGrid.rowCount = dp.length; myDataGrid.width = 320; myDataGrid.move(10, 10); addChild(myDataGrid); var nameButton:Button = new Button(); nameButton.label = &quot;Toggle name&quot;; nameButton.toggle = true; nameButton.selected = nameCol.visible; nameButton.move(myDataGrid.x, myDataGrid.y + myDataGrid.height + 10); nameButton.addEventListener(Event.CHANGE, changeHandler); addChild(nameButton); var averageButton:Button = new Button(); averageButton.label = &quot;Toggle average&quot;; averageButton.toggle = true; averageButton.selected = averageCol.visible; averageButton.move(nameButton.x + nameButton.width + 10, nameButton.y); averageButton.addEventListener(Event.CHANGE, changeHandler); addChild(averageButton); function numberFormatter(item:Object):String { return Number(item.average).toFixed(3); } function changeHandler(event:Event):void { var colIndex:int = -2; var col:DataGridColumn; switch (event.currentTarget) { case nameButton: colIndex = myDataGrid.getColumnIndex(&quot;name&quot;); break; case averageButton: colIndex = myDataGrid.getColumnIndex(&quot;average&quot;); break; default: return; } if (colIndex &gt; -1) { col = myDataGrid.getColumnAt(colIndex); col.visible = !col.visible; myDataGrid.removeColumnAt(colIndex); myDataGrid.addColumnAt(col, colIndex); } myDataGrid.spaceColumnsEqually(); }"/>
<page href="fl/controls/dataGridClasses/DataGridColumn.html#width" title="DataGridColumn.width" text="width The width of the column, in pixels."/>
<page href="fl/controls/progressBarClasses/IndeterminateBar.html" title="IndeterminateBar class" text="IndeterminateBar The IndeterminateBar class handles the drawing of the progress bar component when the size of the source that is being loaded is unknown. This class can be replaced with any other UIComponent class to render the bar differently. The default implementation uses the drawing API create a striped fill to indicate the progress of the load operation."/>
<page href="fl/controls/progressBarClasses/IndeterminateBar.html#IndeterminateBar()" title="IndeterminateBar.IndeterminateBar()" text="IndeterminateBar Creates a new instance of the IndeterminateBar component."/>
<page href="fl/controls/progressBarClasses/IndeterminateBar.html#getStyleDefinition()" title="IndeterminateBar.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/controls/progressBarClasses/IndeterminateBar.html#visible" title="IndeterminateBar.visible" text="visible Gets or sets a Boolean value that indicates whether the indeterminate bar is visible. A value of true indicates that the indeterminate bar is visible; a value of false indicates that it is not."/>
<page href="fl/controls/progressBarClasses/IndeterminateBar.html#style:indeterminateSkin" title="IndeterminateBar.indeterminateSkin" text="indeterminateSkin Name of the class to use as the indeterminate progress bar. This is passed to the indeterminate bar renderer, which is specified by the indeterminateBar style."/>
<page href="flash/utils/IDataOutput.html" title="IDataOutput interface" text="IDataOutput The IDataOutput interface provides a set of methods for writing binary data. This interface is the I/O counterpart to the IDataInput interface, which reads binary data. The IDataOutput interface is implemented by the Socket and ByteArray classes. All IDataInput and IDataOutput operations are &quot;bigEndian&quot; by default (the most significant byte in the sequence is stored at the lowest or first storage address), and are nonblocking. Sign extension matters only when you read data, not when you write it. Therefore, you do not need separate write methods to work with IDataInput.readUnsignedByte() and IDataInput.readUnsignedShort(). In other words: Use IDataOutput.writeByte() with IDataInput.readUnsignedByte() and IDataInput.readByte(). Use IDataOutput.writeShort() with IDataInput.readUnsignedShort() and IDataInput.readShort()."/>
<page href="flash/utils/IDataOutput.html#writeBoolean()" title="IDataOutput.writeBoolean()" text="writeBoolean Writes a Boolean value. A single byte is written according to the value parameter, either 1 if true or 0 if false. value A Boolean value determining which byte is written. If the parameter is true Flash Player writes a 1; if false, Flash Player writes a 0."/>
<page href="flash/utils/IDataOutput.html#writeByte()" title="IDataOutput.writeByte()" text="writeByte Writes a byte. The low 8 bits of the parameter are used. The high 24 bits are ignored. value A byte value as an integer."/>
<page href="flash/utils/IDataOutput.html#writeBytes()" title="IDataOutput.writeBytes()" text="writeBytes Writes a sequence of length bytes from the specified byte array, bytes, starting offset(zero-based index) bytes into the byte stream. If the length parameter is omitted, the default length of 0 is used; Flash Player writes the entire buffer starting at offset. If the offset parameter is also omitted, the entire buffer is written. If the offset or length parameter is out of range, they are clamped to the beginning and end of the bytes array. bytes offset length The byte array to write. A zero-based index indicating the position into the array to begin writing. An unsigned integer indicating how far into the buffer to write."/>
<page href="flash/utils/IDataOutput.html#writeDouble()" title="IDataOutput.writeDouble()" text="writeDouble Writes an IEEE 754 double-precision (64-bit) floating point number. value A double-precision (64-bit) floating point number."/>
<page href="flash/utils/IDataOutput.html#writeFloat()" title="IDataOutput.writeFloat()" text="writeFloat Writes an IEEE 754 single-precision (32-bit) floating point number. value A single-precision (32-bit) floating point number."/>
<page href="flash/utils/IDataOutput.html#writeInt()" title="IDataOutput.writeInt()" text="writeInt Writes a 32-bit signed integer. value A byte value as a signed integer."/>
<page href="flash/utils/IDataOutput.html#writeMultiByte()" title="IDataOutput.writeMultiByte()" text="writeMultiByte Writes a multibyte string to the byte stream using the specified character set. value charSet The string value to be written. The string denoting the character set to use. Possible character set strings include &quot;shift-jis&quot;, &quot;cn-gb&quot;, &quot;iso-8859-1&quot; and others. For a complete list, see Supported Character Sets."/>
<page href="flash/utils/IDataOutput.html#writeObject()" title="IDataOutput.writeObject()" text="writeObject Writes an object to the byte stream or byte array in AMF serialized format. object the object to be serialized"/>
<page href="flash/utils/IDataOutput.html#writeShort()" title="IDataOutput.writeShort()" text="writeShort Writes a 16-bit integer. The low 16 bits of the parameter are used. The high 16 bits are ignored. value A byte value as an integer."/>
<page href="flash/utils/IDataOutput.html#writeUnsignedInt()" title="IDataOutput.writeUnsignedInt()" text="writeUnsignedInt Writes a 32-bit unsigned integer. value A byte value as an unsigned integer."/>
<page href="flash/utils/IDataOutput.html#writeUTF()" title="IDataOutput.writeUTF()" text="writeUTF Writes a UTF-8 string to the byte stream. The length of the UTF-8 string in bytes is written first, as a 16-bit integer, followed by the bytes representing the characters of the string. value The string value to be written. If the length is larger than 65535."/>
<page href="flash/utils/IDataOutput.html#writeUTFBytes()" title="IDataOutput.writeUTFBytes()" text="writeUTFBytes Writes a UTF-8 string. Similar to writeUTF(), but does not prefix the string with a 16-bit length word. value The string value to be written."/>
<page href="flash/utils/IDataOutput.html#endian" title="IDataOutput.endian" text="endian The byte order for the data, either the &quot;bigEndian&quot; or &quot;littleEndian&quot; constant from the Endian class."/>
<page href="flash/utils/IDataOutput.html#objectEncoding" title="IDataOutput.objectEncoding" text="objectEncoding Used to determine whether the ActionScript 3.0, ActionScript 2.0, or ActionScript 1.0 format should be used when writing to, or reading binary data. The value is a constant from the ObjectEncoding class."/>
<page href="flash/utils/Dictionary.html" title="Dictionary class" text="Dictionary The Dictionary class lets you create a dynamic collection of properties, which uses strict equality (===) for key comparison on non-primitive object keys. When an object is used as a key, the object's identity is used to look up the object, and not the value returned from calling toString() on it. Primitive (built-in) objects, like Numbers, in a Dictionary collection behave in the same manner as they do when they are the property of a regular object. The following statements show the relationship between a Dictionary object and a key object: var dict = new Dictionary(); var obj = new Object(); var key:Object = new Object(); key.toString = function() { return &quot;key&quot; } dict[key] = &quot;Letters&quot;; obj[&quot;key&quot;] = &quot;Letters&quot;; dict[key] == &quot;Letters&quot;; // true obj[&quot;key&quot;] == &quot;Letters&quot;; // true obj[key] == &quot;Letters&quot;; // true because key == &quot;key&quot; is true b/c key.toString == &quot;key&quot; dict[&quot;key&quot;] == &quot;Letters&quot;; // false because &quot;key&quot; === key is false delete dict[key]; //removes the key"/>
<page href="flash/utils/Dictionary.html#Dictionary()" title="Dictionary.Dictionary()" text="Dictionary Creates a new Dictionary object. To remove a key from a Dictionary object, use the delete operator. weakKeys Instructs the Dictionary object to use &quot;weak&quot; references on object keys. If the only reference to an object is in the specified Dictionary object, the key is eligible for garbage collection and is removed from the table when the object is collected."/>
<page href="flash/utils/Timer.html" title="Timer class" text="Timer The Timer class is the interface to Flash Player timers. You can create new Timer objects to run code on a specified time sequence. Use the start() method to start a timer. Add an event listener for the timer event to set up code to be run on the timer interval. You can create Timer objects to run once or repeat at specified intervals to execute code on a schedule. Depending on the SWF file's framerate or Flash Player's environment (available memory and other factors), Flash Player may dispatch events at slightly offset intervals. For example, if a SWF file is set to play at 10 frames per second [fps], which is 100 millisecond intervals, but your timer is set to fire an event at 80 milliseconds, Flash Player will fire the event close to the 100 millisecond interval. Memory-intensive scripts may also offset the events."/>
<page href="flash/utils/Timer.html#Timer()" title="Timer.Timer()" text="Timer Constructs a new Timer object with the specified delay and repeatCount states. The timer does not start automatically; you must call the start() method to start it. delay repeatCount The delay between timer events, in milliseconds. Specifies the number of repetitions. If zero, the timer repeats infinitely. If nonzero, the timer runs the specified number of times and then stops. In the following example, the user is given 90 seconds to write a response into an input text field. Also every thirty seconds, a status text field lets the user know how many seconds are left. A Timer object is created that will start in 30 seconds (delay is set to 30000 millisecond) and will repeat three times for a total of 90 seconds. (The timer will stop after the third time.) Two event listeners are added for the myTimer timer. The first is triggered by the TimerEvent.TIMER event, which occurs every time the timer is started. The timerHandler() method changes the text for the statusTextField text field to reflect the seconds remaining. (Note that the Timer class keeps track of the number of times it needs to start (repeats) by increasing the number in the currentCount property.) Once the timer is called for the last time, the TimerEvent.TIMER_COMPLETE event is dispatched and the completeHandler() method is called. The completeHandler() method changes the inputTextField text field's type from INPUT to DYNAMIC, which means the user will no longer be able to input or change the text field. package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFieldType; import flash.text.TextFieldAutoSize; import flash.utils.Timer; import flash.events.TimerEvent; import flash.events.Event; public class Timer_constructorExample extends Sprite { private var statusTextField:TextField = new TextField(); private var inputTextField:TextField = new TextField(); private var delay:uint = 30000; private var repeat:uint = 3; private var myTimer:Timer = new Timer(delay, repeat); public function Timer_constructorExample() { inputTextField.x = 10; inputTextField.y = 10; inputTextField.border = true; inputTextField.background = true; inputTextField.height = 200; inputTextField.width = 200; inputTextField.multiline = true; inputTextField.wordWrap = true; inputTextField.type = TextFieldType.INPUT; statusTextField.x = 10; statusTextField.y = 220; statusTextField.background = true; statusTextField.autoSize = TextFieldAutoSize.LEFT; myTimer.start(); statusTextField.text = &quot;You have &quot; + ((delay * repeat) / 1000) + &quot; seconds to write your response.&quot;; myTimer.addEventListener(TimerEvent.TIMER, timerHandler); myTimer.addEventListener(TimerEvent.TIMER_COMPLETE, completeHandler); addChild(inputTextField); addChild(statusTextField); } private function timerHandler(e:TimerEvent):void{ repeat--; statusTextField.text = ((delay * repeat) / 1000) + &quot; seconds left.&quot;; } private function completeHandler(e:TimerEvent):void { statusTextField.text = &quot;Times Up.&quot;; inputTextField.type = TextFieldType.DYNAMIC; } } } if the delay specified is negative or not a finite number"/>
<page href="flash/utils/Timer.html#reset()" title="Timer.reset()" text="reset Stops the timer, if it is running, and sets the currentCount property back to 0, like the reset button of a stopwatch. Then, when start() is called, the timer instance runs for the specified number of repetitions, as set by the repeatCount value."/>
<page href="flash/utils/Timer.html#start()" title="Timer.start()" text="start Starts the timer, if it is not already running."/>
<page href="flash/utils/Timer.html#stop()" title="Timer.stop()" text="stop Stops the timer. When start() is called after stop(), the timer instance runs for the remaining number of repetitions, as set by the repeatCount property."/>
<page href="flash/utils/Timer.html#currentCount" title="Timer.currentCount" text="currentCount The total number of times the timer has fired since it started at zero. If the timer has been reset, only the fires since the reset are counted."/>
<page href="flash/utils/Timer.html#delay" title="Timer.delay" text="delay The delay, in milliseconds, between timer events. If you set the delay interval while the timer is running, the timer will restart at the same repeatCount iteration. Throws an exception if the delay specified is negative or not a finite number."/>
<page href="flash/utils/Timer.html#repeatCount" title="Timer.repeatCount" text="repeatCount The total number of times the timer is set to run. If the repeat count is set to 0, the timer continues forever or until the stop() method is invoked or the program stops. If the repeat count is nonzero, the timer runs the specified number of times. If repeatCount is set to a total that is the same or less then currentCount the timer stops and will not fire again."/>
<page href="flash/utils/Timer.html#running" title="Timer.running" text="running The timer's current state; true if the timer is running, otherwise false."/>
<page href="flash/utils/Timer.html#event:timer" title="Timer.timer" text="timer Dispatched whenever a Timer object reaches an interval specified according to the Timer.delay property."/>
<page href="flash/utils/Timer.html#event:timerComplete" title="Timer.timerComplete" text="timerComplete Dispatched whenever it has completed the number of requests set by Timer.repeatCount."/>
<page href="flash/utils/IDataInput.html" title="IDataInput interface" text="IDataInput The IDataInput interface provides a set of methods for reading binary data. This interface is the I/O counterpart to the IDataOutput interface, which writes binary data. All IDataInput and IDataOutput operations are &quot;bigEndian&quot; by default (the most significant byte in the sequence is stored at the lowest or first storage address), and are nonblocking. If insufficient data is available, an EOFError exception is thrown. Use the IDataInput.bytesAvailable property to determine how much data is available to read. Sign extension matters only when you read data, not when you write it. Therefore you do not need separate write methods to work with IDataInput.readUnsignedByte() and IDataInput.readUnsignedShort(). In other words: Use IDataOutput.writeByte() with IDataInput.readUnsignedByte() and IDataInput.readByte(). Use IDataOutput.writeShort() with IDataInput.readUnsignedShort() and IDataInput.readShort()."/>
<page href="flash/utils/IDataInput.html#readBoolean()" title="IDataInput.readBoolean()" text="readBoolean Reads a Boolean value from the byte stream or byte array. A single byte is read, and true is returned if the byte is nonzero, false otherwise. There is not sufficient data available to read."/>
<page href="flash/utils/IDataInput.html#readByte()" title="IDataInput.readByte()" text="readByte Reads a signed byte from the byte stream or byte array. There is not sufficient data available to read."/>
<page href="flash/utils/IDataInput.html#readBytes()" title="IDataInput.readBytes()" text="readBytes Reads the number of data bytes, specified by the length parameter, from the byte stream or byte array. The bytes are read into the ByteArray objected specified by the bytes parameter, starting at the position specified by offset. bytes offset length The ByteArray object to read data into. The offset into the bytes parameter at which data read should begin. The number of bytes to read. The default value of 0 causes all available data to be read. There is not sufficient data available to read."/>
<page href="flash/utils/IDataInput.html#readDouble()" title="IDataInput.readDouble()" text="readDouble Reads an IEEE 754 double-precision floating point number from the byte stream or byte array. There is not sufficient data available to read."/>
<page href="flash/utils/IDataInput.html#readFloat()" title="IDataInput.readFloat()" text="readFloat Reads an IEEE 754 single-precision floating point number from the byte stream or byte array. There is not sufficient data available to read."/>
<page href="flash/utils/IDataInput.html#readInt()" title="IDataInput.readInt()" text="readInt Reads a signed 32-bit integer from the byte stream or byte array. There is not sufficient data available to read."/>
<page href="flash/utils/IDataInput.html#readMultiByte()" title="IDataInput.readMultiByte()" text="readMultiByte Reads a multibyte string of specified length from the byte stream using the specified character set. length charSet The number of bytes from the byte stream to read. The string denoting the character set to use to interpret the bytes. Possible character set strings include &quot;shift-jis&quot;, &quot;cn-gb&quot;, &quot;iso-8859-1&quot;, and others. For a complete list, see Supported Character Sets. Note: If the value for the charSet parameter is not recognized by the current system, then Flash Player uses the system's default code page as the character set. For example, a value for the charSet parameter, as in myTest.readMultiByte(22, &quot;iso-8859-01&quot;) that uses 01 instead of 1 might work on your development machine, but not on another machine. On the other machine, Flash Player will use the system's default code page. There is not sufficient data available to read."/>
<page href="flash/utils/IDataInput.html#readObject()" title="IDataInput.readObject()" text="readObject Reads an object from the byte stream or byte array, encoded in AMF serialized format. There is not sufficient data available to read."/>
<page href="flash/utils/IDataInput.html#readShort()" title="IDataInput.readShort()" text="readShort Reads a signed 16-bit integer from the byte stream or byte array. There is not sufficient data available to read."/>
<page href="flash/utils/IDataInput.html#readUnsignedByte()" title="IDataInput.readUnsignedByte()" text="readUnsignedByte Reads an unsigned byte from the byte stream or byte array. There is not sufficient data available to read."/>
<page href="flash/utils/IDataInput.html#readUnsignedInt()" title="IDataInput.readUnsignedInt()" text="readUnsignedInt Reads an unsigned 32-bit integer from the byte stream or byte array. There is not sufficient data available to read."/>
<page href="flash/utils/IDataInput.html#readUnsignedShort()" title="IDataInput.readUnsignedShort()" text="readUnsignedShort Reads an unsigned 16-bit integer from the byte stream or byte array. There is not sufficient data available to read."/>
<page href="flash/utils/IDataInput.html#readUTF()" title="IDataInput.readUTF()" text="readUTF Reads a UTF-8 string from the byte stream or byte array. The string is assumed to be prefixed with an unsigned short indicating the length in bytes. This method is similar to the readUTF() method in the Java IDataInput interface. There is not sufficient data available to read."/>
<page href="flash/utils/IDataInput.html#readUTFBytes()" title="IDataInput.readUTFBytes()" text="readUTFBytes Reads a sequence of length UTF-8 bytes from the byte stream or byte array and returns a string. length There is not sufficient data available to read."/>
<page href="flash/utils/IDataInput.html#bytesAvailable" title="IDataInput.bytesAvailable" text="bytesAvailable Returns the number of bytes of data available for reading in the input buffer. User code must call bytesAvailable to ensure that sufficient data is available before trying to read it with one of the read methods."/>
<page href="flash/utils/IDataInput.html#endian" title="IDataInput.endian" text="endian The byte order for the data, either the &quot;bigEndian&quot; or &quot;littleEndian&quot; constant from the Endian class."/>
<page href="flash/utils/IDataInput.html#objectEncoding" title="IDataInput.objectEncoding" text="objectEncoding Used to determine whether the ActionScript 3.0, ActionScript 2.0, or ActionScript 1.0 format should be used when writing to, or reading binary data. The value is a constant from the ObjectEncoding class."/>
<page href="flash/utils/Endian.html" title="Endian class" text="Endian The Endian class contains values that denote the byte order used to represent multibyte numbers. The byte order is either bigEndian (most significant byte first) or littleEndian (least significant byte first). Flash Player can interface with a server by using the binary protocol of that server, directly. Some servers use the bigEndian byte order and some servers use the littleEndian byte order. Most servers on the Internet use the bigEndian byte order because &quot;network byte order&quot; is bigEndian. The littleEndian byte order is popular because the Intel x86 architecture uses it. Use the endian byte order that matches the protocol of the server that is sending or receiving data."/>
<page href="flash/utils/Endian.html#BIG_ENDIAN" title="Endian.BIG_ENDIAN" text="BIG_ENDIAN Indicates the most significant byte of the multibyte number appears first in the sequence of bytes. The hexadecimal number 0x12345678 has 4 bytes (2 hexadecimal digits per byte). The most significant byte is 0x12. The least significant byte is 0x78. (For the equivalent decimal number, 305419896, the most significant digit is 3, and the least significant digit is 6). A stream using the bigEndian byte order (the most significant byte first) writes: 12 34 56 78"/>
<page href="flash/utils/Endian.html#LITTLE_ENDIAN" title="Endian.LITTLE_ENDIAN" text="LITTLE_ENDIAN Indicates the least significant byte of the multibyte number appears first in the sequence of bytes. The hexadecimal number 0x12345678 has 4 bytes (2 hexadecimal digits per byte). The most significant byte is 0x12. The least significant byte is 0x78. (For the equivalent decimal number, 305419896, the most significant digit is 3, and the least significant digit is 6). A stream using the littleEndian byte order (the least significant byte first) writes: 78 56 34 12"/>
<page href="flash/utils/Proxy.html" title="Proxy class" text="Proxy The Proxy class lets you override the default behavior of ActionScript operations (such as retrieving and modifying properties) on an object. The Proxy class has no constructor, and you should not attempt to instantiate Proxy. Instead, subclass the Proxy class to override methods such as getProperty and provide custom behavior. If you try to use a method of the Proxy class without overriding the method, an exception is thrown. And, keep in mind, your own code overriding the methods of the Proxy class can throw exceptions unintentionally. Throwing exceptions when using these methods causes problems because the calling code (using operators like in, is, delete and others) does not expect exceptions. Unless you're already sure your overriding method does not throw exceptions, Adobe recommends using try..catch statements around your implementation of the Proxy class to avoid fatal errors when operators call your methods. For example: dynamic class MyProxy extends Proxy { flash_proxy override function callProperty(name:~~, ...rest):~~ { try { // custom code here } catch (e:Error) { // respond to error here } } The Proxy class is a replacement for the Object.__resolve and Object.addProperty features of ActionScript 2.0, which are no longer available in ActionScript 3.0. The Object.addProperty() feature allowed you to dynamically create get and set methods in ActionScript 2.0. Although ActionScript 3.0 provides get and set methods at compile time, you cannot dynamically assign one to an object unless you use the Proxy class. To avoid collisions with the public namespace, the methods of the Proxy class are in the flash_proxy namespace. Where methods of the Proxy class take a name argument, name can be either a String or a QName object (if namespaces are being used)."/>
<page href="flash/utils/Proxy.html#callProperty()" title="Proxy.callProperty()" text="callProperty Overrides the behavior of an object property that can be called as a function. When a method of the object is invoked, this method is called. While some objects can be called as functions, some object properties can also be called as functions. name rest The name of the method being invoked. An array specifying the arguments to the called method."/>
<page href="flash/utils/Proxy.html#deleteProperty()" title="Proxy.deleteProperty()" text="deleteProperty Overrides the request to delete a property. When a property is deleted with the delete operator, this method is called to perform the deletion. name The name of the property to delete."/>
<page href="flash/utils/Proxy.html#getDescendants()" title="Proxy.getDescendants()" text="getDescendants Overrides the use of the descendant operator. When the descendant operator is used, this method is invoked. name The name of the property to descend into the object and search for."/>
<page href="flash/utils/Proxy.html#getProperty()" title="Proxy.getProperty()" text="getProperty Overrides any request for a property's value. If the property can't be found, the method returns undefined. For more information on this behavior, see the ECMA-262 Language Specification, 3rd Edition, section 8.6.2.1. name The name of the property to retrieve."/>
<page href="flash/utils/Proxy.html#hasProperty()" title="Proxy.hasProperty()" text="hasProperty Overrides a request to check whether an object has a particular property by name. name The name of the property to check for."/>
<page href="flash/utils/Proxy.html#isAttribute()" title="Proxy.isAttribute()" text="isAttribute Checks whether a supplied QName is also marked as an attribute. name The name of the property to check."/>
<page href="flash/utils/Proxy.html#nextName()" title="Proxy.nextName()" text="nextName Allows enumeration of the proxied object's properties by index number to retrieve property names. However, you cannot enumerate the properties of the Proxy class themselves. This function supports implementing for...in and for each..in loops on the object to retrieve the desired names. For example (with code from Proxy.nextNameIndex()): protected var _item:Array; // array of object's properties override flash_proxy function nextNameIndex (index:int):int { // initial call if (index == 0) { _item = new Array(); for (var x:~~ in _target) { _item.push(x); } } if (index &lt; _item.length) { return index + 1; } else { return 0; } } override flash_proxy function nextName(index:int):String { return _item[index - 1]; } index The zero-based index value of the object's property."/>
<page href="flash/utils/Proxy.html#nextNameIndex()" title="Proxy.nextNameIndex()" text="nextNameIndex Allows enumeration of the proxied object's properties by index number. Hhowever, you cannot enumerate the properties of the Proxy class themselves. This function supports implementing for...in and for each..in loops on the object to retrieve property index values. For example: protected var _item:Array; // array of object's properties override flash_proxy function nextNameIndex (index:int):int { // initial call if (index == 0) { _item = new Array(); for (var x:~~ in _target) { _item.push(x); } } if (index &lt; _item.length) { return index + 1; } else { return 0; } } override flash_proxy function nextName(index:int):String { return _item[index - 1]; } index The zero-based index value where the enumeration begins."/>
<page href="flash/utils/Proxy.html#nextValue()" title="Proxy.nextValue()" text="nextValue Allows enumeration of the proxied object's properties by index number to retrieve property values. However, you cannot enumerate the properties of the Proxy class themselves. This function supports implementing for...in and for each..in loops on the object to retrieve the desired values. For example (with code from Proxy.nextNameIndex()): protected var _item:Array; // array of object's properties override flash_proxy function nextNameIndex (index:int):int { // initial call if (index == 0) { _item = new Array(); for (var x:~~ in _target) { _item.push(x); } } if (index &lt; _item.length) { return index + 1; } else { return 0; } } override flash_proxy function nextName(index:int):String { return _item[index - 1]; } index The zero-based index value of the object's property."/>
<page href="flash/utils/Proxy.html#setProperty()" title="Proxy.setProperty()" text="setProperty Overrides a call to change a property's value. If the property can't be found, this method creates a property with the specified name and value. name value The name of the property to modify. The value to set the property to."/>
<page href="flash/utils/ByteArray.html" title="ByteArray class" text="ByteArray The ByteArray class provides methods and properties to optimize reading, writing, and working with binary data. Note: The ByteArray class is for advanced ActionScript developers who need to access data on the byte level. In-memory data is a packed array (the most compact representation for the data type) of bytes, but an instance of the ByteArray class can be manipulated with the standard ActionScript [] (array access) operators. It also can be read and written to as an in-memory file, using methods similar to those in the URLStream and Socket classes. In addition, zlib compression and decompression are supported, as well as Action Message Format (AMF) object serialization. Possible uses of the ByteArray class include the following: Creating a custom protocol to connect to a server. Writing your own URLEncoder/URLDecoder. Writing your own AMF/Remoting packet. Optimizing the size of your data by using data types."/>
<page href="flash/utils/ByteArray.html#ByteArray()" title="ByteArray.ByteArray()" text="ByteArray Creates a ByteArray instance representing a packed array of bytes, so that you can use the methods and properties in this class to optimize your data storage and stream."/>
<page href="flash/utils/ByteArray.html#compress()" title="ByteArray.compress()" text="compress Compresses the byte array using the zlib compressed data format. The entire byte array is compressed. After the call, the length property of the ByteArray is set to the new length. The position property is set to the end of the byte array. The zlib compressed data format is described at http://www.ietf.org/rfc/rfc1950.txt."/>
<page href="flash/utils/ByteArray.html#readBoolean()" title="ByteArray.readBoolean()" text="readBoolean Reads a Boolean value from the byte stream. A single byte is read, and true is returned if the byte is nonzero, false otherwise. There is not sufficient data available to read."/>
<page href="flash/utils/ByteArray.html#readByte()" title="ByteArray.readByte()" text="readByte Reads a signed byte from the byte stream. The returned value is in the range -128 to 127. There is not sufficient data available to read."/>
<page href="flash/utils/ByteArray.html#readBytes()" title="ByteArray.readBytes()" text="readBytes Reads the number of data bytes, specified by the length parameter, from the byte stream. The bytes are read into the ByteArray object specified by the bytes parameter, and the bytes are written into the destination ByteArray starting at the position specified by offset. bytes offset length The ByteArray object to read data into. The offset (position) in bytes at which the read data should be written. The number of bytes to read. The default value of 0 causes all available data to be read. There is not sufficient data available to read."/>
<page href="flash/utils/ByteArray.html#readDouble()" title="ByteArray.readDouble()" text="readDouble Reads an IEEE 754 double-precision (64-bit) floating-point number from the byte stream. There is not sufficient data available to read."/>
<page href="flash/utils/ByteArray.html#readFloat()" title="ByteArray.readFloat()" text="readFloat Reads an IEEE 754 single-precision (32-bit) floating-point number from the byte stream. There is not sufficient data available to read."/>
<page href="flash/utils/ByteArray.html#readInt()" title="ByteArray.readInt()" text="readInt Reads a signed 32-bit integer from the byte stream. The returned value is in the range -2147483648 to 2147483647. There is not sufficient data available to read."/>
<page href="flash/utils/ByteArray.html#readMultiByte()" title="ByteArray.readMultiByte()" text="readMultiByte Reads a multibyte string of specified length from the byte stream using the specified character set. length charSet The number of bytes from the byte stream to read. The string denoting the character set to use to interpret the bytes. Possible character set strings include &quot;shift-jis&quot;, &quot;cn-gb&quot;, &quot;iso-8859-1&quot;, and others. For a complete list, see Supported Character Sets. Note: If the value for the charSet parameter is not recognized by the current system, then Flash Player uses the system's default code page as the character set. For example, a value for the charSet parameter, as in myTest.readMultiByte(22, &quot;iso-8859-01&quot;) that uses 01 instead of 1 might work on your development machine, but not on another machine. On the other machine, Flash Player will use the system's default code page. There is not sufficient data available to read."/>
<page href="flash/utils/ByteArray.html#readObject()" title="ByteArray.readObject()" text="readObject Reads an object from the byte array, encoded in AMF serialized format. There is not sufficient data available to read."/>
<page href="flash/utils/ByteArray.html#readShort()" title="ByteArray.readShort()" text="readShort Reads a signed 16-bit integer from the byte stream. The returned value is in the range -32768 to 32767. There is not sufficient data available to read."/>
<page href="flash/utils/ByteArray.html#readUnsignedByte()" title="ByteArray.readUnsignedByte()" text="readUnsignedByte Reads an unsigned byte from the byte stream. The returned value is in the range 0 to 255. There is not sufficient data available to read."/>
<page href="flash/utils/ByteArray.html#readUnsignedInt()" title="ByteArray.readUnsignedInt()" text="readUnsignedInt Reads an unsigned 32-bit integer from the byte stream. The returned value is in the range 0 to 4294967295. There is not sufficient data available to read."/>
<page href="flash/utils/ByteArray.html#readUnsignedShort()" title="ByteArray.readUnsignedShort()" text="readUnsignedShort Reads an unsigned 16-bit integer from the byte stream. The returned value is in the range 0 to 65535. There is not sufficient data available to read."/>
<page href="flash/utils/ByteArray.html#readUTF()" title="ByteArray.readUTF()" text="readUTF Reads a UTF-8 string from the byte stream. The string is assumed to be prefixed with an unsigned short indicating the length in bytes. There is not sufficient data available to read."/>
<page href="flash/utils/ByteArray.html#readUTFBytes()" title="ByteArray.readUTFBytes()" text="readUTFBytes Reads a sequence of UTF-8 bytes specified by the length parameter from the byte stream and returns a string. length An unsigned short indicating the length of the UTF-8 bytes. There is not sufficient data available to read."/>
<page href="flash/utils/ByteArray.html#toString()" title="ByteArray.toString()" text="toString Converts the byte array to a string. If the data in the array begins with a Unicode byte order mark, Flash will honor that mark when converting to a string. If System.useCodePage is set to true, the player will treat the data in the array as being in the current system code page when converting."/>
<page href="flash/utils/ByteArray.html#uncompress()" title="ByteArray.uncompress()" text="uncompress Decompresses the byte array. The byte array must have been compressed using the zlib compressed data format. After the call, the length property of the ByteArray is set to the new length. The position property is set to 0. The zlib compressed data format is described at http://www.ietf.org/rfc/rfc1950.txt."/>
<page href="flash/utils/ByteArray.html#writeBoolean()" title="ByteArray.writeBoolean()" text="writeBoolean Writes a Boolean value. A single byte is written according to the value parameter, either 1 if true or 0 if false. value A Boolean value determining which byte is written. If the parameter is true, Flash Player writes a 1; if false, Flash Player writes a 0."/>
<page href="flash/utils/ByteArray.html#writeByte()" title="ByteArray.writeByte()" text="writeByte Writes a byte to the byte stream. The low 8 bits of the parameter are used. The high 24 bits are ignored. value A 32-bit integer. The low 8 bits are written to the byte stream."/>
<page href="flash/utils/ByteArray.html#writeBytes()" title="ByteArray.writeBytes()" text="writeBytes Writes a sequence of length bytes from the specified byte array, bytes, starting offset (zero-based index) bytes into the byte stream. If the length parameter is omitted, the default length of 0 is used; Flash Player writes the entire buffer starting at offset. If the offset parameter is also omitted, the entire buffer is written. If offset or length is out of range, they are clamped to the beginning and end of the bytes array. bytes offset length The ByteArray object. A zero-based index indicating the position into the array to begin writing. An unsigned integer indicating how far into the buffer to write."/>
<page href="flash/utils/ByteArray.html#writeDouble()" title="ByteArray.writeDouble()" text="writeDouble Writes an IEEE 754 double-precision (64-bit) floating-point number to the byte stream. value A double-precision (64-bit) floating-point number."/>
<page href="flash/utils/ByteArray.html#writeFloat()" title="ByteArray.writeFloat()" text="writeFloat Writes an IEEE 754 single-precision (32-bit) floating-point number to the byte stream. value A single-precision (32-bit) floating-point number."/>
<page href="flash/utils/ByteArray.html#writeInt()" title="ByteArray.writeInt()" text="writeInt Writes a 32-bit signed integer to the byte stream. value An integer to write to the byte stream."/>
<page href="flash/utils/ByteArray.html#writeMultiByte()" title="ByteArray.writeMultiByte()" text="writeMultiByte Writes a multibyte string to the byte stream using the specified character set. value charSet The string value to be written. The string denoting the character set to use. Possible character set strings include &quot;shift-jis&quot;, &quot;cn-gb&quot;, &quot;iso-8859-1&quot;, and others. For a complete list, see Supported Character Sets."/>
<page href="flash/utils/ByteArray.html#writeObject()" title="ByteArray.writeObject()" text="writeObject Writes an object into the byte array in AMF serialized format. object The object to serialize."/>
<page href="flash/utils/ByteArray.html#writeShort()" title="ByteArray.writeShort()" text="writeShort Writes a 16-bit integer to the byte stream. The low 16 bits of the parameter are used. The high 16 bits are ignored. value 32-bit integer, whose low 16 bits are written to the byte stream."/>
<page href="flash/utils/ByteArray.html#writeUnsignedInt()" title="ByteArray.writeUnsignedInt()" text="writeUnsignedInt Writes a 32-bit unsigned integer to the byte stream. value An unsigned integer to write to the byte stream."/>
<page href="flash/utils/ByteArray.html#writeUTF()" title="ByteArray.writeUTF()" text="writeUTF Writes a UTF-8 string to the byte stream. The length of the UTF-8 string in bytes is written first, as a 16-bit integer, followed by the bytes representing the characters of the string. value The string value to be written. If the length is larger than 65535."/>
<page href="flash/utils/ByteArray.html#writeUTFBytes()" title="ByteArray.writeUTFBytes()" text="writeUTFBytes Writes a UTF-8 string to the byte stream. Similar to the writeUTF() method, but writeUTFBytes() does not prefix the string with a 16-bit length word. value The string value to be written."/>
<page href="flash/utils/ByteArray.html#bytesAvailable" title="ByteArray.bytesAvailable" text="bytesAvailable The number of bytes of data available for reading from the current position in the byte array to the end of the array. Use the bytesAvailable property in conjunction with the read methods each time you access a ByteArray object to ensure that you are reading valid data."/>
<page href="flash/utils/ByteArray.html#defaultObjectEncoding" title="ByteArray.defaultObjectEncoding" text="defaultObjectEncoding Denotes the default object encoding for the ByteArray class to use for a new ByteArray instance. When you create a new ByteArray instance, the encoding on that instance starts with the value of defaultObjectEncoding. The defaultObjectEncoding property is initialized to ObjectEncoding.AMF3. When an object is written to or read from binary data, the objectEncoding value is used to determine whether the ActionScript 3.0, ActionScript2.0, or ActionScript 1.0 format should be used. The value is a constant from the ObjectEncoding class."/>
<page href="flash/utils/ByteArray.html#endian" title="ByteArray.endian" text="endian Changes or reads the byte order for the data; either &quot;bigEndian&quot; or &quot;littleEndian&quot;. The values are constants from the Endian class."/>
<page href="flash/utils/ByteArray.html#length" title="ByteArray.length" text="length The length of the ByteArray object, in bytes. If the length is set to a value that is larger than the current length, Flash Player fills the right side with zeros. If the length is set to a value that is smaller than the current length, the array is truncated."/>
<page href="flash/utils/ByteArray.html#objectEncoding" title="ByteArray.objectEncoding" text="objectEncoding Used to determine whether the ActionScript 3.0, ActionScript 2.0, or ActionScript 1.0 format should be used when writing to, or reading from, a ByteArray instance. The value is a constant from the ObjectEncoding class."/>
<page href="flash/utils/ByteArray.html#position" title="ByteArray.position" text="position Moves, or returns the current position, in bytes, of the file pointer into the ByteArray object. This is the point at which the next call to a read method starts reading or a write method starts writing."/>
<page href="flash/utils/IExternalizable.html" title="IExternalizable interface" text="IExternalizable The IExternalizable interface provides control over serialization of a class as it is encoded into a data stream. The writeExternal() and readExternal() methods of the IExternalizable interface are implemented by a class to allow customization of the contents and format of the data stream (but not the classname or type) for an object and its supertypes. Each individual class must serialize and reconstruct the state of its instances. These methods must be symmetrical with the supertype to save its state. These methods supercede the native Action Message Format (AMF) serialization behavior. If a class does not implement, nor inherits from a class which implements, the IExternalizable interface, then an instance of the class will be serialized using the default mechanism of public members only. As a result, private, internal, and protected members of a class will not be available. To serialize private members, a class must use the IExternalizable interface. For example, the following class will not serialize any of its members because they are private: class Example { private var one:int; private var two:int; } However, if you implement the IExternalizable interface, you can write to, and read from, the data stream the private members of the class as follows: class Example implement IExternalizable { private var one:int; private var two:int; public function writeExternal(output:IDataOutput) { output.writeInt(one); output.writeInt(two); } public function readExternal(input:IDataInput) { one = input.readInt(); two = input.readInt(); } } Note: If a class implements IExternalizable the default serialization no longer applies to instances of that class. If that class inherits public members from a super class, you must carefully manage those members as well. When a subclass of a class implementing IExternalizable has private members of its own, the subclass must override the methods of IExternalizable, as follows: public class Base implements IExternalizable { private var one:Boolean; public function writeExternal(output:IDataOutput):void { output.writeBoolean(one); } public function readExternal(input:IDataInput):void { one = input.readBoolean(); } } public class Example extends Base { private var one:String; public override function writeExternal(output:IDataOutput):void { super.writeExternal(output); output.writeUTF(one); } public override function readExternal(input:IDataInput):void { super.readExternal(input); one = input.readUTF(); } } The IExternalizable interface can also be used to compress data before writing it to a data stream. For example: class Example implements IExternalizable { public var one:Boolean; public var two:Boolean; public var three:Boolean; public var four:Boolean; public var five:Boolean; public var six:Boolean; public var seven:Boolean; public var eight:Boolean; public function writeExternal(output:IDataOutput) { var flag:int = 0; if (one) flag |= 1; if (two) flag |= 2; if (three) flag |= 4; if (four) flag |= 8; if (five) flag |= 16; if (six) flag |= 32; if (seven) flag |= 64; if (eight) flag |= 128; output.writeByte(flag); } public function readExternal(input:IDataInput) { var flag:int = input.readByte(); one = (flag &amp; 1) != 0; two = (flag &amp; 2) != 0; three = (flag &amp; 4) != 0; four = (flag &amp; 8) != 0; five = (flag &amp; 16) != 0; six = (flag &amp; 32) != 0; seven = (flag &amp; 64) != 0; eight = (flag &amp; 128) != 0; } }"/>
<page href="flash/utils/IExternalizable.html#readExternal()" title="IExternalizable.readExternal()" text="readExternal A class implements this method to decode itself from a data stream by calling the methods of the IDataInput interface. This method must read the values in the same sequence and with the same types as were written by the writeExternal() method. input The name of the class that implements the IDataInput interface."/>
<page href="flash/utils/IExternalizable.html#writeExternal()" title="IExternalizable.writeExternal()" text="writeExternal A class implements this method to encode itself for a data stream by calling the methods of the IDataOutput interface. output The name of the class that implements the IDataOutput interface."/>
<page href="fl/managers/IFocusManagerComponent.html" title="IFocusManagerComponent interface" text="IFocusManagerComponent The IFocusManagerComponent interface provides methods and properties that give components the capability to receive focus. Components must implement this interface to receive focus from the FocusManager. The UIComponent class provides a base implementation of this interface but does not fully implement it because not all UIComponent objects receive focus. Components that are derived from the UIComponent class must implement this interface to be capable of receiving focus. To enable focus, add the statement implements IFocusManagerComponent to the class definition of a component that is derived from the UIComponent class."/>
<page href="fl/managers/IFocusManagerComponent.html#drawFocus()" title="IFocusManagerComponent.drawFocus()" text="drawFocus Draws a visual focus indicator. This method is called by the focus manager when the component receives focus. The component should draw or hide a graphic that indicates that the component has focus. draw If true, draw the focus indicator, otherwise hide it."/>
<page href="fl/managers/IFocusManagerComponent.html#setFocus()" title="IFocusManagerComponent.setFocus()" text="setFocus Sets focus for a component. This method is called by the focus manager when the component receives focus. The component may in turn set focus to an internal component."/>
<page href="fl/managers/IFocusManagerComponent.html#focusEnabled" title="IFocusManagerComponent.focusEnabled" text="focusEnabled Gets or sets a Boolean value that indicates whether a selected component can receive focus from the focus manager. To make a component capable of receiving focus from the focus manager, set this property to true. To make the component incapable of receiving focus, set this property to false. When focusEnabled is set to false, the focus manager ignores the component over the component's lifetime and does not monitor it for changes in the following properties: tabEnabled, tabChildren, and mouseFocusEnabled. You can use the focusEnabled property to prevent the child component of a component that implements the IFocusManagerComponent interface from receiving focus from the focus manager. To do so, set this property to false before using the addChild() method to add the child component to the display list. Note that if you set this property to false before adding the component to the display list, the focus manager will continue to ignore the component even if you set this property to true later on. Note: Even if you set this property to false, you can still set focus programmatically by using the setFocus() method."/>
<page href="fl/managers/IFocusManagerComponent.html#mouseFocusEnabled" title="IFocusManagerComponent.mouseFocusEnabled" text="mouseFocusEnabled Gets a Boolean value that indicates whether a component that is selected by using a mouse device can receive focus. Set this property to true to give focus to components that are selected by using a mouse device. Set this property to false to prevent focus from being given to components that are selected by using a mouse device. If this property is set to false when a component is selected by using a mouse device, focus is transferred to the first parent component for which this property is set to true."/>
<page href="fl/managers/IFocusManagerComponent.html#tabEnabled" title="IFocusManagerComponent.tabEnabled" text="tabEnabled Gets a Boolean value that indicates whether pressing the Tab key can move focus to this component. A value of true indicates that pressing the Tab key can cause focus to be moved to this component; a value of false indicates that the Tab key cannot be used to give this component focus. Even if this value is set to false, the component can still receive focus when it is selected by a mouse device or through a call to the setFocus() method."/>
<page href="fl/managers/IFocusManagerComponent.html#tabIndex" title="IFocusManagerComponent.tabIndex" text="tabIndex Gets the order in which the component receives focus, if tabEnabledis set to true. The tabIndex property is -1 by default, meaning that no tab index is set for the object and that the object receives focus based on z-order. The tabIndex property can also be a non-negative integer. In this case, 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 comes first in the default tab ordering precedes the other."/>
<page href="fl/managers/IFocusManager.html" title="IFocusManager interface" text="IFocusManager Implement the IFocusManager interface to create a custom focus manager. A focus manager enables an application to transfer focus among components when the user moves the mouse or presses the Tab key."/>
<page href="fl/managers/IFocusManager.html#activate()" title="IFocusManager.activate()" text="activate Activates a focus manager. When multiple DisplayObjectContainer objects are displayed on the screen at the same time, the system manager activates and deactivates their FocusManager objects as focus moves from one container to the next. When focus moves to a component in an DisplayObjectContainer object whose focus manager is deactivated, the system manager activates that focus manager by making a call to the activate() method. Only one focus manager is active at a time; before activating a focus manager the system manager uses the deactivate() method to deactivate an active focus manager whose components have lost focus."/>
<page href="fl/managers/IFocusManager.html#deactivate()" title="IFocusManager.deactivate()" text="deactivate Deactivates a focus manager. When multiple DisplayObjectContainer objects are displayed on the screen at the same time, the system manager activates and deactivates their FocusManager objects as focus moves from one container to the next. When focus moves to a component in an DisplayObjectContainer object whose focus manager is deactivated, the system manager activates that focus manager by making a call to the activate() method. Only one focus manager is active at a time; before activating a focus manager the system manager uses the deactivate() method to deactivate an active focus manager whose components have lost focus."/>
<page href="fl/managers/IFocusManager.html#findFocusManagerComponent()" title="IFocusManager.findFocusManagerComponent()" text="findFocusManagerComponent Retrieves the IFocusManagerComponent object that contains the specified object, if there is one. Flash Player can set focus on subcomponents as well as on components themselves. This method is used to find the component that either has focus or contains the subcomponent that has focus. component An object that can have Flash Player-level focus."/>
<page href="fl/managers/IFocusManager.html#getFocus()" title="IFocusManager.getFocus()" text="getFocus Retrieves the IFocusManagerComponent component that currently has focus. Use this method to determine which component has focus. Using the Stage object to find out which component has focus may result in the return of the subcomponent of the component that has focus."/>
<page href="fl/managers/IFocusManager.html#getNextFocusManagerComponent()" title="IFocusManager.getNextFocusManagerComponent()" text="getNextFocusManagerComponent Retrieves the component that receives focus next if the user causes focus to move by using the Tab key. This method can be used to detect the next component to receive focus in the tab loop if focus moves by one element in either a forward or backward direction. If the application does not contain other valid components, this method retrieves the current component that has focus. backward Indicates whether focus moves in a backward direction through the tab loop. If this value is true, this method returns the component that would have focus if focus were moved in a backward direction by the user pressing the Shift+Tab key combination."/>
<page href="fl/managers/IFocusManager.html#hideFocus()" title="IFocusManager.hideFocus()" text="hideFocus Sets the showFocusIndicator property to false. If a component that has focus is marked with a visual indicator of focus, this method removes that indicator."/>
<page href="fl/managers/IFocusManager.html#setFocus()" title="IFocusManager.setFocus()" text="setFocus Sets focus to an IFocusManagerComponent component. This method does not check for component visibility, enabled state, or any other conditions. o The component that is to receive focus."/>
<page href="fl/managers/IFocusManager.html#showFocus()" title="IFocusManager.showFocus()" text="showFocus Sets the showFocusIndicator property to true. If a component has focus, this method draws the visual focus indicator on that component."/>
<page href="fl/managers/IFocusManager.html#defaultButton" title="IFocusManager.defaultButton" text="defaultButton Gets or sets a reference to the default button. The default button serves as a proxy button for any component that has focus when the Enter key is pressed. The pressing of the Enter key triggers a click event to be dispatched on the default button on behalf of the component that has focus. Button components do not require default buttons. When focus moves to a Button component it cannot trigger the default button; if focus moves from a Button component to a component that is not a button, the default button may be triggered again."/>
<page href="fl/managers/IFocusManager.html#defaultButtonEnabled" title="IFocusManager.defaultButtonEnabled" text="defaultButtonEnabled Gets or sets a value that indicates whether the default button is enabled. If this value is set to true, the focus manager monitors the Enter key and dispatches a click event on the default button if the Enter key is pressed when a component that is not a Button component has focus. If this value is set to false, the focus manager does not monitor the Enter key. Components that use the Enter key set this property to false to prevent a click event from being dispatched on the default button, if one exists, when a user presses the Enter key."/>
<page href="fl/managers/IFocusManager.html#nextTabIndex" title="IFocusManager.nextTabIndex" text="nextTabIndex Gets the next unique tab index to use in the current tab loop. A tab loop includes one or more components that are managed by a focus manager."/>
<page href="fl/managers/IFocusManager.html#showFocusIndicator" title="IFocusManager.showFocusIndicator" text="showFocusIndicator Gets or sets a value that determines whether the user interface changes to indicate that a specific component has focus. If this property is set to true, a component that has focus is marked with a visual indicator. If it is set to false, a visual indicator of focus is not used. By default, this property is set to false until the user presses the Tab key; then it is set to true."/>
<page href="fl/managers/StyleManager.html" title="StyleManager class" text="StyleManager The StyleManager class provides static methods that can be used to get and set styles for a component instance, an entire component type, or all user interface components in a Flash document. Styles are defined as values that affect the display of a component, including padding, text formats, and skins."/>
<page href="fl/managers/StyleManager.html#StyleManager()" title="StyleManager.StyleManager()" text="StyleManager Creates a new StyleManager object."/>
<page href="fl/managers/StyleManager.html#clearComponentStyle()" title="StyleManager.clearComponentStyle()" text="clearComponentStyle Removes a style from the specified component. component name The name of the component from which the style is to be removed. The name of the style to be removed."/>
<page href="fl/managers/StyleManager.html#clearStyle()" title="StyleManager.clearStyle()" text="clearStyle Removes a global style from all user interface components in a document. name The name of the global style to be removed."/>
<page href="fl/managers/StyleManager.html#getComponentStyle()" title="StyleManager.getComponentStyle()" text="getComponentStyle Gets a style that exists on a specific component. component name The name of the component instance on which to find the requested style. The name of the style to be retrieved."/>
<page href="fl/managers/StyleManager.html#getStyle()" title="StyleManager.getStyle()" text="getStyle Gets a global style by name. name The name of the style to be retrieved."/>
<page href="fl/managers/StyleManager.html#registerInstance()" title="StyleManager.registerInstance()" text="registerInstance Registers a component instance with the style manager. After a component instance is instantiated, it can register with the style manager to be notified of changes in style. Component instances can register to receive notice of style changes that are component-based or global in nature. instance The component instance to be registered for style management."/>
<page href="fl/managers/StyleManager.html#setComponentStyle()" title="StyleManager.setComponentStyle()" text="setComponentStyle Sets a style on all instances of a component type, for example, on all instances of a Button component, or on all instances of a ComboBox component. component name style The type of component, for example, Button or ComboBox. This parameter also accepts a component instance or class that can be used to identify all instances of a component type. The name of the style to be set. The style object that describes the style that is to be set."/>
<page href="fl/managers/StyleManager.html#setStyle()" title="StyleManager.setStyle()" text="setStyle Sets a global style for all user interface components in a document. name style A String value that names the style to be set. The style object to be set. The value of this property depends on the style that the user sets. For example, if the style is set to &quot;textFormat&quot;, the style property should be set to a TextFormat object. A mismatch between the style name and the value of the style property may cause the component to behave incorrectly."/>
<page href="fl/managers/FocusManager.html" title="FocusManager class" text="FocusManager The FocusManager class manages focus for a set of components that are navigated by mouse or keyboard as a tab loop. A tab loop is typically navigated by using the Tab key; focus moves between the components in the tab loop in a circular pattern from the first component that has focus, to the last, and then back again to the first. A tab loop includes all the components and tab-enabled components in a container. An application can contain numerous tab loops. A FocusManager instance is responsible for a single tab loop; an application uses a different FocusManager instance to manage each tab loop that it contains, although a main application is always associated with at least one FocusManager instance. An application may require additional FocusManager instances if it includes a popup window, for example, that separately contains one or more tab loops of components. All components that can be managed by a FocusManager instance must implement the fl.managers.IFocusManagerComponent interface. Objects for which Flash Player manages focus are not required to implement the IFocusManagerComponent interface. The FocusManager class also manages how the default button is implemented. A default button dispatches a click event when the Enter key is pressed on a form, depending on where focus is at the time. The default button does not dispatch the click event if a text area has focus or if a value is being edited in a component, for example, in a ComboBox or NumericStepper component."/>
<page href="fl/managers/FocusManager.html#FocusManager()" title="FocusManager.FocusManager()" text="FocusManager Creates a new FocusManager instance. A focus manager manages focus within the children of a DisplayObjectContainer object. container A DisplayObjectContainer that hosts the focus manager, or stage."/>
<page href="fl/managers/FocusManager.html#activate()" title="FocusManager.activate()" text="activate Activates the FocusManager instance. The FocusManager instance adds event handlers that allow it to monitor focus-related keyboard and mouse activity."/>
<page href="fl/managers/FocusManager.html#deactivate()" title="FocusManager.deactivate()" text="deactivate Deactivates the FocusManager. The FocusManager removes the event handlers that allow it to monitor focus-related keyboard and mouse activity."/>
<page href="fl/managers/FocusManager.html#findFocusManagerComponent()" title="FocusManager.findFocusManagerComponent()" text="findFocusManagerComponent Retrieves the interactive object that contains the given object, if any. The player can set focus to a subcomponent of a Flash component; this method determines which interactive object has focus from the component perspective. component An object that can have player-level focus."/>
<page href="fl/managers/FocusManager.html#getFocus()" title="FocusManager.getFocus()" text="getFocus Gets the interactive object that currently has focus. Adobe recommends calling this method instead of using the Stage object because this method indicates which component has focus. The Stage might return a subcomponent in that component."/>
<page href="fl/managers/FocusManager.html#getNextFocusManagerComponent()" title="FocusManager.getNextFocusManagerComponent()" text="getNextFocusManagerComponent Retrieves the interactive object that would receive focus if the user pressed the Tab key to navigate to the next object. This method retrieves the object that currently has focus if there are no other valid objects in the application. backward If this parameter is set to true, focus moves in a backward direction, causing this method to retrieve the object that would receive focus next if the Shift+Tab key combination were pressed."/>
<page href="fl/managers/FocusManager.html#hideFocus()" title="FocusManager.hideFocus()" text="hideFocus Sets the showFocusIndicator value to false and removes the visual focus indicator from the object that has focus, if any."/>
<page href="fl/managers/FocusManager.html#setFocus()" title="FocusManager.setFocus()" text="setFocus Sets focus on an IFocusManagerComponent component. This method does not check for component visibility, enabled state, or other conditions. component An object that can receive focus."/>
<page href="fl/managers/FocusManager.html#showFocus()" title="FocusManager.showFocus()" text="showFocus Sets the showFocusIndicator value to true and draws the visual focus indicator on the object with focus, if any."/>
<page href="fl/managers/FocusManager.html#defaultButton" title="FocusManager.defaultButton" text="defaultButton Gets or sets the current default button. The default button is the button on a form that dispatches a click event when the Enter key is pressed, depending on where focus is at the time."/>
<page href="fl/managers/FocusManager.html#defaultButtonEnabled" title="FocusManager.defaultButtonEnabled" text="defaultButtonEnabled Gets or sets a value that indicates whether the default button is enabled. If this value is set to true, the focus manager monitors the Enter key and dispatches a click event on the default button if the Enter key is pressed when a component that is not a Button component has focus. If this value is set to false, the focus manager does not monitor the Enter key. Components that use the Enter key set this property to false to prevent a click event from being dispatched on the default button, if one exists, when a user presses the Enter key."/>
<page href="fl/managers/FocusManager.html#nextTabIndex" title="FocusManager.nextTabIndex" text="nextTabIndex Gets the next unique tab index to use in this tab loop."/>
<page href="fl/managers/FocusManager.html#showFocusIndicator" title="FocusManager.showFocusIndicator" text="showFocusIndicator Gets or sets a value that indicates whether a component that has focus should be marked with a visual indicator of focus."/>
<page href="fl/managers/IFocusManagerGroup.html" title="IFocusManagerGroup interface" text="IFocusManagerGroup The IFocusManagerGroup interface provides properties that are used to manage a set of components of which only one can be selected at a time. Components that are part of such a component set must implement this interface. A radio button, for example, must implement the IFocusManagerGroup interface because only one radio button can be selected from a group of radio button components at a time. The focus manager ensures that focus is not given to a radio button that is not selected when focus moves in response to the Tab key."/>
<page href="fl/managers/IFocusManagerGroup.html#groupName" title="IFocusManagerGroup.groupName" text="groupName Gets or sets the name of the group of components to which this component belongs."/>
<page href="fl/managers/IFocusManagerGroup.html#selected" title="IFocusManagerGroup.selected" text="selected Gets or sets a Boolean value that indicates whether this component is selected. A value of true indicates that the component is selected; a value of false indicates that it is not selected."/>
<page href="flash/media/Camera.html" title="Camera class" text="Camera Use the Camera class to capture video from a camera attached to a computer running Flash Player. Use the Video class to monitor the video locally. Use the NetConnection and NetStream classes to transmit the video to Flash Media Server. Flash Media Server can send the video stream to other servers and broadcast it to other clients running Flash Player. For information about capturing audio, see the Microphone class. Important: Flash Player displays a Privacy dialog box that lets the user choose whether to allow or deny access to the camera. Make sure your application window size is at least 215 x 138 pixels; this is the minimum size required to display the dialog box. To create or reference a Camera object, use the getCamera() method."/>
<page href="flash/media/Camera.html#getCamera()" title="Camera.getCamera()" text="getCamera Returns a reference to a Camera object for capturing video. To begin capturing the video, you must attach the Camera object to a Video object (see Video.attachCamera() ). To transmit video to Flash Media Server, call NetStream.attachCamera() to attach the Camera object to a NetStream object. Multiple calls to the getCamera() method reference the same camera driver. Thus, if your code contains code like firstCam:Camera = getCamera() and secondCam:Camera = getCamera(), both firstCam and secondCam reference the same camera, which is the user's default camera. In general, you shouldn't pass a value for the name parameter; simply use getCamera() to return a reference to the default camera. By means of the Camera settings panel (discussed later in this section), the user can specify the default camera Flash Player should use. When a SWF file tries to access the camera returned by getCamera(), Flash Player displays a dialog box that lets the user choose whether to allow or deny access to the camera. (Make sure your application window size is at least 215 x 138 pixels; this is the minimum size Flash Player requires to display the dialog box.) When the user responds to this dialog box, Flash Player returns an information object in the status event that indicates the user's response: Camera.muted indicates the user denied access to a camera; Camera.Unmuted indicates the user allowed access to a camera. To determine whether the user has denied or allowed access to the camera without handling the status event, use the muted property. The user can also specify permanent privacy settings for a particular domain by right-clicking (Windows) or Control-clicking (Macintosh) while a SWF file is playing, selecting Settings, opening the Privacy dialog, and selecting Remember. You can't use ActionScript to set the Allow or Deny value for a user, but you can display the Privacy dialog box for the user by calling Security.showSettings(SecurityPanel.PRIVACY). If the user selects Remember, Flash Player no longer asks the user whether to allow or deny SWF files from this domain access to your camera. If getCamera() returns null, either the camera is in use by another application, or there are no cameras installed on the system. To determine whether any cameras are installed, use the names.length property. To display the Flash Player Camera Settings panel, which lets the user choose the camera to be referenced by getCamera(), use System.showSettings(SecurityPanel.CAMERA). Scanning the hardware for cameras takes time. When Flash Player finds at least one camera, the hardware is not scanned again for the lifetime of the player instance. However, if Flash Player doesn't find any cameras, it will scan each time getCamera is called. This is helpful if a user has forgotten to connect the camera; if your SWF file provides a Try Again button that calls getCamera, Flash Player can find the camera without the user having to restart the SWF file. name Specifies which camera to get, as determined from the array returned by the names property. For most applications, get the default camera by omitting this parameter. To specify a value for this parameter, use the string representation of the zero-based index position within the Camera.names array. For example, to specify the third camera in the array, use Camera.getCamera(&quot;2&quot;)."/>
<page href="flash/media/Camera.html#setKeyFrameInterval()" title="Camera.setKeyFrameInterval()" text="setKeyFrameInterval Specifies which video frames are transmitted in full (called keyframes) instead of being interpolated by the video compression algorithm. This method is applicable only if you are transmitting video using Flash Media Server. The Flash Video compression algorithm compresses video by transmitting only what has changed since the last frame of the video; these portions are considered to be interpolated frames. Frames of a video can be interpolated according to the contents of the previous frame. A keyframe, however, is a video frame that is complete; it is not interpolated from prior frames. To determine how to set a value for the keyFrameInterval parameter, consider both bandwidth use and video playback accessibility. For example, specifying a higher value for keyFrameInterval (sending keyframes less frequently) reduces bandwidth use. However, this may increase the amount of time required to position the playhead at a particular point in the video; more prior video frames may have to be interpolated before the video can resume. Conversely, specifying a lower value for keyFrameInterval (sending keyframes more frequently) increases bandwidth use because entire video frames are transmitted more often, but may decrease the amount of time required to seek a particular video frame within a recorded video. keyFrameInterval A value that specifies which video frames are transmitted in full (as keyframes) instead of being interpolated by the video compression algorithm. A value of 1 means that every frame is a keyframe, a value of 3 means that every third frame is a keyframe, and so on. Acceptable values are 1 through 48."/>
<page href="flash/media/Camera.html#setLoopback()" title="Camera.setLoopback()" text="setLoopback Specifies whether to use a compressed video stream for a local view of the camera. This method is applicable only if you are transmitting video using Flash Media Server; setting compress to true lets you see more precisely how the video will appear to users when they view it in real time. Although a compressed stream is useful for testing purposes, such as previewing video quality settings, it has a significant processing cost, because the local view is not simply compressed; it is compressed, edited for transmission as it would be over a live connection, and then decompressed for local viewing. To set the amount of compression used when you set compress to true, use Camera.setQuality(). compress Specifies whether to use a compressed video stream (true) or an uncompressed stream (false) for a local view of what the camera is receiving."/>
<page href="flash/media/Camera.html#setMode()" title="Camera.setMode()" text="setMode Sets the camera capture mode to the native mode that best meets the specified requirements. If the camera does not have a native mode that matches all the parameters you pass, Flash Player selects a capture mode that most closely synthesizes the requested mode. This manipulation may involve cropping the image and dropping frames. By default, Flash Player drops frames as needed to maintain image size. To minimize the number of dropped frames, even if this means reducing the size of the image, pass false for the favorArea parameter. When choosing a native mode, Flash Player tries to maintain the requested aspect ratio whenever possible. For example, if you issue the command myCam.setMode(400, 400, 30), and the maximum width and height values available on the camera are 320 and 288, Flash Player sets both the width and height at 288; by setting these properties to the same value, Flash Player maintains the 1:1 aspect ratio you requested. To determine the values assigned to these properties after Flash Player selects the mode that most closely matches your requested values, use the width, height, and fps properties. If you are using Flash Media Server, you can also capture single frames or create time-lapse photography. For more information, see NetStream.attachCamera(). width height fps favorArea The requested capture width, in pixels. The default value is 160. The requested capture height, in pixels. The default value is 120. The requested rate at which the camera should capture data, in frames per second. The default value is 15. Specifies whether to manipulate the width, height, and frame rate if the camera does not have a native mode that meets the specified requirements. The default value is true, which means that maintaining capture size is favored; using this parameter selects the mode that most closely matches width and height values, even if doing so adversely affects performance by reducing the frame rate. To maximize frame rate at the expense of camera height and width, pass false for the favorArea parameter."/>
<page href="flash/media/Camera.html#setMotionLevel()" title="Camera.setMotionLevel()" text="setMotionLevel Specifies how much motion is required to dispatch the activity event. Optionally sets the number of milliseconds that must elapse without activity before Flash Player considers motion to have stopped and dispatches the event. Note: Video can be displayed regardless of the value of the motionLevel parameter. This parameter determines only when and under what circumstances the event is dispatched—not whether video is actually being captured or displayed. To prevent the camera from detecting motion at all, pass a value of 100 for the motionLevel parameter; the activity event is never dispatched. (You would probably use this value only for testing purposes—for example, to temporarily disable any handlers that would normally be triggered when the event is dispatched.) To determine the amount of motion the camera is currently detecting, use the activityLevel property. Motion sensitivity values correspond directly to activity values. Complete lack of motion is an activity value of 0. Constant motion is an activity value of 100. Your activity value is less than your motion sensitivity value when you're not moving; when you are moving, activity values frequently exceed your motion sensitivity value. This method is similar in purpose to the Microphone.setSilenceLevel() method; both methods are used to specify when the activity event should be dispatched. However, these methods have a significantly different impact on publishing streams: Microphone.setSilenceLevel() is designed to optimize bandwidth. When an audio stream is considered silent, no audio data is sent. Instead, a single message is sent, indicating that silence has started. Camera.setMotionLevel() is designed to detect motion and does not affect bandwidth usage. Even if a video stream does not detect motion, video is still sent. motionLevel timeout Specifies the amount of motion required to dispatch the activity event. Acceptable values range from 0 to 100. The default value is 50. Specifies how many milliseconds must elapse without activity before Flash Player considers activity to have stopped and dispatches the activity event. The default value is 2000 milliseconds (2 seconds)."/>
<page href="flash/media/Camera.html#setQuality()" title="Camera.setQuality()" text="setQuality Sets the maximum amount of bandwidth per second or the required picture quality of the current outgoing video feed. This method is generally applicable only if you are transmitting video using Flash Media Server. Use this method to specify which element of the outgoing video feed is more important to your application—bandwidth use or picture quality. To indicate that bandwidth use takes precedence, pass a value for bandwidth and 0 for quality. Flash Player transmits video at the highest quality possible within the specified bandwidth. If necessary, Flash Player reduces picture quality to avoid exceeding the specified bandwidth. In general, as motion increases, quality decreases. To indicate that quality takes precedence, pass 0 for bandwidth and a numeric value for quality. Flash Player uses as much bandwidth as required to maintain the specified quality. If necessary, Flash Player reduces the frame rate to maintain picture quality. In general, as motion increases, bandwidth use also increases. To specify that both bandwidth and quality are equally important, pass numeric values for both parameters. Flash Player transmits video that achieves the specified quality and that doesn't exceed the specified bandwidth. If necessary, Flash Player reduces the frame rate to maintain picture quality without exceeding the specified bandwidth. bandwidth quality Specifies the maximum amount of bandwidth that the current outgoing video feed can use, in bytes per second. To specify that Flash Player video can use as much bandwidth as needed to maintain the value of quality, pass 0 for bandwidth. The default value is 16384. An integer that specifies the required level of picture quality, as determined by the amount of compression being applied to each video frame. Acceptable values range from 1 (lowest quality, maximum compression) to 100 (highest quality, no compression). To specify that picture quality can vary as needed to avoid exceeding bandwidth, pass 0 for quality."/>
<page href="flash/media/Camera.html#activityLevel" title="Camera.activityLevel" text="activityLevel The amount of motion the camera is detecting. Values range from 0 (no motion is being detected) to 100 (a large amount of motion is being detected). The value of this property can help you determine if you need to pass a setting to the setMotionLevel() method. If the camera is available but is not yet being used because the Video.attachCamera() method has not been called, this property is set to -1. If you are streaming only uncompressed local video, this property is set only if you have assigned a function to the event handler. Otherwise, it is undefined."/>
<page href="flash/media/Camera.html#bandwidth" title="Camera.bandwidth" text="bandwidth The maximum amount of bandwidth the current outgoing video feed can use, in bytes. A value of 0 means the feed can use as much bandwidth as needed to maintain the desired frame quality. To set this property, use the setQuality() method."/>
<page href="flash/media/Camera.html#currentFPS" title="Camera.currentFPS" text="currentFPS The rate at which the camera is capturing data, in frames per second. This property cannot be set; however, you can use the setMode() method to set a related property—fps—which specifies the maximum frame rate at which you would like the camera to capture data."/>
<page href="flash/media/Camera.html#fps" title="Camera.fps" text="fps The maximum rate at which the camera can capture data, in frames per second. The maximum rate possible depends on the capabilities of the camera; this frame rate may not be achieved. To set a desired value for this property, use the setMode() method. To determine the rate at which the camera is currently capturing data, use the currentFPS property."/>
<page href="flash/media/Camera.html#height" title="Camera.height" text="height The current capture height, in pixels. To set a value for this property, use the setMode() method."/>
<page href="flash/media/Camera.html#index" title="Camera.index" text="index A zero-based integer that specifies the index of the camera, as reflected in the array returned by the names property."/>
<page href="flash/media/Camera.html#keyFrameInterval" title="Camera.keyFrameInterval" text="keyFrameInterval The number of video frames transmitted in full (called keyframes) instead of being interpolated by the video compression algorithm. The default value is 15, which means that every 15th frame is a keyframe. A value of 1 means that every frame is a keyframe. The allowed values are 1 through 48."/>
<page href="flash/media/Camera.html#loopback" title="Camera.loopback" text="loopback Indicates whether a local view of what the camera is capturing is compressed and decompressed (true), as it would be for live transmission using Flash Media Server, or uncompressed (false). The default value is false. Although a compressed stream is useful for testing, such as when previewing video quality settings, it has a significant processing cost. The local view is compressed, edited for transmission as it would be over a live connection, and then decompressed for local viewing. To set this value, use Camera.setLoopback(). To set the amount of compression used when this property is true, use Camera.setQuality()."/>
<page href="flash/media/Camera.html#motionLevel" title="Camera.motionLevel" text="motionLevel The amount of motion required to invoke the activity event. Acceptable values range from 0 to 100. The default value is 50. Video can be displayed regardless of the value of the motionLevel property. For more information, see setMotionLevel()."/>
<page href="flash/media/Camera.html#motionTimeout" title="Camera.motionTimeout" text="motionTimeout The number of milliseconds between the time the camera stops detecting motion and the time the activity event is invoked. The default value is 2000 (2 seconds). To set this value, use setMotionLevel()."/>
<page href="flash/media/Camera.html#muted" title="Camera.muted" text="muted A Boolean value indicating whether the user has denied access to the camera (true) or allowed access (false) in the Flash Player Privacy dialog box. When this value changes, the statusevent is dispatched."/>
<page href="flash/media/Camera.html#name" title="Camera.name" text="name The name of the current camera, as returned by the camera hardware."/>
<page href="flash/media/Camera.html#names" title="Camera.names" text="names An array of strings indicating the names of all available cameras without displaying the Flash Player Privacy dialog box. This array behaves in the same way as any other ActionScript array, implicitly providing the zero-based index of each camera and the number of cameras on the system (by means of names.length). For more information, see the names Array class entry. Calling the names property requires an extensive examination of the hardware, and it may take several seconds to build the array. In most cases, you can just use the default camera."/>
<page href="flash/media/Camera.html#quality" title="Camera.quality" text="quality The required level of picture quality, as determined by the amount of compression being applied to each video frame. Acceptable quality values range from 1 (lowest quality, maximum compression) to 100 (highest quality, no compression). The default value is 0, which means that picture quality can vary as needed to avoid exceeding available bandwidth. To set this property, use the setQuality() method."/>
<page href="flash/media/Camera.html#width" title="Camera.width" text="width The current capture width, in pixels. To set a desired value for this property, use the setMode() method."/>
<page href="flash/media/Camera.html#event:activity" title="Camera.activity" text="activity Dispatched when a camera begins or ends a session. Call Camera.setMotionLevel() to specify the amount of motion required to trigger an activity event with an activating value of true, or the time without activity that must elapse before triggering an activity event with an activating value of false."/>
<page href="flash/media/Camera.html#event:status" title="Camera.status" text="status Dispatched when a camera reports its status. If the value of the code property is &quot;Camera.muted&quot;, the user has refused to allow the SWF file access to the user's camera. If the value of the code property is &quot;Camera.Unmuted&quot;, the user has allowed the SWF file access to the user's camera."/>
<page href="flash/media/Sound.html" title="Sound class" text="Sound The Sound class lets you work with sound in an application. The Sound class lets you create a new Sound object, load and play an external MP3 file into that object, close the sound stream, and access data about the sound, such as information about the number of bytes in the stream and ID3 metadata. More detailed control of the sound is performed through the sound source — the SoundChannel or Microphone object for the sound — and through the properties in the SoundTransform class that control the output of the sound to the computer's speakers. To control sounds that are embedded in a SWF file, use the properties in the SoundMixer class. Note: The ActionScript 3.0 Sound API differs from ActionScript 2.0. In ActionScript 3.0, you cannot take sound objects and arrange them in a hierarchy to control their properties. When you use this class, consider the Flash Player security model: Loading and playing a sound is not allowed if the calling SWF file is in a network sandbox and the sound file to be loaded is local. By default, loading and playing a sound is not allowed if the calling SWF is local and tries to load and play a remote sound. A user must grant explicit permission to allow this. Certain operations dealing with sound are restricted. The data in a loaded sound cannot be accessed by a SWF file in a different domain unless you implement a cross-domain policy file. Sound-related APIs that fall under this restriction are Sound.id3, SoundMixer.computeSpectrum(), SoundMixer.bufferTime, and the SoundTransform class. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper"/>
<page href="flash/media/Sound.html#Sound()" title="Sound.Sound()" text="Sound Creates a new Sound object. If you pass a valid URLRequest object to the Sound constructor, the constructor automatically calls the load() function for the Sound object. If you do not pass a valid URLRequest object to the Sound constructor, you must call the load() function for the Sound object yourself, or the stream will not load. Once load() is called on a Sound object, you can't later load a different sound file into that Sound object. To load a different sound file, create a new Sound object. stream context The URL that points to an external MP3 file. Minimum number of milliseconds of MP3 data to hold in the Sound object's buffer. The Sound object waits until it has at least this much data before beginning playback and before resuming playback after a network stall. The default value is 1000 (one second)."/>
<page href="flash/media/Sound.html#close()" title="Sound.close()" text="close Closes the stream, causing any download of data to cease. No data may be read from the stream after the close() method is called. In the following example, when the user clicks on the Stop button, the Sound.close() method will be called and the sound will stop streaming. In the constructor, a text field is created for the Start and Stop button. When the user clicks on the text field, the clickHandler() method is invoked. It handles the starting and stopping of the sound file. Note that depending on the network connection or when the user clicks the Stop button, much of the file could already have been loaded and it may take a while for the sound file to stop playing. A try...catch block is used to catch any IO error that may occur while closing the stream. For example, if the sound is loaded from a local directory and not streamed, error 2029 is caught, stating, &quot;This URLStream object does not have an open stream.&quot; package { import flash.display.Sprite; import flash.net.URLRequest; import flash.media.Sound; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.events.MouseEvent; import flash.errors.IOError; import flash.events.IOErrorEvent; public class Sound_closeExample extends Sprite { private var snd:Sound = new Sound(); private var button:TextField = new TextField(); private var req:URLRequest = new URLRequest(&quot;http://av.adobe.com/podcast/csbu_dev_podcast_epi_2.mp3&quot;); public function Sound_closeExample() { button.x = 10; button.y = 10; button.text = &quot;START&quot;; button.border = true; button.background = true; button.selectable = false; button.autoSize = TextFieldAutoSize.LEFT; button.addEventListener(MouseEvent.CLICK, clickHandler); this.addChild(button); } private function clickHandler(e:MouseEvent):void { if(button.text == &quot;START&quot;) { snd.load(req); snd.play(); snd.addEventListener(IOErrorEvent.IO_ERROR, errorHandler); button.text = &quot;STOP&quot;; } else if(button.text == &quot;STOP&quot;) { try { snd.close(); button.text = &quot;Wait for loaded stream to finish.&quot;; } catch (error:IOError) { button.text = &quot;Couldn't close stream &quot; + error.message; } } } private function errorHandler(event:IOErrorEvent):void { button.text = &quot;Couldn't load the file &quot; + event.text; } } } The stream could not be closed, or the stream was not open."/>
<page href="flash/media/Sound.html#load()" title="Sound.load()" text="load Initiates loading of an external MP3 file from the specified URL. If you provide a valid URLRequest object to the Sound constructor, the constructor calls Sound.load() for you. You only need to call Sound.load() yourself if you don't pass a valid URLRequest object to the Sound constructor or you pass a null value. Once load() is called on a Sound object, you can't later load a different sound file into that Sound object. To load a different sound file, create a new Sound object. When using this method, consider the Flash Player security model: Calling Sound.load() is not allowed if the calling SWF file is in the local-with-file-system sandbox and the sound is in a network sandbox. Access from the local-trusted or local-with-networking sandbox requires permission from a website through a cross-domain policy file. 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. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper stream context A URL that points to an external MP3 file. Minimum number of milliseconds of MP3 data to hold in the Sound object's buffer. The Sound object waits until it has at least this much data before beginning playback and before resuming playback after a network stall. The default value is 1000 (one second). The following example displays the loading progress of a sound file. In the constructor a URLRequest object is created to identify the location of the sound file, which is a podcast from Adobe. The file is loaded in a try...catch block in order to catch any error that may occur while loading the file. If an IO error occurred, the errorHandler() method also is invoked and the error message is written in the text field intended for the progress report. While a load operation is in progress, a ProgressEvent.PROGRESS event is dispatched and the progressHandler() method is called. Here, ProgressEvent.PROGRESS event is used as a timer for calculating the load progress. The progressHandler() method divides the bytesLoaded value passed with the ProgressEvent object by the bytesTotal value to arrive at a percentage of the sound data that is being loaded. It then displays these values in the text field. (Note that if the file is small, cached, or the file is in the local directory, the progress may not be noticeable.) package { import flash.display.Sprite; import flash.net.URLRequest; import flash.media.Sound; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.events.ProgressEvent; import flash.events.IOErrorEvent; public class Sound_loadExample extends Sprite { private var snd:Sound = new Sound(); private var statusTextField:TextField = new TextField(); public function Sound_loadExample(){ statusTextField.autoSize = TextFieldAutoSize.LEFT; var req:URLRequest = new URLRequest(&quot;http://av.adobe.com/podcast/csbu_dev_podcast_epi_2.mp3&quot;); try { snd.load(req); snd.play(); } catch (err:Error) { trace(err.message); } snd.addEventListener(IOErrorEvent.IO_ERROR, errorHandler); snd.addEventListener(ProgressEvent.PROGRESS, progressHandler); this.addChild(statusTextField); } private function progressHandler(event:ProgressEvent):void { var loadTime:Number = event.bytesLoaded / event.bytesTotal; var LoadPercent:uint = Math.round(100 * loadTime); statusTextField.text = &quot;Sound file's size in bytes: &quot; + event.bytesTotal + &quot;\n&quot; + &quot;Bytes being loaded: &quot; + event.bytesLoaded + &quot;\n&quot; + &quot;Percentage of sound file that is loaded &quot; + LoadPercent + &quot;%.\n&quot;; } private function errorHandler(errorEvent:IOErrorEvent):void { statusTextField.text = &quot;The sound could not be loaded: &quot; + errorEvent.text; } } } A network error caused the load to fail."/>
<page href="flash/media/Sound.html#play()" title="Sound.play()" text="play Generates a new SoundChannel object to play back the sound. This method returns a SoundChannel object, which you access to stop the sound and to monitor volume. (To control the volume, panning, and balance, access the SoundTransform object assigned to the sound channel.) startTime loops sndTransform The initial position in milliseconds at which playback should start. Defines the number of times a sound loops back to the startTime value before the sound channel stops playback. The initial SoundTransform object assigned to the sound channel. In the following example, once the file is loaded, the user using a graphic bar can select the starting position (starting time) of the sound file. The constructor calls the Sound.load() method to start loading the sound data. Next it calls the Sound.play() method which will start playing the sound as soon as enough data has loaded. The Sound.play() method returns a SoundChannel object that can be used to control the playback of the sound. The text field displays the instructions. To make sure the content of where the user wants the sound to start, has already been loaded, the bar Sprite object is created and displayed after the file has finished loading. An Event.COMPLETE event is dispatched when the file is successfully loaded, which triggers the completeHandler() method. The completeHandler() method then creates the bar and adds it to the display list. (A sprite object is used instead of a shape object to support interactivity.) When the user clicks on the bar, the clickHandler() method is triggered. In the clickHandler() method, the position of x coordinate of the user's click, event.localX, is used to determine where the user wants the file to start. Since the bar is 100 pixels and it starts at x coordinate 100 pixels, it is easy to determine the percentage of the position. Also, since the file is loaded, the length property of the sound file will have the length of the complete file in milliseconds. Using the length of the sound file and the position in the line, a starting position for the sound file is determined. After stopping the sound from playing, the sound file restarts at the selected starting position, which is past as the startTime parameter to the play() method. package { import flash.display.Sprite; import flash.display.Graphics; import flash.events.MouseEvent; import flash.media.Sound;; import flash.net.URLRequest; import flash.media.SoundChannel; import flash.events.ProgressEvent; import flash.events.Event; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.events.IOErrorEvent; public class Sound_playExample1 extends Sprite { private var snd:Sound = new Sound(); private var channel:SoundChannel = new SoundChannel(); private var infoTextField:TextField = new TextField(); public function Sound_playExample1() { var req:URLRequest = new URLRequest(&quot;MySound.mp3&quot;); infoTextField.autoSize = TextFieldAutoSize.LEFT; infoTextField.text = &quot;Please wait for the file to be loaded.\n&quot; + &quot;Then select from the bar to decide where the file should start.&quot;; snd.load(req); channel = snd.play(); snd.addEventListener(IOErrorEvent.IO_ERROR, errorHandler); snd.addEventListener(Event.COMPLETE, completeHandler); this.addChild(infoTextField); } private function completeHandler(event:Event):void { infoTextField.text = &quot;File is ready.&quot;; var bar:Sprite = new Sprite(); bar.graphics.lineStyle(5, 0xFF0000); bar.graphics.moveTo(100, 100); bar.graphics.lineTo(200, 100); bar.addEventListener(MouseEvent.CLICK, clickHandler); this.addChild(bar); } private function clickHandler(event:MouseEvent):void { var position:uint = event.localX; var percent:uint = Math.round(position) - 100; var cue:uint = (percent / 100) * snd.length; channel.stop(); channel = snd.play(cue); } private function errorHandler(errorEvent:IOErrorEvent):void { infoTextField.text = &quot;The sound could not be loaded: &quot; + errorEvent.text; } } }"/>
<page href="flash/media/Sound.html#bytesLoaded" title="Sound.bytesLoaded" text="bytesLoaded Returns the currently available number of bytes in this sound object. This is usually only useful for externally loaded files."/>
<page href="flash/media/Sound.html#bytesTotal" title="Sound.bytesTotal" text="bytesTotal Returns the total number of bytes in this sound object."/>
<page href="flash/media/Sound.html#id3" title="Sound.id3" text="id3 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 the Sound.load() method contains ID3 tags, you can query these properties. Only ID3 tags that use the UTF-8 character set are supported. Flash Player 9 and later supports ID3 2.0 tags, specifically 2.3 and 2.4. The following tables list the standard ID3 2.0 tags and the type of content the tags represent. The Sound.id3 property provides access to these tags through the format my_sound.id3.COMM, my_sound.id3.TIME, and so on. The first table describes tags that can be accessed either through the ID3 2.0 property name or the ActionScript property name. The second table describes ID3 tags that are supported but do not have predefined properties in ActionScript. ID3 2.0 tag Corresponding ActionScript property COMM Sound.id3.comment TALB Sound.id3.album TCON Sound.id3.genre TIT2 Sound.id3.songName TPE1 Sound.id3.artist TRCK Sound.id3.track TYER Sound.id3.year The following table describes ID3 tags that are supported but do not have predefined properties in ActionScript. You access them by calling mySound.id3.TFLT, mySound.id3.TIME, and so on. Property Description TFLT File type TIME Time TIT1 Content group description TIT2 Title/song name/content description TIT3 Subtitle/description refinement TKEY Initial key TLAN Languages TLEN Length TMED Media type TOAL Original album/movie/show title TOFN Original filename TOLY Original lyricists/text writers TOPE Original artists/performers TORY Original release year TOWN File owner/licensee TPE1 Lead performers/soloists TPE2 Band/orchestra/accompaniment TPE3 Conductor/performer refinement TPE4 Interpreted, remixed, or otherwise modified by TPOS Part of a set TPUB Publisher TRCK Track number/position in set TRDA Recording dates TRSN Internet radio station name TRSO Internet radio station owner TSIZ Size TSRC ISRC (international standard recording code) TSSE Software/hardware and settings used for encoding TYER Year WXXX URL link frame When using this property, consider the Flash Player security model: The id3 property of a Sound object is always permitted for SWF files that are in the same security sandbox as the sound file. For files in other sandboxes, there are security checks. When you load the sound, using the load() method of the Sound class, you can specify a context parameter, which is a SoundLoaderContext object. If you set the checkPolicyFile property of the SoundLoaderContext object to true, Flash Player checks for a cross-domain policy file on the server from which the sound is loaded. If there is a cross-domain policy file, and the file permits the domain of the loading SWF file, then the file is allowed to access the id3 property of the Sound object; otherwise it is not. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper The following example reads the ID3 information from a sound file and displays it in a text field. In the constructor, the sound file is loaded but it is not set to play. Here, it is assumed that the file is in the SWF directory. The system must have permission in order to read the ID3 tags of a loaded sound file. If there is ID3 information in the file and the program is permitted to read it, an Event.ID3 event will be fired and the id3 property of the sound file will be populated. The id3 property contains an ID3Info object with all of the ID3 information. In the id3Handler() method, the file's ID3 tags are stored in id3, an ID3Info class object. A text field is instantiated to display the list of the ID3 tags. The for loop iterates through all the ID3 2.0 tags and appends the name and value to the content of the text field. Using ID3 info (ID3Info) properties, the artist, song name, and album are also appended. ActionScript 3.0 and Flash Player 9 and later support ID3 2.0 tags, specifically 2.3 and 2.4. If you iterate through properties like in the for loop, only ID3 2.0 tags will appear. However, the data from the earlier versions are also stored in the song's id3 property and can be accessed using ID3 info class properties. The tags for the ID3 1.0 are at the end of the file while the ID3 2.0 tags are in the beginning of the file. (Sometimes, the files may have both earlier and later version tags in the same place.) If a file encoded with both version 1.0 and 2.0 tags at the beginning and the end of the file, the method id3Handler() will be invoked twice. It first reads the 2.0 version and then the version 1.0. If only ID3 1.0 tag is available, then the information is accessible via the ID3 info properties, like id3.songname. For ID3 2.0, id3.TITS property will retrieve the song name using the new tag (TITS). Note that no error handling is written for this example and if the ID3 content is long, the result may go beyond the viewable area. package { import flash.display.Sprite; import flash.media.Sound; import flash.net.URLRequest; import flash.media.ID3Info; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.events.Event; public class Sound_id3Example extends Sprite { private var snd:Sound = new Sound(); private var myTextField:TextField = new TextField(); public function Sound_id3Example() { snd.addEventListener(Event.ID3, id3Handler); snd.load(new URLRequest(&quot;mySound.mp3&quot;)); } private function id3Handler(event:Event):void { var id3:ID3Info = snd.id3; myTextField.autoSize = TextFieldAutoSize.LEFT; myTextField.border = true; myTextField.appendText(&quot;Received ID3 Info: \n&quot;); for (var propName:String in id3) { myTextField.appendText(propName + &quot; = &quot; + id3[propName] + &quot;\n&quot;); } myTextField.appendText(&quot;\n&quot; + &quot;Artist: &quot; + id3.artist + &quot;\n&quot;); myTextField.appendText(&quot;Song name: &quot; + id3.songName + &quot;\n&quot;); myTextField.appendText(&quot;Album: &quot; + id3.album + &quot;\n\n&quot;); this.addChild(myTextField); } } }"/>
<page href="flash/media/Sound.html#isBuffering" title="Sound.isBuffering" text="isBuffering Returns the buffering state of external MP3 files. If the value is true, any playback is currently suspended while the object waits for more data."/>
<page href="flash/media/Sound.html#length" title="Sound.length" text="length The length of the current sound in milliseconds."/>
<page href="flash/media/Sound.html#url" title="Sound.url" text="url The URL from which this sound was loaded. This property is applicable only to Sound objects that were loaded using the Sound.load() method. For Sound objects that are associated with a sound asset from a SWF's library, the value of the url property is null. When you first call Sound.load(), the url property initially has a value of null, because the final URL is not yet known. The url property will have a non-null value as soon as an open event is dispatched from the Sound object. The url property contains the final, absolute URL from which a sound was loaded. The value of url is usually the same as the value passed to the stream parameter of Sound.load(). However, if you passed a relative URL to Sound.load() the value of the url property will represent the absolute URL. Additionally, if the original URL request is redirected by an HTTP server, the value of the url property reflects the final URL from which the sound file was actually downloaded. This reporting of an absolute, final URL is equivalent to the behavior of LoaderInfo.url."/>
<page href="flash/media/Sound.html#event:complete" title="Sound.complete" text="complete Dispatched when data has loaded successfully."/>
<page href="flash/media/Sound.html#event:id3" title="Sound.id3" text="id3 Dispatched by a Sound object when ID3 data is available for an MP3 sound."/>
<page href="flash/media/Sound.html#event:ioError" title="Sound.ioError" text="ioError Dispatched when an input/output error occurs that causes a load operation to fail."/>
<page href="flash/media/Sound.html#event:open" title="Sound.open" text="open Dispatched when a load operation starts."/>
<page href="flash/media/Sound.html#event:progress" title="Sound.progress" text="progress Dispatched when data is received as a load operation progresses."/>
<page href="flash/media/SoundTransform.html" title="SoundTransform class" text="SoundTransform The SoundTransform class contains properties for volume and panning. The following objects contain a soundTransform property, the value of which is a SoundTransform object: Microphone, NetStream, SimpleButton, SoundChannel, SoundMixer, and Sprite."/>
<page href="flash/media/SoundTransform.html#SoundTransform()" title="SoundTransform.SoundTransform()" text="SoundTransform Creates a SoundTransform object. vol panning The volume, ranging from 0 (silent) to 1 (full volume). The left-to-right panning of the sound, ranging from -1 (full pan left) to 1 (full pan right). A value of 0 represents no panning (center). In the following example, the sound will only play from the right channel and the volume is set to 50 percent. In the constructor, the sound is loaded and assigned to a sound channel (channel). A SoundTranform object (transform) is also created. Its first argument sets the volume at 50 percent (the range is 0.0 to 1.0). Its second argument set the panning. Here, panning is set to 1.0, which means the sound will only come from the right speaker. In order for these setting to take effect, the transform SoundTranform object is assigned to the sound channel's souundTransform property. (There is limited error handling written for this example.) package { import flash.display.Sprite; import flash.net.URLRequest; import flash.media.Sound; import flash.media.SoundChannel; import flash.media.SoundTransform; import flash.events.IOErrorEvent; public class SoundTransform_constructorExample extends Sprite { public function SoundTransform_constructorExample() { var mySound:Sound = new Sound(); var url:URLRequest = new URLRequest(&quot;mySound.mp3&quot;); var channel:SoundChannel; var transform:SoundTransform = new SoundTransform(0.5, 1.0); mySound.load(url); channel = mySound.play(); channel.soundTransform = transform; mySound.addEventListener(IOErrorEvent.IO_ERROR, errorHandler); } private function errorHandler(errorEvent:IOErrorEvent):void { trace(&quot;The sound could not be loaded: &quot; + errorEvent.text); } } }"/>
<page href="flash/media/SoundTransform.html#leftToLeft" title="SoundTransform.leftToLeft" text="leftToLeft A value, from 0 (none) to 1 (all), specifying how much of the left input is played in the left speaker."/>
<page href="flash/media/SoundTransform.html#leftToRight" title="SoundTransform.leftToRight" text="leftToRight A value, from 0 (none) to 1 (all), specifying how much of the left input is played in the right speaker."/>
<page href="flash/media/SoundTransform.html#pan" title="SoundTransform.pan" text="pan The left-to-right panning of the sound, ranging from -1 (full pan left) to 1 (full pan right). A value of 0 represents no panning (balanced center between right and left)."/>
<page href="flash/media/SoundTransform.html#rightToLeft" title="SoundTransform.rightToLeft" text="rightToLeft A value, from 0 (none) to 1 (all), specifying how much of the right input is played in the left speaker."/>
<page href="flash/media/SoundTransform.html#rightToRight" title="SoundTransform.rightToRight" text="rightToRight A value, from 0 (none) to 1 (all), specifying how much of the right input is played in the right speaker."/>
<page href="flash/media/SoundTransform.html#volume" title="SoundTransform.volume" text="volume The volume, ranging from 0 (silent) to 1 (full volume)."/>
<page href="flash/media/ID3Info.html" title="ID3Info class" text="ID3Info The ID3Info class contains properties that reflect ID3 metadata. You can get additional metadata for MP3 files by accessing the id3 property of the Sound class; for example, mySound.id3.TIME. For more information, see the entry for Sound.id3 and the ID3 tag definitions at http://www.id3.org."/>
<page href="flash/media/ID3Info.html#album" title="ID3Info.album" text="album The name of the album; corresponds to the ID3 2.0 tag TALB."/>
<page href="flash/media/ID3Info.html#artist" title="ID3Info.artist" text="artist The name of the artist; corresponds to the ID3 2.0 tag TPE1."/>
<page href="flash/media/ID3Info.html#comment" title="ID3Info.comment" text="comment A comment about the recording; corresponds to the ID3 2.0 tag COMM."/>
<page href="flash/media/ID3Info.html#genre" title="ID3Info.genre" text="genre The genre of the song; corresponds to the ID3 2.0 tag TCON."/>
<page href="flash/media/ID3Info.html#songName" title="ID3Info.songName" text="songName The name of the song; corresponds to the ID3 2.0 tag TIT2."/>
<page href="flash/media/ID3Info.html#track" title="ID3Info.track" text="track The track number; corresponds to the ID3 2.0 tag TRCK."/>
<page href="flash/media/ID3Info.html#year" title="ID3Info.year" text="year The year of the recording; corresponds to the ID3 2.0 tag TYER."/>
<page href="flash/media/SoundMixer.html" title="SoundMixer class" text="SoundMixer The SoundMixer class contains static properties and methods for global sound control in the SWF file. The SoundMixer class controls embedded streaming sounds in a SWF; it does not control dynamically created Sound objects (that is, Sound objects created in ActionScript)."/>
<page href="flash/media/SoundMixer.html#areSoundsInaccessible()" title="SoundMixer.areSoundsInaccessible()" text="areSoundsInaccessible Determines whether any sounds are not accessible due to security restrictions. For example, a sound loaded from a domain other than that of the SWF file is not accessible if the server for the sound has no cross-domain policy file that grants access to the domain of the SWF file. The sound can still be loaded and played, but low-level operations, such as getting ID3 metadata for the sound, cannot be performed on inaccessible sounds."/>
<page href="flash/media/SoundMixer.html#computeSpectrum()" title="SoundMixer.computeSpectrum()" text="computeSpectrum Takes a snapshot of the current sound wave and places it into the specified ByteArray object. The values are formatted as normalized floating-point values, in the range -1.0 to 1.0. The ByteArray object passed to the outputArray parameter is overwritten with the new values. The size of the ByteArray object created is fixed to 512 floating-point values, where the first 256 values represent the left channel, and the second 256 values represent the right channel. Note: This method is subject to local file security restrictions and restrictions on cross-domain loading. If you are working with local SWF files or sounds loaded from a server in a different domain than the calling SWF, you might need to address sandbox restrictions through a cross-domain policy file. For more information, see the Sound class description. This method is supported over RTMP in Flash Player Update 3 and later. You can control access to streams on Flash Media Server in a server-side script. For more information, see the Client.audioSampleAccess and Client.videoSampleAccess properties in Server-Side ActionScript Language Reference for Adobe Flash Media Server. outputArray FFTMode stretchFactor A ByteArray object that holds the values associated with the sound. If any sounds are not available due to security restrictions (areSoundsInaccessible == true), the outputArray object is left unchanged. If all sounds are stopped, the outputArray object is filled with zeros. A Boolean value indicating whether a Fourier transformation is performed on the sound data first. Setting this parameter to true causes the method to return a frequency spectrum instead of the raw sound wave. In the frequency spectrum, low frequencies are represented on the left and high frequencies are on the right. The resolution of the sound samples. If you set the stretchFactor value to 0, data is sampled at 44.1 KHz; with a value of 1, data is sampled at 22.05 KHz; with a value of 2, data is sampled 11.025 KHz; and so on. In the following example, the computeSpectrum() method is used to produce a graphic representation of the sound wave data. In the constructor, a sound file is loaded and set to play. (There is no error handling in this example and it is assumed that the sound file is in the same directory as the SWF file.) The example listens for the Event.ENTER_FRAME event while the sound plays, repeatedly triggering the onEnterFrame() method to draw a graph of the sound data values. When the sound finishes playing the onPlaybackComplete() method stops the drawing process by removing the listener for the Event.ENTER_FRAME event. In the onEnterFrame() method, the computeSpectrum() method stores the raw sound in the bytes byte array object. The data is sampled at 44.1 KHz. The byte array containing 512 bytes of data, each of which contains a floating-point value between -1 and 1. The first 256 values represent the left channel, and the second 256 values represent the right channel. The first for loop, reads the first 256 data values (the left stereo channel) and draws a line from each point to the next using the Graphics.lineTo() method. (The vector graphic display of the sound wave is written directly on to the class's sprite object.) The sound bytes are read as 32-bit floating-point number from the byte stream and multiplied by the plot height to allow for the vertical range of the graph. The width is set to twice the width of the channel length. The second for loop reads the next set of 256 values (the right stereo channel), and plots the lines in reverse order. The g.lineTo(CHANNEL_LENGTH * 2, PLOT_HEIGHT); and g.lineTo(0, PLOT_HEIGHT); methods draw the baseline for the waves. The resulting waveform plot produces a mirror-image effect. package { import flash.display.Sprite; import flash.display.Graphics; import flash.events.Event; import flash.media.Sound; import flash.media.SoundChannel; import flash.media.SoundMixer; import flash.net.URLRequest; import flash.utils.ByteArray; import flash.text.TextField; public class SoundMixer_computeSpectrumExample extends Sprite { public function SoundMixer_computeSpectrumExample() { var snd:Sound = new Sound(); var req:URLRequest = new URLRequest(&quot;Song1.mp3&quot;); snd.load(req); var channel:SoundChannel; channel = snd.play(); addEventListener(Event.ENTER_FRAME, onEnterFrame); channel.addEventListener(Event.SOUND_COMPLETE, onPlaybackComplete); } private function onEnterFrame(event:Event):void { var bytes:ByteArray = new ByteArray(); const PLOT_HEIGHT:int = 200; const CHANNEL_LENGTH:int = 256; SoundMixer.computeSpectrum(bytes, false, 0); var g:Graphics = this.graphics; g.clear(); g.lineStyle(0, 0x6600CC); g.beginFill(0x6600CC); g.moveTo(0, PLOT_HEIGHT); var n:Number = 0; for (var i:int = 0; i &lt; CHANNEL_LENGTH; i++) { n = (bytes.readFloat() * PLOT_HEIGHT); g.lineTo(i * 2, PLOT_HEIGHT - n); } g.lineTo(CHANNEL_LENGTH * 2, PLOT_HEIGHT); g.endFill(); g.lineStyle(0, 0xCC0066); g.beginFill(0xCC0066, 0.5); g.moveTo(CHANNEL_LENGTH * 2, PLOT_HEIGHT); for (i = CHANNEL_LENGTH; i &gt; 0; i--) { n = (bytes.readFloat() * PLOT_HEIGHT); g.lineTo(i * 2, PLOT_HEIGHT - n); } g.lineTo(0, PLOT_HEIGHT); g.endFill(); } private function onPlaybackComplete(event:Event):void { removeEventListener(Event.ENTER_FRAME, onEnterFrame); } } }"/>
<page href="flash/media/SoundMixer.html#stopAll()" title="SoundMixer.stopAll()" text="stopAll Stops all sounds currently playing. This method does not stop the playhead. Sounds set to stream will resume playing as the playhead moves over the frames in which they are located. When using this property, consider the Flash Player security model: By default, calling the SoundMixer.stopAll() method stops only sounds in the same security sandbox as the object that is calling the method. Any sounds whose playback was not started from the same sandbox as the calling object are not stopped. When you load the sound, using the load() method of the Sound class, you can specify a context parameter, which is a SoundLoaderContext object. If you set the checkPolicyFile property of the SoundLoaderContext object to true, Flash Player checks for a cross-domain policy file on the server from which the sound is loaded. If the server has a cross-domain policy file, and the file permits the domain of a SWF file, then the file can stop the loaded sound by using the SoundMixer.stopAll() method; otherwise it cannot. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper In the following example, the stopAll() method is used to mute two sounds that are playing at the same time. In the constructor, two different sound files are loaded and set to play. The first sound is loaded locally and is assigned to a sound channel. (It is assumed that the file is in the same directory as the SWF file.) The second file is loaded and streamed from the Adobe site. In order to use the SoundMixer.stopAll() method, all sound must be accessible. (A SoundLoaderContext object can be used to check for the cross-domain policy file.) Each sound also has an event listener that is invoked if an IO error occurred while loading the sound file. A muteButton text field is also created. It listens for a mouse click, which will invoke the muteButtonClickHandler() method. In the muteButtonClickHandler() method, if the text field content is &quot;MUTE,&quot; the areSoundsInaccessible() method checks if the sound mixer has access to the files. If the files are accessible, the stopAll() method stops the sounds. By clicking on the text field again, the first sound begins playing and the text field's content changes to &quot;MUTE&quot; again. This time, the stopAll() method mutes the one sound that is running. Note that sound channel stop() method can also be used to stop a specific sound assigned to the channel. (To use the channel functionally, the sound needs to be reassigned to the channel each time the play() method is invoked.) package { import flash.display.Sprite; import flash.net.URLRequest; import flash.media.Sound; import flash.media.SoundLoaderContext; import flash.media.SoundChannel; import flash.media.SoundMixer; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.events.MouseEvent; import flash.events.IOErrorEvent; public class SoundMixer_stopAllExample extends Sprite { private var firstSound:Sound = new Sound(); private var secondSound:Sound = new Sound(); private var muteButton:TextField = new TextField(); private var channel1:SoundChannel = new SoundChannel(); public function SoundMixer_stopAllExample() { firstSound.load(new URLRequest(&quot;mySound.mp3&quot;)); secondSound.load(new URLRequest(&quot;http://av.adobe.com/podcast/csbu_dev_podcast_epi_2.mp3&quot;)); firstSound.addEventListener(IOErrorEvent.IO_ERROR, firstSoundErrorHandler); secondSound.addEventListener(IOErrorEvent.IO_ERROR, secondSoundErrorHandler); channel1 = firstSound.play(); secondSound.play(); muteButton.autoSize = TextFieldAutoSize.LEFT; muteButton.border = true; muteButton.background = true; muteButton.text = &quot;MUTE&quot;; muteButton.addEventListener(MouseEvent.CLICK, muteButtonClickHandler); this.addChild(muteButton); } private function muteButtonClickHandler(event:MouseEvent):void { if(muteButton.text == &quot;MUTE&quot;) { if(SoundMixer.areSoundsInaccessible() == false) { SoundMixer.stopAll(); muteButton.text = &quot;click to play only one of sound.&quot;; } else { muteButton.text = &quot;The sounds are not accessible.&quot;; } } else { firstSound.play(); muteButton.text = &quot;MUTE&quot;; } } private function firstSoundErrorHandler(errorEvent:IOErrorEvent):void { trace(errorEvent.text); } private function secondSoundErrorHandler(errorEvent:IOErrorEvent):void { trace(errorEvent.text); } } }"/>
<page href="flash/media/SoundMixer.html#bufferTime" title="SoundMixer.bufferTime" text="bufferTime The number of seconds to preload an embedded streaming sound into a buffer before it starts to stream. The data in a loaded sound, including its buffer time, cannot be accessed by a SWF file that is in a different domain unless you implement a cross-domain policy file. For more information about security and sound, see the Sound class description. The SoundMixer.bufferTime property only affects the buffer time for embedded streaming sounds in a SWF and is independent of dynamically created Sound objects (that is, Sound objects created in ActionScript). The value of SoundMixer.bufferTime cannot override or set the default of the buffer time specified in the SoundLoaderContext object that is passed to the Sound.load() method."/>
<page href="flash/media/SoundMixer.html#soundTransform" title="SoundMixer.soundTransform" text="soundTransform The SoundTransform object that controls global sound properties. A SoundTransform object includes properties for setting volume, panning, left speaker assignment, and right speaker assignment. This SoundTransform object only affects sounds embedded within a SWF file. The SoundTransform object used in this property provides final sound settings that are applied to all sounds after any individual sound settings are applied."/>
<page href="flash/media/SoundChannel.html" title="SoundChannel class" text="SoundChannel The SoundChannel class controls a sound in an application. Each sound playing in an Adobe® Flash® application is assigned to a sound channel, and the application can have multiple sound channels that are mixed together. The SoundChannel class contains a stop() method, properties for monitoring the amplitude (volume) of the channel, and a property for setting a SoundTransform object to the channel."/>
<page href="flash/media/SoundChannel.html#stop()" title="SoundChannel.stop()" text="stop Stops the sound playing in the channel. In the following example, the user can click a button to pause and replay a sound file. In the constructor, the sound file is loaded. (Here, it is assumed that the file is in the same directory as the SWF file.) A text field is used as a button for the user to play or pause the sound. When the user clicks on the button text field, the clickHandler() method is invoked. In the clickHandler() method, the first time the user clicks on the text field, the sound is set to play and assigned to a sound channel. Next, when the user clicks on the text field to pause, the sound will stop playing. The sound channel's position property records the position of the sound at the time it was stopped and is used to resume the sound starting at that position, once the user clicks on text field to start playing again. Note that each time the Sound.play() method is called, a new SoundChannel object is created and assigned to the channel variable. The Sound object needs to be assigned to a SoundChannel object in order to use the sound channel's stop() method to pause the sound. package { import flash.display.Sprite; import flash.media.Sound; import flash.media.SoundChannel; import flash.net.URLLoader; import flash.net.URLRequest; import flash.text.TextField; import flash.events.MouseEvent; import flash.text.TextFieldAutoSize; public class SoundChannel_stopExample extends Sprite { private var snd:Sound = new Sound(); private var channel:SoundChannel = new SoundChannel(); private var button:TextField = new TextField(); public function SoundChannel_stopExample() { var req:URLRequest = new URLRequest(&quot;MySound.mp3&quot;); snd.load(req); button.x = 10; button.y = 10; button.text = &quot;PLAY&quot;; button.border = true; button.background = true; button.selectable = false; button.autoSize = TextFieldAutoSize.CENTER; button.addEventListener(MouseEvent.CLICK, clickHandler); this.addChild(button); } private function clickHandler(e:MouseEvent):void { var pausePosition:int = channel.position; if(button.text == &quot;PLAY&quot;) { channel = snd.play(pausePosition); button.text = &quot;PAUSE&quot;; } else { channel.stop(); button.text = &quot;PLAY&quot;; } } } }"/>
<page href="flash/media/SoundChannel.html#leftPeak" title="SoundChannel.leftPeak" text="leftPeak The current amplitude (volume) of the left channel, from 0 (silent) to 1 (full amplitude)."/>
<page href="flash/media/SoundChannel.html#position" title="SoundChannel.position" text="position When the sound is playing, the position property indicates the current point that is being played in the sound file. When the sound is stopped or paused, the position property indicates the last point that was played in the sound file. A common use case is to save the value of the position property when the sound is stopped. You can resume the sound later by restarting it from that saved position."/>
<page href="flash/media/SoundChannel.html#rightPeak" title="SoundChannel.rightPeak" text="rightPeak The current amplitude (volume) of the right channel, from 0 (silent) to 1 (full amplitude)."/>
<page href="flash/media/SoundChannel.html#soundTransform" title="SoundChannel.soundTransform" text="soundTransform The SoundTransform object assigned to the sound channel. A SoundTransform object includes properties for setting volume, panning, left speaker assignment, and right speaker assignment."/>
<page href="flash/media/SoundChannel.html#event:soundComplete" title="SoundChannel.soundComplete" text="soundComplete Dispatched when a sound has finished playing. In the following example, the user selects songs from a playlist and then clicks on &quot;play&quot; to play the song in the order selected. In the constructor, a text field is defined that holds the song list and a line for selecting to play. (Normally, buttons will be used for play and list boxes for a song list.) A text format object has been defined to change the format of the song lines to italic once selected. When the user clicks on the text field, the clickHandler() method is invoked. In the clickHandler() method, the getLineIndexAtPoint() of the text field object returns the index of line where the user clicked. Using the line index, the getLineText() method gets the content of the text. The if statement checks if the user has selected to play or to add a song to the play list. If a user has selected to play and a song has been selected, then the event listener for mouse click is removed and the playNext() method is called to begin playing the songs. If the user has selected a song title, then the content of the line is added to the songList array and the format of the line is set to italic. The method playNext() iterates through the array list to load and play each song. The song is also assigned to a sound channel. An event listener for the sound channel is added to respond when the song is finished playing and the Event.SOUND_COMPLETE event is dispatched. The soundCompleteHandler() method then invoke the playNext() method to play the next song. This process continues until all the songs listed in the array are finished playing. package { import flash.display.Sprite; import flash.media.Sound; import flash.media.SoundChannel; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.events.MouseEvent; import flash.text.TextFormat; import flash.net.URLRequest; import flash.events.Event; import flash.events.IOErrorEvent; public class SoundChannel_event_soundCompleteExample extends Sprite { private var channel:SoundChannel = new SoundChannel(); private var songList:Array = new Array(); private var listTextField:TextField = new TextField(); private var songFormat:TextFormat = new TextFormat(); private var arrayIndex:int = 0; private var songSelected:Boolean = false; public function SoundChannel_event_soundCompleteExample() { listTextField.autoSize = TextFieldAutoSize.LEFT; listTextField.border = true listTextField.background = true; listTextField.text = &quot;Song1.mp3\n&quot; + &quot;Song2.mp3\n&quot; + &quot;Song3.mp3\n&quot; + &quot;Song4.mp3\n&quot; + &quot;PLAY&quot;; songFormat.italic = true; listTextField.addEventListener(MouseEvent.CLICK, clickHandler); addChild(listTextField); } private function clickHandler(e:MouseEvent):void { var index:int = listTextField.getLineIndexAtPoint(e.localX, e.localY); var line:String = listTextField.getLineText(index); var firstIndex:uint = listTextField.getLineOffset(index); var playLine:uint = listTextField.numLines - 1; if((index == playLine) &amp;&amp; (songSelected == true)) { listTextField.removeEventListener(MouseEvent.CLICK, clickHandler); playNext(); } else if (index != playLine) { songList.push(line.substr(0, (line.length - 1))); listTextField.setTextFormat(songFormat, firstIndex, (firstIndex + listTextField.getLineLength(index))); songSelected = true; } } private function playNext():void { if(arrayIndex &lt; songList.length) { var snd:Sound = new Sound(); snd.load(new URLRequest(songList[arrayIndex])); channel = snd.play(); channel.addEventListener(Event.SOUND_COMPLETE, soundCompleteHandler); arrayIndex++; } else { songSelected = false; while(arrayIndex &gt; 0) { songList.pop(); arrayIndex--; } } } private function soundCompleteHandler(e:Event):void { playNext(); } private function errorHandler(errorEvent:IOErrorEvent):void { trace(errorEvent.text); } } }"/>
<page href="flash/media/Video.html" title="Video class" text="Video The Video class displays live or recorded video in an application without embedding the video in your SWF file. This class creates a Video object in an Adobe Flash or Adobe Flex interface that plays either of the following kinds of video: recorded Flash Video (FLV) files stored on a server or locally, or live video captured from a user's computer. A Video object is a display object on the application's display list and represents the visual space in which the video runs in a user interface. When used with Flash Media Server, the Video object allows you to send live video from a user's computer to the server and then broadcast it from the server to other users. Using these features, you can develop media applications such as a simple video player, a video player with multipoint publishing from one server to another, or a video sharing application for a user community. Flash Player 9 supports publishing and playback of FLV files encoded with either the Sorenson Spark or On2 VP6 codec and also supports an alpha channel. The On2 VP6 video codec uses less bandwidth than older technologies and offers additional deblocking and deringing filters. Flash Player Update 3 and later versions support mipmapping to optimize runtime rendering quality and performance. For video playback, Flash Player uses mipmapping optimization if you set the Video object's smoothing property to true. As with other display objects on the display list, you can control various properties of Video objects. For example, you can move the Video object around on the Stage by using its x and y properties, you can change its size using its height and width properties, and so on. To play a video stream, use attachCamera() or attachNetStream() to attach the video to the Video object. Then, add the Video object to the display list using addChild(). If you are using the Flash authoring tool, you can also place the Video object on the Stage rather than adding it with addChild(), like this: If the Library panel isn't visible, select Window &gt; Library to display it. Add an embedded Video object to the library by clicking the Options menu on the right side of the Library panel title bar and selecting New Video. In the Video Properties dialog box, name the embedded Video object for use in the library and click OK. Drag the Video object to the Stage and use the Property Inspector to give it a unique instance name, such as my_video. (Do not name it Video.) Note: The Video class is not a subclass of the InteractiveObject class, so it cannot dispatch mouse events. However, you can call the addEventListener() method on the display object container that contains the Video object."/>
<page href="flash/media/Video.html#Video()" title="Video.Video()" text="Video Creates a new Video instance. If no values for the width and height parameters are supplied, the default values are used. You can also set the width and height properties of the Video object after the initial construction, using Video.width and Video.height. When a new Video object is created, values of zero for width or height are not allowed; if you pass zero, the defaults will be applied. After creating the Video, call the DisplayObjectContainer.addChild() or DisplayObjectContainer.addChildAt() method to add the Video object to a parent DisplayObjectContainer object. width height The width of the video, in pixels. The height of the video, in pixels."/>
<page href="flash/media/Video.html#attachCamera()" title="Video.attachCamera()" text="attachCamera Specifies a video stream from a camera to be displayed within the boundaries of the Video object in the application. Use this method to attach live video from a user's computer to the Video object. You can play the live video locally on the same computer on which it is being captured, or you can send it to Flash Media Server and use the server to stream it to other users. camera A Camera object that is capturing video data. To drop the connection to the Video object, pass null. Please see the Camera.getCamera() method example for an illustration of how to use this method."/>
<page href="flash/media/Video.html#attachNetStream()" title="Video.attachNetStream()" text="attachNetStream Specifies a video stream to be displayed within the boundaries of the Video object in the application. The video stream is either an FLV file played with NetStream.play(), a Camera object, or null. If you use an FLV file, it can be stored on the local file system or on Flash Media Server. If the value of the netStream argument is null, the video is no longer played in the Video object. You do not need to use this method if the FLV file contains only audio; the audio portion of FLV files is played automatically when you call NetStream.play(). To control the audio associated with an FLV file, use the soundTransform property of the NetStream object that plays the FLV file. netStream A NetStream object. To drop the connection to the Video object, pass null. Please see the example at the end of this class for an illustration of how to use this method."/>
<page href="flash/media/Video.html#clear()" title="Video.clear()" text="clear Clears the image currently displayed in the Video object. This is useful when you want to display standby information without having to hide the Video object."/>
<page href="flash/media/Video.html#deblocking" title="Video.deblocking" text="deblocking Indicates the type of filter applied to decoded video as part of post-processing. The default value is 0, which lets the video compressor apply a deblocking filter as needed. Compression of video can result in undesired artifacts. You can use the deblocking property to set filters that reduce blocking and, for video compressed using the On2 codec, ringing. Blocking refers to visible imperfections between the boundaries of the blocks that compose each video frame. Ringing refers to distorted edges around elements within a video image. Two deblocking filters are available: one in the Sorenson codec and one in the On2 VP6 codec. In addition, a deringing filter is available when you use the On2 VP6 codec. To set a filter, use one of the following values: 0—Lets the video compressor apply the deblocking filter as needed. 1—Does not use a deblocking filter. 2—Uses the Sorenson deblocking filter. 3—For On2 video only, uses the On2 deblocking filter but no deringing filter. 4—For On2 video only, uses the On2 deblocking and deringing filter. 5—For On2 video only, uses the On2 deblocking and a higher-performance On2 deringing filter. If a value greater than 2 is selected for video when you are using the Sorenson codec, the Sorenson decoder defaults to 2. Using a deblocking filter has an effect on overall playback performance, and it is usually not necessary for high-bandwidth video. If a user's system is not powerful enough, the user may experience difficulties playing back video with a deblocking filter enabled."/>
<page href="flash/media/Video.html#smoothing" title="Video.smoothing" text="smoothing Specifies whether the video should be smoothed (interpolated) when it is scaled. For smoothing to work, the player must be in high-quality mode. The default value is false (no smoothing). For video playback using Flash Player Update 3 and later versions, set this property to true to take advantage of mipmapping image optimization."/>
<page href="flash/media/Video.html#videoHeight" title="Video.videoHeight" text="videoHeight An integer specifying the height of the video stream, in pixels. For live streams, this value is the same as the Camera.height property of the Camera object that is capturing the video stream. For FLV files, this value is the height of the file that was exported as FLV. You may want to use this property, for example, to ensure that the user is seeing the video at the same size at which it was captured, regardless of the actual size of the Video object on the Stage."/>
<page href="flash/media/Video.html#videoWidth" title="Video.videoWidth" text="videoWidth An integer specifying the width of the video stream, in pixels. For live streams, this value is the same as the Camera.width property of the Camera object that is capturing the video stream. For FLV files, this value is the width of the file that was exported as an FLV file. You may want to use this property, for example, to ensure that the user is seeing the video at the same size at which it was captured, regardless of the actual size of the Video object on the Stage."/>
<page href="flash/media/Microphone.html" title="Microphone class" text="Microphone Use the Microphone class to capture audio from a microphone attached to a computer running Flash Player. Use the Microphone class to monitor the audio locally. Use the NetConnection and NetStream classes to transmit the audio to Flash Media Server. Flash Media Server can send the audio to other servers and broadcast it to other clients running Flash Player. For information about capturing video, see the Camera class. Important: Flash Player displays a Privacy dialog box that lets the user choose whether to allow or deny access to the microphone. Make sure that your application window size is at least 215 x 138 pixels; this is the minimum size required to display the dialog box. To create or reference a Microphone object, use the Microphone.getMicrophone() method."/>
<page href="flash/media/Microphone.html#getMicrophone()" title="Microphone.getMicrophone()" text="getMicrophone Returns a reference to a Microphone object for capturing audio. To begin capturing the audio, you must attach the Microphone object to a NetStream object (see NetStream.attachAudio()). Multiple calls to Microphone.get() reference the same microphone. Thus, if your code contains the lines mic1 = Microphone.get() and mic2 = Microphone.get(), both mic1 and mic2 reference the same (default) microphone. Use the index property to get the index value of the current Microphone object. You can then pass this value to other methods of the Microphone class. In general, you should not pass a value for index. Simply use the Microphone.get() method to return a reference to the default microphone. By using the Microphone Settings panel, the user can specify the default microphone Flash Player should use. If you pass a value for index, you might reference a microphone other than the one the user chooses. You can use index in rare cases—for example, if your application is capturing audio from two microphones at the same time. When a SWF file tries to access the object returned by Microphone.get() —for example, when you call NetStream.attachAudio()— Flash Player displays a Privacy dialog box that lets the user choose whether to allow or deny access to the microphone. (Make sure your Stage size is at least 215 x 138 pixels; this is the minimum size Flash Player requires to display the dialog box.) When the user responds to this dialog box, a status event is dispatched that indicates the user's response. You can also check the Microphone.muted property to determine if the user has allowed or denied access to the microphone. If Microphone.get() returns null, either the microphone is in use by another application, or there are no microphones installed on the system. To determine whether any microphones are installed, use Microphones.names.length. To display the Flash Player Microphone Settings panel, which lets the user choose the microphone to be referenced by Microphone.get, use Security.showSettings(). index The index value of the microphone."/>
<page href="flash/media/Microphone.html#setLoopBack()" title="Microphone.setLoopBack()" text="setLoopBack Routes audio captured by a microphone to the local speakers. state"/>
<page href="flash/media/Microphone.html#setSilenceLevel()" title="Microphone.setSilenceLevel()" text="setSilenceLevel Sets the minimum input level that should be considered sound and (optionally) the amount of silent time signifying that silence has actually begun. To prevent the microphone from detecting sound at all, pass a value of 100 for silenceLevel; the activity event is never dispatched. To determine the amount of sound the microphone is currently detecting, use Microphone.activityLevel. Activity detection is the ability to detect when audio levels suggest that a person is talking. When someone is not talking, bandwidth can be saved because there is no need to send the associated audio stream. This information can also be used for visual feedback so that users know they (or others) are silent. Silence values correspond directly to activity values. Complete silence is an activity value of 0. Constant loud noise (as loud as can be registered based on the current gain setting) is an activity value of 100. After gain is appropriately adjusted, your activity value is less than your silence value when you're not talking; when you are talking, the activity value exceeds your silence value. This method is similar to Camera.setMotionLevel(); both methods are used to specify when the activity event is dispatched. However, these methods have a significantly different impact on publishing streams: Camera.setMotionLevel() is designed to detect motion and does not affect bandwidth usage. Even if a video stream does not detect motion, video is still sent. Microphone.setSilenceLevel() is designed to optimize bandwidth. When an audio stream is considered silent, no audio data is sent. Instead, a single message is sent, indicating that silence has started. silenceLevel timeout The amount of sound required to activate the microphone and dispatch the activity event. Acceptable values range from 0 to 100. The number of milliseconds that must elapse without activity before Flash Player considers sound to have stopped and dispatches the dispatch event. The default value is 2000 (2 seconds). (Note: The default value shown in the signature, -1, is an internal value that indicates to Flash Player to use 2000.)"/>
<page href="flash/media/Microphone.html#setUseEchoSuppression()" title="Microphone.setUseEchoSuppression()" text="setUseEchoSuppression Specifies whether to use the echo suppression feature of the audio codec. The default value is false unless the user has selected Reduce Echo in the Flash Player Microphone Settings panel. Echo suppression is an effort to reduce the effects of audio feedback, which is caused when sound going out the speaker is picked up by the microphone on the same computer. (This is different from echo cancellation, which completely removes the feedback.) Generally, echo suppression is advisable when the sound being captured is played through speakers — instead of a headset — on the same computer. If your SWF file allows users to specify the sound output device, you may want to call Microphone.setUseEchoSuppression(true) if they indicate they are using speakers and will be using the microphone as well. Users can also adjust these settings in the Flash Player Microphone Settings panel. useEchoSuppression A Boolean value indicating whether echo suppression should be used (true) or not (false)."/>
<page href="flash/media/Microphone.html#activityLevel" title="Microphone.activityLevel" text="activityLevel The amount of sound the microphone is detecting. Values range from 0 (no sound is detected) to 100 (very loud sound is detected). The value of this property can help you determine a good value to pass to the Microphone.setSilenceLevel() method. If the microphone is available but is not yet being used because Microphone.getMicrophone() has not been called, this property is set to -1."/>
<page href="flash/media/Microphone.html#gain" title="Microphone.gain" text="gain The microphone gain—that is, the amount by which the microphone should multiply the signal before transmitting it. A value of 0 tells Flash Player to multiply by 0; that is, the microphone transmits no sound. You can think of this setting like a volume knob on a stereo: 0 is no volume and 50 is normal volume. Numbers below 50 specify lower than normal volume, while numbers above 50 specify higher than normal volume. Valid values are 0 through 100, and 50 is the default value. The user can change this value in the Flash Player Microphone Settings panel."/>
<page href="flash/media/Microphone.html#index" title="Microphone.index" text="index The index of the microphone, as reflected in the array returned by Microphone.names."/>
<page href="flash/media/Microphone.html#muted" title="Microphone.muted" text="muted Specifies whether the user has denied access to the microphone (true) or allowed access (false). When this value changes, a status event is dispatched. For more information, see Microphone.getMicrophone()."/>
<page href="flash/media/Microphone.html#name" title="Microphone.name" text="name The name of the current sound capture device, as returned by the sound capture hardware."/>
<page href="flash/media/Microphone.html#names" title="Microphone.names" text="names An array of strings containing the names of all available sound capture devices. The names are returned without having to display the Flash Player Privacy Settings panel to the user. This array provides the zero-based index of each sound capture device and the number of sound capture devices on the system, through the Microphone.names.length property. For more information, see the Array class entry. Calling Microphone.names requires an extensive examination of the hardware, and it may take several seconds to build the array. In most cases, you can just use the default microphone. Note: To determine the name of the current microphone, use the name property."/>
<page href="flash/media/Microphone.html#rate" title="Microphone.rate" text="rate The rate at which the microphone captures sound, in kHz. The allowed values are any of the following your sound device supports: 5, 8, 11, 22, or 44. The default value is 8 kHz if your sound capture device supports this value. Otherwise, the default value is the next available capture level above 8 kHz that your sound capture device supports, usually 11 kHz."/>
<page href="flash/media/Microphone.html#silenceLevel" title="Microphone.silenceLevel" text="silenceLevel The amount of sound required to activate the microphone and dispatch the activity event. The default value is 10."/>
<page href="flash/media/Microphone.html#silenceTimeout" title="Microphone.silenceTimeout" text="silenceTimeout The number of milliseconds between the time the microphone stops detecting sound and the time the activity event is dispatched. The default value is 2000 (2 seconds). To set this value, use the Microphone.setSilenceLevel() method."/>
<page href="flash/media/Microphone.html#soundTransform" title="Microphone.soundTransform" text="soundTransform Controls the sound of this microphone object when it is in loopback mode."/>
<page href="flash/media/Microphone.html#useEchoSuppression" title="Microphone.useEchoSuppression" text="useEchoSuppression Set to true if echo suppression is enabled; false otherwise. The default value is false unless the user has selected Reduce Echo in the Flash Player Microphone Settings panel."/>
<page href="flash/media/Microphone.html#event:activity" title="Microphone.activity" text="activity Dispatched when a microphone begins or ends a session. To specify the amount of sound required to trigger this event with an activating property of true, or the amount of time that must elapse without sound to trigger this event with an activating property of false, use Microphone.setSilenceLevel()."/>
<page href="flash/media/Microphone.html#event:status" title="Microphone.status" text="status Dispatched when a microphone reports its status. If the value of the code property is &quot;Microphone.Muted&quot;, the user has refused to allow the SWF file access to the microphone. If the value of the code property is &quot;Microphone.Unmuted&quot;, the user has allowed the SWF file access to the microphone."/>
<page href="flash/media/SoundLoaderContext.html" title="SoundLoaderContext class" text="SoundLoaderContext The SoundLoaderContext class provides security checks for SWF files that load sound. SoundLoaderContext objects are passed as an argument to the constructor and the load() method of the Sound class. When you use this class, consider the Flash® Player security model: Loading and playing a sound is not allowed if the calling SWF file is in a network sandbox and the sound file to be loaded is local. By default, loading and playing a sound is not allowed if the calling SWF is local and tries to load and play a remote sound. A user must grant explicit permission to allow this. Certain operations dealing with sound are restricted. The data in a loaded sound cannot be accessed by a SWF file in a different domain unless you implement a cross-domain policy file. Sound-related APIs that fall under this restriction are the Sound.id3 property and the SoundMixer.computeSpectrum(), SoundMixer.bufferTime, and SoundTransform() methods. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper"/>
<page href="flash/media/SoundLoaderContext.html#SoundLoaderContext()" title="SoundLoaderContext.SoundLoaderContext()" text="SoundLoaderContext Creates a new sound loader context object. bufferTime checkPolicyFile The number of seconds to preload a streaming sound into a buffer before the sound starts to stream. Specifies whether Flash Player should check for the existence of a cross-domain policy file upon loading the object (true) or not. In the following example, the buffer for the sound that will be loaded is set to three seconds. The first parameter of a SoundLoaderContext object (context) is used to increase the default buffer value of one second to three seconds. (The value is in milliseconds.) If the second parameter of the SoundLoaderContext object is set to true, Flash Player will check for a cross-domain policy file upon loading the object. Here it is set to the default value false, so no policy file will be checked. The load() method of the sound object will use the context setting to make sure it will take three seconds to preload the streaming sound into a buffer before the sound starts to stream. The URLRequest object determines the location of the file, which is a podcast from Adobe. If an IOErrorEvent.IO_ERROR error occurs during the loading of the sound file, the errorHandler() method is invoked. package { import flash.display.Sprite; import flash.net.URLRequest; import flash.media.Sound; import flash.media.SoundLoaderContext; import flash.events.IOErrorEvent; public class SoundLoaderContextExample extends Sprite { public function SoundLoaderContextExample() { var snd:Sound = new Sound(); var req:URLRequest = new URLRequest(&quot;http://av.adobe.com/podcast/csbu_dev_podcast_epi_2.mp3&quot;); var context:SoundLoaderContext = new SoundLoaderContext(30000, false); snd.load(req, context); snd.play(); snd.addEventListener(IOErrorEvent.IO_ERROR, errorHandler); } private function errorHandler(errorEvent:IOErrorEvent):void { trace(&quot;The sound could not be loaded: &quot; + errorEvent.text); } } }"/>
<page href="flash/media/SoundLoaderContext.html#bufferTime" title="SoundLoaderContext.bufferTime" text="bufferTime The number of seconds to preload a streaming sound into a buffer before the sound starts to stream. Note that you cannot override the value of SoundLoaderContext.bufferTime by setting the global SoundMixer.bufferTime property. The SoundMixer.bufferTime property affects the buffer time for embedded streaming sounds in a SWF and is independent of dynamically created Sound objects (that is, Sound objects created in ActionScript)."/>
<page href="flash/media/SoundLoaderContext.html#checkPolicyFile" title="SoundLoaderContext.checkPolicyFile" text="checkPolicyFile Specifies whether Flash Player should try to download a cross-domain policy file from the loaded sound's server before beginning to load the sound. This property applies to sound that is loaded from outside the calling SWF file's own domain using the Sound.load() method. Set this property to true when you load a sound from outside the calling SWF file's own domain and you need low-level access to the sound's data from ActionScript. Examples of low-level access to a sound's data include referencing the Sound.id3 property to get an ID3Info object or calling the SoundMixer.computeSpectrum() method to get sound samples from the loaded sound. If you try to access sound data without setting the checkPolicyFile property to true at loading time, you may get a SecurityError exception because the required policy file has not been downloaded. If you don't need low-level access to the sound data that you are loading, avoid setting checkPolicyFile to true. Checking for a policy file consumes network bandwidth and might delay the start of your download, so it should only be done when necessary. When you call Sound.load() with SoundLoaderContext.checkPolicyFile set to true, Flash Player must either successfully download a relevant cross-domain policy file or determine that no such policy file exists before it begins downloading the specified sound. Flash Player performs the following actions, in this order, to verify the existence of a policy file: Flash Player considers policy files that have already been downloaded. Flash Player tries to download any pending policy files specified in calls to Security.loadPolicyFile(). Flash Player tries to download a policy file from the default location that corresponds to the sound's URL, which is /crossdomain.xml on the same server as URLRequest.url. (The sound's URL is specified in the url property of the URLRequest object passed to Sound.load() or the Sound constructor.) In all cases, Flash Player requires that an appropriate policy file exist on the sound's server, that it provide access to the sound file at URLRequest.url by virtue of the policy file's location, and that it allow the domain of the calling SWF file to access the sound, through one or more &lt;allow-access-from&gt; tags. If you set checkPolicyFile to true, Flash Player waits until the policy file is verified before loading the sound. You should wait to perform any low-level operations on the sound data, such as calling Sound.id3 or SoundMixer.computeSpectrum(), until progress and complete events are dispatched from the Sound object. If you set checkPolicyFile to true but no appropriate policy file is found, you will not receive an error until you perform an operation that requires a policy file, and then Flash Player throws a SecurityError exception. After you receive a complete event, you can test whether a relevant policy file was found by getting the value of Sound.id3 within a try block and seeing if a SecurityError is thrown. Be careful with checkPolicyFile if you are downloading sound from a URL that uses server-side HTTP redirects. Flash Player tries to retrieve policy files that correspond to the url property of the URLRequest object passed to Sound.load(). If the final sound file comes from a different URL because of HTTP redirects, then the initially downloaded policy files might not be applicable to the sound's final URL, which is the URL that matters in security decisions. If you find yourself in this situation, here is one possible solution. After you receive a progress or complete event, you can examine the value of the Sound.url property, which contains the sound's final URL. Then call the Security.loadPolicyFile() method with a policy file URL that you calculate based on the sound's final URL. Finally, poll the value of Sound.id3 until no exception is thrown. For more information on policy files, see the &quot;Flash Player Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="adobe/utils/XMLUI.html" title="XMLUI class" text="XMLUI The XMLUI class enables communication with SWF files that are used as custom user interfaces for the Flash authoring tool's extensibility features. Macromedia Flash MX 2004 and Macromedia Flash MX Professional 2004 and later versions come with several extensibility features including Behaviors, Commands (JavaScript API), Effects, and Tools. With these features, advanced users can extend or automate the authoring tool's capabilities. The XML-to-UI engine works with each of these extensibility features to create dialog boxes that the user sees if the extension either requires or accepts parameters. You can define dialog boxes by using XML tags or by creating a SWF file to display. The XMLUI object provides a mechanism by which an advanced user can communicate with a SWF file used in such a manner."/>
<page href="adobe/utils/XMLUI.html#accept()" title="XMLUI.accept()" text="accept Makes the current XMLUI dialog box close with an &quot;accept&quot; state. This is identical to the user clicking the OK button."/>
<page href="adobe/utils/XMLUI.html#cancel()" title="XMLUI.cancel()" text="cancel Makes the current XMLUI dialog box close with a &quot;cancel&quot; state. This is identical to the user clicking the Cancel button."/>
<page href="adobe/utils/XMLUI.html#getProperty()" title="XMLUI.getProperty()" text="getProperty Retrieves the value of the specified property of the current XMLUI dialog box. name The name of the XMLUI property to retrieve."/>
<page href="adobe/utils/XMLUI.html#setProperty()" title="XMLUI.setProperty()" text="setProperty Modifies the value of the specified property of the current XMLUI dialog. name value The name of the XMLUI property to modify. The value to which the specified property will be set."/>
<page href="adobe/utils/CustomActions.html" title="CustomActions class" text="CustomActions The methods of the CustomActions class allow a SWF file playing in the Flash authoring tool to manage any custom actions that are registered with the authoring tool. A SWF file can install and uninstall custom actions, retrieve the XML definition of a custom action, and retrieve the list of registered custom actions. You can use these methods to build SWF files that are extensions of the Flash authoring tool. Such an extension could, for example, use the Flash Application Protocol to navigate a Universal Description, Discovery and Integration (UDDI) repository and download web services into the Actions toolbox."/>
<page href="adobe/utils/CustomActions.html#getActions()" title="CustomActions.getActions()" text="getActions Reads the contents of the custom action XML definition file named name. The name of the definition file must be a simple filename, without the .xml file extension, and without any directory separators (':', '/' or '\'). If the definition file specified by the name cannot be found, a value of undefined is returned. If the custom action XML definition specified by the name parameter is located, it is read in its entirety and returned as a string. name The name of the custom action definition to retrieve."/>
<page href="adobe/utils/CustomActions.html#installActions()" title="CustomActions.installActions()" text="installActions Installs a new custom action XML definition file indicated by the name parameter. The contents of the file is specified by the string data. The name of the definition file must be a simple filename, without the .xml file extension, and without any directory separators (':', '/' or '\'). If a custom actions file already exists with the name name, it is overwritten. If the Configuration/ActionsPanel/CustomActions directory does not exist when this method is invoked, the directory is created. name data The name of the custom action definition to install. The text of the XML definition to install."/>
<page href="adobe/utils/CustomActions.html#uninstallActions()" title="CustomActions.uninstallActions()" text="uninstallActions Removes the Custom Actions XML definition file named name. The name of the definition file must be a simple filename, without the .xml file extension, and without any directory separators (':', '/' or '\'). name The name of the custom action definition to uninstall."/>
<page href="adobe/utils/CustomActions.html#actionsList" title="CustomActions.actionsList" text="actionsList Returns an Array object containing the names of all the custom actions that are registered with the Flash authoring tool. The elements of the array are simple names, without the .xml file extension, and without any directory separators (for example, &quot;:&quot;, &quot;/&quot;, or &quot;\&quot;). If there are no registered custom actions, actionsList() returns a zero-length array. If an error occurs, actionsList() returns the value undefined."/>
<page href="flash/events/NetStatusEvent.html" title="NetStatusEvent class" text="NetStatusEvent Flash® Player dispatches NetStatusEvent objects when a NetConnection, NetStream, or SharedObject object reports its status. There is only one type of status event: NetStatusEvent.NET_STATUS."/>
<page href="flash/events/NetStatusEvent.html#NetStatusEvent()" title="NetStatusEvent.NetStatusEvent()" text="NetStatusEvent Creates an Event object that contains information about netStatus events. Event objects are passed as parameters to event listeners. type bubbles cancelable info The type of the event. Event listeners can access this information through the inherited type property. There is only one type of status event: NetStatusEvent.NET_STATUS. Determines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. Determines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. An object containing properties that describe the object's status. Event listeners can access this object through the info property."/>
<page href="flash/events/NetStatusEvent.html#clone()" title="NetStatusEvent.clone()" text="clone Creates a copy of the NetStatusEvent object and sets the value of each property to match that of the original."/>
<page href="flash/events/NetStatusEvent.html#toString()" title="NetStatusEvent.toString()" text="toString Returns a string that contains all the properties of the NetStatusEvent object. The string is in the following format: [NetStatusEvent type=value bubbles=value cancelable=value info=value]"/>
<page href="flash/events/NetStatusEvent.html#info" title="NetStatusEvent.info" text="info An object with properties that describe the object's status or error condition. The information object could have a code property containing a string that represents a specific event or a level property containing a string that is either &quot;status&quot; or &quot;error&quot;. The information object could also be something different. The code and level properties might not work for some implementations and some servers might send different objects. The following table describes the possible string values of the code and level properties. Code property Level property Meaning &quot;NetStream.Buffer.Empty&quot; &quot;status&quot; Data 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. &quot;NetStream.Buffer.Full&quot; &quot;status&quot; The buffer is full and the stream will begin playing. &quot;NetStream.Buffer.Flush&quot; &quot;status&quot; Data has finished streaming, and the remaining buffer will be emptied. &quot;NetStream.Failed&quot; &quot;error&quot; Flash Media Server only. An error has occurred for a reason other than those listed in other event codes. &quot;NetStream.Publish.Start&quot; &quot;status&quot; Publish was successful. &quot;NetStream.Publish.BadName&quot; &quot;error&quot; Attempt to publish a stream which is already being published by someone else. &quot;NetStream.Publish.Idle&quot; &quot;status&quot; The publisher of the stream is idle and not transmitting data. &quot;NetStream.Unpublish.Success&quot; &quot;status&quot; The unpublish operation was successfuul. &quot;NetStream.Play.Start&quot; &quot;status&quot; Playback has started. &quot;NetStream.Play.Stop&quot; &quot;status&quot; Playback has stopped. &quot;NetStream.Play.Failed&quot; &quot;error&quot; An error has occurred in playback for a reason other than those listed elsewhere in this table, such as the subscriber not having read access. &quot;NetStream.Play.StreamNotFound&quot; &quot;error&quot; The FLV passed to the play() method can't be found. &quot;NetStream.Play.Reset&quot; &quot;status&quot; Caused by a play list reset. &quot;NetStream.Play.PublishNotify&quot; &quot;status&quot; The initial publish to a stream is sent to all subscribers. &quot;NetStream.Play.UnpublishNotify&quot; &quot;status&quot; An unpublish from a stream is sent to all subscribers. &quot;NetStream.Play.InsufficientBW&quot; &quot;warning&quot; Flash Media Server only. The client does not have sufficient bandwidth to play the data at normal speed. &quot;NetStream.Pause.Notify&quot; &quot;status&quot; The stream is paused. &quot;NetStream.Unpause.Notify&quot; &quot;status&quot; The stream is resumed. &quot;NetStream.Record.Start&quot; &quot;status&quot; Recording has started. &quot;NetStream.Record.NoAccess&quot; &quot;error&quot; Attempt to record a stream that is still playing or the client has no access right. &quot;NetStream.Record.Stop&quot; &quot;status&quot; Recording stopped. &quot;NetStream.Record.Failed&quot; &quot;error&quot; An attempt to record a stream failed. &quot;NetStream.Seek.Failed&quot; &quot;error&quot; The seek fails, which happens if the stream is not seekable. &quot;NetStream.Seek.InvalidTime&quot; &quot;error&quot; 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 message.details property contains a time code that indicates the last valid position to which the user can seek. &quot;NetStream.Seek.Notify&quot; &quot;status&quot; The seek operation is complete. &quot;NetConnection.Call.BadVersion&quot; &quot;error&quot; Packet encoded in an unidentified format. &quot;NetConnection.Call.Failed&quot; &quot;error&quot; The NetConnection.call method was not able to invoke the server-side method or command. &quot;NetConnection.Call.Prohibited&quot; &quot;error&quot; An Action Message Format (AMF) operation is prevented for security reasons. Either the AMF URL is not in the same domain as the SWF file, or the AMF server does not have a policy file that trusts the domain of the SWF file. &quot;NetConnection.Connect.Closed&quot; &quot;status&quot; The connection was closed successfully. &quot;NetConnection.Connect.Failed&quot; &quot;error&quot; The connection attempt failed. &quot;NetConnection.Connect.Success&quot; &quot;status&quot; The connection attempt succeeded. &quot;NetConnection.Connect.Rejected&quot; &quot;error&quot; The connection attempt did not have permission to access the application. &quot;NetConnection.Connect.AppShutdown&quot; &quot;error&quot; The specified application is shutting down. &quot;NetConnection.Connect.InvalidApp&quot; &quot;error&quot; The application name specified during connect is invalid. &quot;SharedObject.Flush.Success&quot; &quot;status&quot; The &quot;pending&quot; status is resolved and the SharedObject.flush() call succeeded. &quot;SharedObject.Flush.Failed&quot; &quot;error&quot; The &quot;pending&quot; status is resolved, but the SharedObject.flush() failed. &quot;SharedObject.BadPersistence&quot; &quot;error&quot; A request was made for a shared object with persistence flags, but the request cannot be granted because the object has already been created with different flags. &quot;SharedObject.UriMismatch&quot; &quot;error&quot; An attempt was made to connect to a NetConnection object that has a different URI (URL) than the shared object. If you consistently see errors regarding the buffer, try changing the buffer using the NetStream.bufferTime property."/>
<page href="flash/events/NetStatusEvent.html#NET_STATUS" title="NetStatusEvent.NET_STATUS" text="NET_STATUS Defines the value of the type property of a netStatus event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. infoAn object with properties that describe the object's status or error condition. targetThe NetConnection or NetStream object reporting its status."/>
<page href="flash/events/NetStatusEvent.html#event:netStatus" title="NetStatusEvent.netStatus" text="netStatus Defines the value of the type property of a netStatus event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. infoAn object with properties that describe the object's status or error condition. targetThe NetConnection or NetStream object reporting its status."/>
<page href="flash/events/FocusEvent.html" title="FocusEvent class" text="FocusEvent Flash® Player dispatches FocusEvent objects when the user changes the focus from one object in the display list to another. There are four types of focus events: FocusEvent.FOCUS_IN FocusEvent.FOCUS_OUT FocusEvent.KEY_FOCUS_CHANGE FocusEvent.MOUSE_FOCUS_CHANGE"/>
<page href="flash/events/FocusEvent.html#FocusEvent()" title="FocusEvent.FocusEvent()" text="FocusEvent Creates an Event object with specific information relevant to focus events. Event objects are passed as parameters to event listeners. type bubbles cancelable relatedObject shiftKey keyCode The type of the event. Possible values are: FocusEvent.FOCUS_IN, FocusEvent.FOCUS_OUT, FocusEvent.KEY_FOCUS_CHANGE, and FocusEvent.MOUSE_FOCUS_CHANGE. Determines whether the Event object participates in the bubbling stage of the event flow. Determines whether the Event object can be canceled. Indicates the complementary InteractiveObject instance that is affected by the change in focus. For example, when a focusIn event occurs, relatedObject represents the InteractiveObject that has lost focus. Indicates whether the Shift key modifier is activated. Indicates the code of the key pressed to trigger a keyFocusChange event."/>
<page href="flash/events/FocusEvent.html#clone()" title="FocusEvent.clone()" text="clone Creates a copy of the FocusEvent object and sets the value of each property to match that of the original."/>
<page href="flash/events/FocusEvent.html#toString()" title="FocusEvent.toString()" text="toString Returns a string that contains all the properties of the FocusEvent object. The string is in the following format: [FocusEvent type=value bubbles=value cancelable=value relatedObject=value shiftKey=value]"/>
<page href="flash/events/FocusEvent.html#FOCUS_IN" title="FocusEvent.FOCUS_IN" text="FOCUS_IN Defines the value of the type property of a focusIn event object. This event has the following properties: PropertyValue bubblestrue cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. keyCode0; applies only to keyFocusChange events. relatedObjectThe complementary InteractiveObject instance that is affected by the change in focus. shiftKeyfalse; applies only to keyFocusChange events. targetThe InteractiveObject instance that has just received focus. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/FocusEvent.html#FOCUS_OUT" title="FocusEvent.FOCUS_OUT" text="FOCUS_OUT Defines the value of the type property of a focusOut event object. This event has the following properties: PropertyValue bubblestrue cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. keyCode0; applies only to keyFocusChange events. relatedObjectThe complementary InteractiveObject instance that is affected by the change in focus. shiftKeyfalse; applies only to keyFocusChange events. targetThe InteractiveObject instance that has just lost focus. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/FocusEvent.html#KEY_FOCUS_CHANGE" title="FocusEvent.KEY_FOCUS_CHANGE" text="KEY_FOCUS_CHANGE Defines the value of the type property of a keyFocusChange event object. This event has the following properties: PropertyValue bubblestrue cancelabletrue; call the preventDefault() method to cancel default behavior. currentTargetThe object that is actively processing the Event object with an event listener. keyCodeThe key code value of the key pressed to trigger a keyFocusChange event. relatedObjectThe complementary InteractiveObject instance that is affected by the change in focus. shiftKeytrue if the Shift key modifier is activated; false otherwise. targetThe InteractiveObject instance that currently has focus. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/FocusEvent.html#keyCode" title="FocusEvent.keyCode" text="keyCode The key code value of the key pressed to trigger a keyFocusChange event."/>
<page href="flash/events/FocusEvent.html#MOUSE_FOCUS_CHANGE" title="FocusEvent.MOUSE_FOCUS_CHANGE" text="MOUSE_FOCUS_CHANGE Defines the value of the type property of a mouseFocusChange event object. This event has the following properties: PropertyValue bubblestrue cancelabletrue; call the preventDefault() method to cancel default behavior. currentTargetThe object that is actively processing the Event object with an event listener. keyCode0; applies only to keyFocusChange events. relatedObjectThe complementary InteractiveObject instance that is affected by the change in focus. shiftKeyfalse; applies only to keyFocusChange events. targetThe InteractiveObject instance that currently has focus. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/FocusEvent.html#relatedObject" title="FocusEvent.relatedObject" text="relatedObject A reference to the complementary InteractiveObject instance that is affected by the change in focus. For example, when a focusOut event occurs, the relatedObject represents the InteractiveObject instance that has gained focus."/>
<page href="flash/events/FocusEvent.html#shiftKey" title="FocusEvent.shiftKey" text="shiftKey Indicates whether the Shift key modifier is activated, in which case the value is true. Otherwise, the value is false. This property is used only if the FocusEvent is of type keyFocusChange."/>
<page href="flash/events/FocusEvent.html#event:focusIn" title="FocusEvent.focusIn" text="focusIn Defines the value of the type property of a focusIn event object. This event has the following properties: PropertyValue bubblestrue cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. keyCode0; applies only to keyFocusChange events. relatedObjectThe complementary InteractiveObject instance that is affected by the change in focus. shiftKeyfalse; applies only to keyFocusChange events. targetThe InteractiveObject instance that has just received focus. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/FocusEvent.html#event:focusOut" title="FocusEvent.focusOut" text="focusOut Defines the value of the type property of a focusOut event object. This event has the following properties: PropertyValue bubblestrue cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. keyCode0; applies only to keyFocusChange events. relatedObjectThe complementary InteractiveObject instance that is affected by the change in focus. shiftKeyfalse; applies only to keyFocusChange events. targetThe InteractiveObject instance that has just lost focus. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/FocusEvent.html#event:keyFocusChange" title="FocusEvent.keyFocusChange" text="keyFocusChange Defines the value of the type property of a keyFocusChange event object. This event has the following properties: PropertyValue bubblestrue cancelabletrue; call the preventDefault() method to cancel default behavior. currentTargetThe object that is actively processing the Event object with an event listener. keyCodeThe key code value of the key pressed to trigger a keyFocusChange event. relatedObjectThe complementary InteractiveObject instance that is affected by the change in focus. shiftKeytrue if the Shift key modifier is activated; false otherwise. targetThe InteractiveObject instance that currently has focus. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/FocusEvent.html#event:mouseFocusChange" title="FocusEvent.mouseFocusChange" text="mouseFocusChange Defines the value of the type property of a mouseFocusChange event object. This event has the following properties: PropertyValue bubblestrue cancelabletrue; call the preventDefault() method to cancel default behavior. currentTargetThe object that is actively processing the Event object with an event listener. keyCode0; applies only to keyFocusChange events. relatedObjectThe complementary InteractiveObject instance that is affected by the change in focus. shiftKeyfalse; applies only to keyFocusChange events. targetThe InteractiveObject instance that currently has focus. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/Event.html" title="Event class" text="Event The Event class is used as the base class for the creation of Event objects, which are passed as parameters to event listeners when an event occurs. The properties of the Event class carry basic information about an event, such as the event's type or whether the event's default behavior can be canceled. For many events, such as the events represented by the Event class constants, this basic information is sufficient. Other events, however, may require more detailed information. Events associated with a mouse click, for example, need to include additional information about the location of the click event and whether any keys were pressed during the click event. You can pass such additional information to event listeners by extending the Event class, which is what the MouseEvent class does. The Flash® Player API defines several Event subclasses for common events that require additional information. Events associated with each of the Event subclasses are described in the documentation for each class. The methods of the Event class can be used in event listener functions to affect the behavior of the event object. Some events have an associated default behavior. For example, the doubleClick event has an associated default behavior that highlights the word under the mouse pointer at the time of the event. Your event listener can cancel this behavior by calling the preventDefault() method. You can also make the current event listener the last one to process an event by calling the stopPropagation() or stopImmediatePropagation() method."/>
<page href="flash/events/Event.html#Event()" title="Event.Event()" text="Event Creates an Event object to pass as a parameter to event listeners. type bubbles cancelable The type of the event, accessible as Event.type. Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false. Determines whether the Event object can be canceled. The default values is false."/>
<page href="flash/events/Event.html#clone()" title="Event.clone()" text="clone Duplicates an instance of an Event subclass. Returns a new Event object that is a copy of the original instance of the Event object. You do not normally call clone(); the EventDispatcher class calls it automatically when you redispatch an event—that is, when you call dispatchEvent(event) from a handler that is handling event. The new Event object includes all the properties of the original. When creating your own custom Event class, you must override the inherited Event.clone() method in order for it to duplicate the properties of your custom class. If you do not set all the properties that you add in your event subclass, those properties will not have the correct values when listeners handle the redispatched event. In this example, PingEvent is a subclass of Event and therefore implements its own version of clone(). class PingEvent extends Event { var URL:String; public override function clone():Event { return new PingEvent(type, bubbles, cancelable, URL); } }"/>
<page href="flash/events/Event.html#formatToString()" title="Event.formatToString()" text="formatToString A utility function for implementing the toString() method in your custom Event class. Overriding the toString() method is recommended, but not required. class PingEvent extends Event { var URL:String; public override function toString():String { return formatToString(&quot;PingEvent&quot;, &quot;type&quot;, &quot;bubbles&quot;, &quot;cancelable&quot;, &quot;eventPhase&quot;, &quot;URL&quot;); } } className arguments The name of your custom Event class. In the previous example, the className parameter is PingEvent. The properties of the Event class and the properties that you add in your custom Event class. In the previous example, the ...arguments parameter includes type, bubbles, cancelable, eventPhase, and URL."/>
<page href="flash/events/Event.html#isDefaultPrevented()" title="Event.isDefaultPrevented()" text="isDefaultPrevented Checks whether preventDefault() has been called on the event. If preventDefault() has been called, returns true; otherwise, returns false."/>
<page href="flash/events/Event.html#preventDefault()" title="Event.preventDefault()" text="preventDefault Cancels an event's default behavior if that behavior can be canceled. Many events have associated behaviors that Flash Player carries out by default. For example, if a user types a character into a text field, the default behavior is that the character is displayed in the text field. Because the TextEvent.TEXT_INPUT event's default behavior can be canceled, you can use the preventDefault() method to prevent the character from appearing. An example of a behavior that is not cancelable is the default behavior associated with the Event.REMOVED event, which is generated whenever Flash Player is about to remove a display object from the display list. The default behavior (removing the element) cannot be canceled, so the preventDefault() method has no effect on this default behavior. You can use the Event.cancelable property to check whether you can prevent the default behavior associated with a particular event. If the value of Event.cancelable is true, then preventDefault() can be used to cancel the event; otherwise, preventDefault() has no effect."/>
<page href="flash/events/Event.html#stopImmediatePropagation()" title="Event.stopImmediatePropagation()" text="stopImmediatePropagation Prevents processing of any event listeners in the current node and any subsequent nodes in the event flow. This method takes effect immediately, and it affects event listeners in the current node. In contrast, the stopPropagation() method doesn't take effect until all the event listeners in the current node finish processing. Note: This method does not cancel the behavior associated with this event; see preventDefault() for that functionality."/>
<page href="flash/events/Event.html#stopPropagation()" title="Event.stopPropagation()" text="stopPropagation Prevents processing of any event listeners in nodes subsequent to the current node in the event flow. This method does not affect any event listeners in the current node (currentTarget). In contrast, the stopImmediatePropagation() method prevents processing of event listeners in both the current node and subsequent nodes. Additional calls to this method have no effect. This method can be called in any phase of the event flow. Note: This method does not cancel the behavior associated with this event; see preventDefault() for that functionality."/>
<page href="flash/events/Event.html#toString()" title="Event.toString()" text="toString Returns a string containing all the properties of the Event object. The string is in the following format: [Event type=value bubbles=value cancelable=value]"/>
<page href="flash/events/Event.html#ACTIVATE" title="Event.ACTIVATE" text="ACTIVATE Defines the value of the type property of an activate event object. Note: This event does not go through a &quot;capture phase&quot; and is dispatched directly to the target, whether the target is on the display list or not. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetAny DisplayObject instance with a listener registered for the ACTIVATE event."/>
<page href="flash/events/Event.html#ADDED" title="Event.ADDED" text="ADDED Defines the value of the type property of an added event object. This event has the following properties: PropertyValue bubblestrue cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe DisplayObject instance being added to the display list. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/Event.html#ADDED_TO_STAGE" title="Event.ADDED_TO_STAGE" text="ADDED_TO_STAGE Defines the value of the type property of an addedToStage event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe DisplayObject instance being added to the on stage display list, either directly or through the addition of a sub tree in which the DisplayObject instance is contained. If the DisplayObject instance is being directly added, the added event occurs before this event."/>
<page href="flash/events/Event.html#bubbles" title="Event.bubbles" text="bubbles Indicates whether an event is a bubbling event. If the event can bubble, this value is true; otherwise it is false. When an event occurs, it moves through the three phases of the event flow: the capture phase, which flows from the top of the display list hierarchy to the node just before the target node; the target phase, which comprises the target node; and the bubbling phase, which flows from the node subsequent to the target node back up the display list hierarchy. Some events, such as the activate and unload events, do not have a bubbling phase. The bubbles property has a value of false for events that do not have a bubbling phase."/>
<page href="flash/events/Event.html#CANCEL" title="Event.CANCEL" text="CANCEL Defines the value of the type property of a cancel event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetA reference to the object on which the operation is canceled."/>
<page href="flash/events/Event.html#cancelable" title="Event.cancelable" text="cancelable Indicates whether the behavior associated with the event can be prevented. If the behavior can be canceled, this value is true; otherwise it is false."/>
<page href="flash/events/Event.html#CHANGE" title="Event.CHANGE" text="CHANGE Defines the value of the type property of a change event object. This event has the following properties: PropertyValue bubblestrue cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe object that has had its value modified. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/Event.html#CLOSE" title="Event.CLOSE" text="CLOSE Defines the value of the type property of a close event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe object whose connection has been closed."/>
<page href="flash/events/Event.html#COMPLETE" title="Event.COMPLETE" text="COMPLETE Defines the value of the type property of a complete event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe network object that has completed loading."/>
<page href="flash/events/Event.html#CONNECT" title="Event.CONNECT" text="CONNECT Defines the value of the type property of a connect event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe Socket or XMLSocket object that has established a network connection."/>
<page href="flash/events/Event.html#currentTarget" title="Event.currentTarget" text="currentTarget The object that is actively processing the Event object with an event listener. For example, if a user clicks an OK button, the current target could be the node containing that button or one of its ancestors that has registered an event listener for that event."/>
<page href="flash/events/Event.html#DEACTIVATE" title="Event.DEACTIVATE" text="DEACTIVATE Defines the value of the type property of a deactivate event object. Note: This event does not go through a &quot;capture phase&quot; and is dispatched directly to the target, whether the target is on the display list or not. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetAny DisplayObject instance with a listener registered for the DEACTIVATE event."/>
<page href="flash/events/Event.html#ENTER_FRAME" title="Event.ENTER_FRAME" text="ENTER_FRAME Defines the value of the type property of an enterFrame event object. Note: This event does not go through a &quot;capture phase&quot; and is dispatched directly to the target, whether the target is on the display list or not. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetAny DisplayObject instance with a listener registered for the ENTER_FRAME event."/>
<page href="flash/events/Event.html#eventPhase" title="Event.eventPhase" text="eventPhase The current phase in the event flow. This property can contain the following numeric values: 1 The capture phase (EventPhase.CAPTURING_PHASE). 2 The target phase (EventPhase.AT_TARGET). 3 The bubbling phase (EventPhase.BUBBLING_PHASE)."/>
<page href="flash/events/Event.html#FULLSCREEN" title="Event.FULLSCREEN" text="FULLSCREEN Defines the value of the type property of a fullScreen event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe Stage object."/>
<page href="flash/events/Event.html#ID3" title="Event.ID3" text="ID3 Defines the value of the type property of an id3 event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe Sound object loading the MP3 for which ID3 data is now available. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/Event.html#INIT" title="Event.INIT" text="INIT Defines the value of the type property of an init event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe LoaderInfo object associated with the SWF file being loaded."/>
<page href="flash/events/Event.html#MOUSE_LEAVE" title="Event.MOUSE_LEAVE" text="MOUSE_LEAVE Defines the value of the type property of a mouseLeave event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe Stage object. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/Event.html#OPEN" title="Event.OPEN" text="OPEN Defines the value of the type property of an open event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe network object that has opened a connection."/>
<page href="flash/events/Event.html#REMOVED" title="Event.REMOVED" text="REMOVED Defines the value of the type property of a removed event object. This event has the following properties: PropertyValue bubblestrue cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe DisplayObject instance to be removed from the display list. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/Event.html#REMOVED_FROM_STAGE" title="Event.REMOVED_FROM_STAGE" text="REMOVED_FROM_STAGE Defines the value of the type property of a removedFromStage event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe DisplayObject instance being removed from the on stage display list, either directly or through the removal of a sub tree in which the DisplayObject instance is contained. If the DisplayObject instance is being directly removed, the removed event occurs before this event."/>
<page href="flash/events/Event.html#RENDER" title="Event.RENDER" text="RENDER Defines the value of the type property of a render event object. Note: This event does not go through a &quot;capture phase&quot; and is dispatched directly to the target, whether the target is on the display list or not. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; the default behavior cannot be canceled. currentTargetThe object that is actively processing the Event object with an event listener. targetAny DisplayObject instance with a listener registered for the RENDER event."/>
<page href="flash/events/Event.html#RESIZE" title="Event.RESIZE" text="RESIZE Defines the value of the type property of a resize event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe Stage object."/>
<page href="flash/events/Event.html#SCROLL" title="Event.SCROLL" text="SCROLL Defines the value of the type property of a scroll event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe TextField object that has been scrolled. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/Event.html#SELECT" title="Event.SELECT" text="SELECT Defines the value of the type property of a select event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe FileReference object on which an item has been selected."/>
<page href="flash/events/Event.html#SOUND_COMPLETE" title="Event.SOUND_COMPLETE" text="SOUND_COMPLETE Defines the value of the type property of a soundComplete event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe Sound object on which a sound has finished playing."/>
<page href="flash/events/Event.html#TAB_CHILDREN_CHANGE" title="Event.TAB_CHILDREN_CHANGE" text="TAB_CHILDREN_CHANGE Defines the value of the type property of a tabChildrenChange event object. This event has the following properties: PropertyValue bubblestrue cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe object whose tabChildren flag has changed. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/Event.html#TAB_ENABLED_CHANGE" title="Event.TAB_ENABLED_CHANGE" text="TAB_ENABLED_CHANGE Defines the value of the type property of a tabEnabledChange event object. This event has the following properties: PropertyValue bubblestrue cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe InteractiveObject whose tabEnabled flag has changed. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/Event.html#TAB_INDEX_CHANGE" title="Event.TAB_INDEX_CHANGE" text="TAB_INDEX_CHANGE Defines the value of the type property of a tabIndexChange event object. This event has the following properties: PropertyValue bubblestrue cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe object whose tabIndex has changed. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/Event.html#target" title="Event.target" text="target The event target. This property contains the target node. For example, if a user clicks an OK button, the target node is the display list node containing that button."/>
<page href="flash/events/Event.html#type" title="Event.type" text="type The type of event. The type is case-sensitive."/>
<page href="flash/events/Event.html#UNLOAD" title="Event.UNLOAD" text="UNLOAD Defines the value of the type property of an unload event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe LoaderInfo object associated with the SWF file being unloaded or replaced."/>
<page href="flash/events/Event.html#event:activate" title="Event.activate" text="activate Defines the value of the type property of an activate event object. Note: This event does not go through a &quot;capture phase&quot; and is dispatched directly to the target, whether the target is on the display list or not. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetAny DisplayObject instance with a listener registered for the ACTIVATE event."/>
<page href="flash/events/Event.html#event:added" title="Event.added" text="added Defines the value of the type property of an added event object. This event has the following properties: PropertyValue bubblestrue cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe DisplayObject instance being added to the display list. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/Event.html#event:addedToStage" title="Event.addedToStage" text="addedToStage Defines the value of the type property of an addedToStage event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe DisplayObject instance being added to the on stage display list, either directly or through the addition of a sub tree in which the DisplayObject instance is contained. If the DisplayObject instance is being directly added, the added event occurs before this event."/>
<page href="flash/events/Event.html#event:cancel" title="Event.cancel" text="cancel Defines the value of the type property of a cancel event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetA reference to the object on which the operation is canceled."/>
<page href="flash/events/Event.html#event:change" title="Event.change" text="change Defines the value of the type property of a change event object. This event has the following properties: PropertyValue bubblestrue cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe object that has had its value modified. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/Event.html#event:close" title="Event.close" text="close Defines the value of the type property of a close event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe object whose connection has been closed."/>
<page href="flash/events/Event.html#event:complete" title="Event.complete" text="complete Defines the value of the type property of a complete event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe network object that has completed loading."/>
<page href="flash/events/Event.html#event:connect" title="Event.connect" text="connect Defines the value of the type property of a connect event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe Socket or XMLSocket object that has established a network connection."/>
<page href="flash/events/Event.html#event:deactivate" title="Event.deactivate" text="deactivate Defines the value of the type property of a deactivate event object. Note: This event does not go through a &quot;capture phase&quot; and is dispatched directly to the target, whether the target is on the display list or not. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetAny DisplayObject instance with a listener registered for the DEACTIVATE event."/>
<page href="flash/events/Event.html#event:enterFrame" title="Event.enterFrame" text="enterFrame Defines the value of the type property of an enterFrame event object. Note: This event does not go through a &quot;capture phase&quot; and is dispatched directly to the target, whether the target is on the display list or not. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetAny DisplayObject instance with a listener registered for the ENTER_FRAME event."/>
<page href="flash/events/Event.html#event:fullScreen" title="Event.fullScreen" text="fullScreen Defines the value of the type property of a fullScreen event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe Stage object."/>
<page href="flash/events/Event.html#event:id3" title="Event.id3" text="id3 Defines the value of the type property of an id3 event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe Sound object loading the MP3 for which ID3 data is now available. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/Event.html#event:init" title="Event.init" text="init Defines the value of the type property of an init event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe LoaderInfo object associated with the SWF file being loaded."/>
<page href="flash/events/Event.html#event:mouseLeave" title="Event.mouseLeave" text="mouseLeave Defines the value of the type property of a mouseLeave event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe Stage object. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/Event.html#event:open" title="Event.open" text="open Defines the value of the type property of an open event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe network object that has opened a connection."/>
<page href="flash/events/Event.html#event:removed" title="Event.removed" text="removed Defines the value of the type property of a removed event object. This event has the following properties: PropertyValue bubblestrue cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe DisplayObject instance to be removed from the display list. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/Event.html#event:removedFromStage" title="Event.removedFromStage" text="removedFromStage Defines the value of the type property of a removedFromStage event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe DisplayObject instance being removed from the on stage display list, either directly or through the removal of a sub tree in which the DisplayObject instance is contained. If the DisplayObject instance is being directly removed, the removed event occurs before this event."/>
<page href="flash/events/Event.html#event:render" title="Event.render" text="render Defines the value of the type property of a render event object. Note: This event does not go through a &quot;capture phase&quot; and is dispatched directly to the target, whether the target is on the display list or not. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; the default behavior cannot be canceled. currentTargetThe object that is actively processing the Event object with an event listener. targetAny DisplayObject instance with a listener registered for the RENDER event."/>
<page href="flash/events/Event.html#event:resize" title="Event.resize" text="resize Defines the value of the type property of a resize event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe Stage object."/>
<page href="flash/events/Event.html#event:scroll" title="Event.scroll" text="scroll Defines the value of the type property of a scroll event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe TextField object that has been scrolled. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/Event.html#event:select" title="Event.select" text="select Defines the value of the type property of a select event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe FileReference object on which an item has been selected."/>
<page href="flash/events/Event.html#event:soundComplete" title="Event.soundComplete" text="soundComplete Defines the value of the type property of a soundComplete event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe Sound object on which a sound has finished playing."/>
<page href="flash/events/Event.html#event:tabChildrenChange" title="Event.tabChildrenChange" text="tabChildrenChange Defines the value of the type property of a tabChildrenChange event object. This event has the following properties: PropertyValue bubblestrue cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe object whose tabChildren flag has changed. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/Event.html#event:tabEnabledChange" title="Event.tabEnabledChange" text="tabEnabledChange Defines the value of the type property of a tabEnabledChange event object. This event has the following properties: PropertyValue bubblestrue cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe InteractiveObject whose tabEnabled flag has changed. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/Event.html#event:tabIndexChange" title="Event.tabIndexChange" text="tabIndexChange Defines the value of the type property of a tabIndexChange event object. This event has the following properties: PropertyValue bubblestrue cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe object whose tabIndex has changed. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/Event.html#event:unload" title="Event.unload" text="unload Defines the value of the type property of an unload event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe LoaderInfo object associated with the SWF file being unloaded or replaced."/>
<page href="flash/events/EventDispatcher.html" title="EventDispatcher class" text="EventDispatcher The EventDispatcher class implements the IEventDispatcher interface and is the base class for the DisplayObject class. The EventDispatcher class allows any object on the display list to be an event target and as such, to use the methods of the IEventDispatcher interface. Event targets are an important part of the Flash® Player event model. The event target serves as the focal point for how events flow through the display list hierarchy. When an event such as a mouse click or a keypress occurs, Flash Player dispatches an event object into the event flow from the root of the display list. The event object then makes its way through the display list until it reaches the event target, at which point it begins its return trip through the display list. This round-trip journey to the event target is conceptually divided into three phases: the capture phase comprises the journey from the root to the last node before the event target's node, the target phase comprises only the event target node, and the bubbling phase comprises any subsequent nodes encountered on the return trip to the root of the display list. In general, the easiest way for a user-defined class to gain event dispatching capabilities is to extend EventDispatcher. If this is impossible (that is, if the class is already extending another class), you can instead implement the IEventDispatcher interface, create an EventDispatcher member, and write simple hooks to route calls into the aggregated EventDispatcher."/>
<page href="flash/events/EventDispatcher.html#EventDispatcher()" title="EventDispatcher.EventDispatcher()" text="EventDispatcher Aggregates an instance of the EventDispatcher class. The EventDispatcher class is generally used as a base class, which means that most developers do not need to use this constructor function. However, advanced developers who are implementing the IEventDispatcher interface need to use this constructor. If you are unable to extend the EventDispatcher class and must instead implement the IEventDispatcher interface, use this constructor to aggregate an instance of the EventDispatcher class. target The target object for events dispatched to the EventDispatcher object. This parameter is used when the EventDispatcher instance is aggregated by a class that implements IEventDispatcher; it is necessary so that the containing object can be the target for events. Do not use this parameter in simple cases in which a class extends EventDispatcher."/>
<page href="flash/events/EventDispatcher.html#addEventListener()" title="EventDispatcher.addEventListener()" text="addEventListener Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event. You can register event listeners on all nodes in the display list for a specific type of event, phase, and priority. After you successfully register an event listener, you cannot change its priority through additional calls to addEventListener(). To change a listener's priority, you must first call removeListener(). Then you can register the listener again with the new priority level. Keep in mind that after the listener is registered, subsequent calls to addEventListener() with a different type or useCapture value result in the creation of a separate listener registration. For example, if you first register a listener with useCapture set to true, it listens only during the capture phase. If you call addEventListener() again using the same listener object, but with useCapture set to false, you have two separate listeners: one that listens during the capture phase and another that listens during the target and bubbling phases. You cannot register an event listener for only the target phase or the bubbling phase. Those phases are coupled during registration because bubbling applies only to the ancestors of the target node. If you no longer need an event listener, remove it by calling removeEventListener(), or memory problems could result. Objects with registered event listeners are not automatically removed from memory because the garbage collector does not remove objects that still have references. Copying an EventDispatcher instance does not copy the event listeners attached to it. (If your newly created node needs an event listener, you must attach the listener after creating the node). However, if you move an EventDispatcher instance, the event listeners attached to it move along with it. If the event listener is being registered on a node while an event is being processed on this node, the event listener is not triggered during the current phase but can be triggered during a later phase in the event flow, such as the bubbling phase. If an event listener is removed from a node while an event is being processed on the node, it is still triggered by the current actions. After it is removed, the event listener is never invoked again (unless registered again for future processing). type listener useCapture priority useWeakReference The type of event. The listener function that processes the event. This function must accept an Event object as its only parameter and must return nothing, as this example shows: function(evt:Event):void The function can have any name. Determines whether the listener works in the capture phase or the target and bubbling phases. If useCapture is set to true, the listener processes the event only during the capture phase and not in the target or bubbling phase. If useCapture is false, the listener processes the event only during the target or bubbling phase. To listen for the event in all three phases, call addEventListener twice, once with the useCapture set to true, then again with useCapture set to false. The priority level of the event listener. The priority is designated by a signed 32-bit integer. The higher the number, the higher the priority. All listeners with priority n are processed before listeners of priority n-1. If two or more listeners share the same priority, they are processed in the order in which they were added. The default priority is 0. Determines whether the reference to the listener is strong or weak. A strong reference (the default) prevents your listener from being garbage-collected. A weak reference does not. Class-level member functions are not subject to garbage collection, so you can set useWeakReference to true for class-level member functions without subjecting them to garbage collection. If you set useWeakReference to true for a listener that is a nested inner function, the function will be garbge-collected and no longer persistent. If you create references to the inner function (save it in another variable) then it is not garbage-collected and stays persistent. The listener specified is not a function."/>
<page href="flash/events/EventDispatcher.html#dispatchEvent()" title="EventDispatcher.dispatchEvent()" text="dispatchEvent Dispatches an event into the event flow. The event target is the EventDispatcher object upon which the dispatchEvent() method is called. event The Event object that is dispatched into the event flow. If the event is being redispatched, a clone of the event is created automatically. After an event is dispatched, its target property cannot be changed, so you must create a new copy of the event for redispatching to work. The event dispatch recursion limit has been reached."/>
<page href="flash/events/EventDispatcher.html#hasEventListener()" title="EventDispatcher.hasEventListener()" text="hasEventListener Checks whether the EventDispatcher object has any listeners registered for a specific type of event. This allows you to determine where an EventDispatcher object has altered handling of an event type in the event flow hierarchy. To determine whether a specific event type actually triggers an event listener, use willTrigger(). The difference between hasEventListener() and willTrigger() is that hasEventListener() examines only the object to which it belongs, whereas willTrigger() examines the entire event flow for the event specified by the type parameter. When hasEventListener() is called from a LoaderInfo object, only the listeners that the caller can access are considered. type The type of event."/>
<page href="flash/events/EventDispatcher.html#removeEventListener()" title="EventDispatcher.removeEventListener()" text="removeEventListener Removes a listener from the EventDispatcher object. If there is no matching listener registered with the EventDispatcher object, a call to this method has no effect. type listener useCapture The type of event. The listener object to remove. Specifies whether the listener was registered for the capture phase or the target and bubbling phases. If the listener was registered for both the capture phase and the target and bubbling phases, two calls to removeEventListener() are required to remove both, one call with useCapture() set to true, and another call with useCapture() set to false."/>
<page href="flash/events/EventDispatcher.html#willTrigger()" title="EventDispatcher.willTrigger()" text="willTrigger Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type. This method returns true if an event listener is triggered during any phase of the event flow when an event of the specified type is dispatched to this EventDispatcher object or any of its descendants. The difference between the hasEventListener() and the willTrigger() methods is that hasEventListener() examines only the object to which it belongs, whereas the willTrigger() method examines the entire event flow for the event specified by the type parameter. When willTrigger() is called from a LoaderInfo object, only the listeners that the caller can access are considered. type The type of event."/>
<page href="flash/events/EventDispatcher.html#event:activate" title="EventDispatcher.activate" text="activate Dispatched when Flash Player gains operating system focus and becomes active."/>
<page href="flash/events/EventDispatcher.html#event:deactivate" title="EventDispatcher.deactivate" text="deactivate Dispatched when Flash Player loses operating system focus and is becoming inactive."/>
<page href="flash/events/IEventDispatcher.html" title="IEventDispatcher interface" text="IEventDispatcher The IEventDispatcher interface defines methods for adding or removing event listeners, checks whether specific types of event listeners are registered, and dispatches events. Event targets are an important part of the Flash® Player event model. The event target serves as the focal point for how events flow through the display list hierarchy. When an event such as a mouse click or a keypress occurs, Flash Player dispatches an Event object into the event flow from the root of the display list. The Event object makes a round-trip journey to the event target, which is conceptually divided into three phases: the capture phase includes the journey from the root to the last node before the event target's node; the target phase includes only the event target node; and the bubbling phase includes any subsequent nodes encountered on the return trip to the root of the display list. In general, the easiest way for a user-defined class to gain event dispatching capabilities is to extend EventDispatcher. If this is impossible (that is, if the class is already extending another class), you can instead implement the IEventDispatcher interface, create an EventDispatcher member, and write simple hooks to route calls into the aggregated EventDispatcher."/>
<page href="flash/events/IEventDispatcher.html#addEventListener()" title="IEventDispatcher.addEventListener()" text="addEventListener Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event. You can register event listeners on all nodes in the display list for a specific type of event, phase, and priority. After you successfully register an event listener, you cannot change its priority through additional calls to addEventListener(). To change a listener's priority, you must first call removeEventListener(). Then you can register the listener again with the new priority level. After the listener is registered, subsequent calls to addEventListener() with a different value for either type or useCapture result in the creation of a separate listener registration. For example, if you first register a listener with useCapture set to true, it listens only during the capture phase. If you call addEventListener() again using the same listener object, but with useCapture set to false, you have two separate listeners: one that listens during the capture phase, and another that listens during the target and bubbling phases. You cannot register an event listener for only the target phase or the bubbling phase. Those phases are coupled during registration because bubbling applies only to the ancestors of the target node. When you no longer need an event listener, remove it by calling EventDispatcher.removeEventListener(); otherwise, memory problems might result. Objects with registered event listeners are not automatically removed from memory because the garbage collector does not remove objects that still have references. Copying an EventDispatcher instance does not copy the event listeners attached to it. (If your newly created node needs an event listener, you must attach the listener after creating the node.) However, if you move an EventDispatcher instance, the event listeners attached to it move along with it. If the event listener is being registered on a node while an event is also being processed on this node, the event listener is not triggered during the current phase but may be triggered during a later phase in the event flow, such as the bubbling phase. If an event listener is removed from a node while an event is being processed on the node, it is still triggered by the current actions. After it is removed, the event listener is never invoked again (unless it is registered again for future processing). type listener useCapture priority useWeakReference The type of event. The listener function that processes the event. This function must accept an Event object as its only parameter and must return nothing, as this example shows: function(evt:Event):void The function can have any name. Determines whether the listener works in the capture phase or the target and bubbling phases. If useCapture is set to true, the listener processes the event only during the capture phase and not in the target or bubbling phase. If useCapture is false, the listener processes the event only during the target or bubbling phase. To listen for the event in all three phases, call addEventListener() twice, once with useCapture set to true, then again with useCapture set to false. The priority level of the event listener. Priorities are designated by a 32-bit integer. The higher the number, the higher the priority. All listeners with priority n are processed before listeners of priority n-1. If two or more listeners share the same priority, they are processed in the order in which they were added. The default priority is 0. Determines whether the reference to the listener is strong or weak. A strong reference (the default) prevents your listener from being garbage-collected. A weak reference does not. Class-level member functions are not subject to garbage collection, so you can set useWeakReference to true for class-level member functions without subjecting them to garbage collection. If you set useWeakReference to true for a listener that is a nested inner function, the function will be garbge-collected and no longer persistent. If you create references to the inner function (save it in another variable) then it is not garbage-collected and stays persistent."/>
<page href="flash/events/IEventDispatcher.html#dispatchEvent()" title="IEventDispatcher.dispatchEvent()" text="dispatchEvent Dispatches an event into the event flow. The event target is the EventDispatcher object upon which dispatchEvent() is called. event The Event object dispatched into the event flow."/>
<page href="flash/events/IEventDispatcher.html#hasEventListener()" title="IEventDispatcher.hasEventListener()" text="hasEventListener Checks whether the EventDispatcher object has any listeners registered for a specific type of event. This allows you to determine where an EventDispatcher object has altered handling of an event type in the event flow hierarchy. To determine whether a specific event type will actually trigger an event listener, use IEventDispatcher.willTrigger(). The difference between hasEventListener() and willTrigger() is that hasEventListener() examines only the object to which it belongs, whereas willTrigger() examines the entire event flow for the event specified by the type parameter. type The type of event."/>
<page href="flash/events/IEventDispatcher.html#removeEventListener()" title="IEventDispatcher.removeEventListener()" text="removeEventListener Removes a listener from the EventDispatcher object. If there is no matching listener registered with the EventDispatcher object, a call to this method has no effect. type listener useCapture The type of event. The listener object to remove. Specifies whether the listener was registered for the capture phase or the target and bubbling phases. If the listener was registered for both the capture phase and the target and bubbling phases, two calls to removeEventListener() are required to remove both: one call with useCapture set to true, and another call with useCapture set to false."/>
<page href="flash/events/IEventDispatcher.html#willTrigger()" title="IEventDispatcher.willTrigger()" text="willTrigger Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type. This method returns true if an event listener is triggered during any phase of the event flow when an event of the specified type is dispatched to this EventDispatcher object or any of its descendants. The difference between hasEventListener() and willTrigger() is that hasEventListener() examines only the object to which it belongs, whereas willTrigger() examines the entire event flow for the event specified by the type parameter. type The type of event."/>
<page href="flash/events/StatusEvent.html" title="StatusEvent class" text="StatusEvent Flash® Player dispatches StatusEvent objects when a device, such as a camera or microphone, or an object such as a LocalConnection object reports its status. There is only one type of status event: StatusEvent.STATUS."/>
<page href="flash/events/StatusEvent.html#StatusEvent()" title="StatusEvent.StatusEvent()" text="StatusEvent Creates an Event object that contains information about status events. Event objects are passed as parameters to event listeners. type bubbles cancelable code level The type of the event. Event listeners can access this information through the inherited type property. There is only one type of status event: StatusEvent.STATUS. Determines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. Determines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. A description of the object's status. Event listeners can access this information through the code property. The category of the message, such as &quot;status&quot;, &quot;warning&quot; or &quot;error&quot;. Event listeners can access this information through the level property."/>
<page href="flash/events/StatusEvent.html#clone()" title="StatusEvent.clone()" text="clone Creates a copy of the StatusEvent object and sets the value of each property to match that of the original."/>
<page href="flash/events/StatusEvent.html#toString()" title="StatusEvent.toString()" text="toString Returns a string that contains all the properties of the StatusEvent object. The string is in the following format: [StatusEvent type=value bubbles=value cancelable=value code=value level=value]"/>
<page href="flash/events/StatusEvent.html#code" title="StatusEvent.code" text="code A description of the object's status."/>
<page href="flash/events/StatusEvent.html#level" title="StatusEvent.level" text="level The category of the message, such as &quot;status&quot;, &quot;warning&quot; or &quot;error&quot;."/>
<page href="flash/events/StatusEvent.html#STATUS" title="StatusEvent.STATUS" text="STATUS Defines the value of the type property of a status event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. codeA description of the object's status. currentTargetThe object that is actively processing the Event object with an event listener. levelThe category of the message, such as &quot;status&quot;, &quot;warning&quot; or &quot;error&quot;. targetThe object reporting its status."/>
<page href="flash/events/StatusEvent.html#event:status" title="StatusEvent.status" text="status Defines the value of the type property of a status event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. codeA description of the object's status. currentTargetThe object that is actively processing the Event object with an event listener. levelThe category of the message, such as &quot;status&quot;, &quot;warning&quot; or &quot;error&quot;. targetThe object reporting its status."/>
<page href="flash/events/AsyncErrorEvent.html" title="AsyncErrorEvent class" text="AsyncErrorEvent Flash® Player dispatches an AsyncErrorEvent when an exception is thrown from native asynchronous code, which could be from, for example, LocalConnection, NetConnection, SharedObject, or NetStream. There is only one type of asynchronous error event: AsyncErrorEvent.ASYNC_ERROR."/>
<page href="flash/events/AsyncErrorEvent.html#AsyncErrorEvent()" title="AsyncErrorEvent.AsyncErrorEvent()" text="AsyncErrorEvent Creates an AsyncErrorEvent object that contains information about asyncError events. AsyncErrorEvent objects are passed as parameters to event listeners. type bubbles cancelable text error The type of the event. Event listeners can access this information through the inherited type property. There is only one type of error event: ErrorEvent.ERROR. Determines whether the Event object bubbles. Event listeners can access this information through the inherited bubbles property. Determines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. Text to be displayed as an error message. Event listeners can access this information through the text property. The exception that occurred."/>
<page href="flash/events/AsyncErrorEvent.html#clone()" title="AsyncErrorEvent.clone()" text="clone Creates a copy of the AsyncErrorEvent object and sets the value of each property to match that of the original."/>
<page href="flash/events/AsyncErrorEvent.html#toString()" title="AsyncErrorEvent.toString()" text="toString Returns a string that contains all the properties of the AsyncErrorEvent object. The string is in the following format: [AsyncErrorEvent type=value bubbles=value cancelable=value ... error=value]"/>
<page href="flash/events/AsyncErrorEvent.html#ASYNC_ERROR" title="AsyncErrorEvent.ASYNC_ERROR" text="ASYNC_ERROR The AsyncErrorEvent.ASYNC_ERROR constant defines the value of the type property of an asyncError event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe object experiencing a network operation failure. errorThe error that triggered the event."/>
<page href="flash/events/AsyncErrorEvent.html#error" title="AsyncErrorEvent.error" text="error The exception that was thrown."/>
<page href="flash/events/AsyncErrorEvent.html#event:asyncError" title="AsyncErrorEvent.asyncError" text="asyncError The AsyncErrorEvent.ASYNC_ERROR constant defines the value of the type property of an asyncError event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe object experiencing a network operation failure. errorThe error that triggered the event."/>
<page href="flash/events/FullScreenEvent.html" title="FullScreenEvent class" text="FullScreenEvent Flash® Player dispatches a FullScreenEvent object whenever the Stage enters or leaves full-screen display mode. There is only one type of fullScreen event: FullScreenEvent.FULL_SCREEN."/>
<page href="flash/events/FullScreenEvent.html#FullScreenEvent()" title="FullScreenEvent.FullScreenEvent()" text="FullScreenEvent Creates an event object that contains information about fullScreen events. Event objects are passed as parameters to event listeners. type bubbles cancelable fullScreen The type of the event. Event listeners can access this information through the inherited type property. There is only one type of fullScreen event: FullScreenEvent.FULL_SCREEN. Determines whether the Event object participates in the bubbling phase of the event flow. Event listeners can access this information through the inherited bubbles property. Determines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. Indicates whether the device is activating (true) or deactivating (false). Event listeners can access this information through the activating property."/>
<page href="flash/events/FullScreenEvent.html#clone()" title="FullScreenEvent.clone()" text="clone Creates a copy of a FullScreenEvent object and sets the value of each property to match that of the original."/>
<page href="flash/events/FullScreenEvent.html#toString()" title="FullScreenEvent.toString()" text="toString Returns a string that contains all the properties of the FullScreenEvent object. The following format is used: [FullScreenEvent type=value bubbles=value cancelable=value activating=value]"/>
<page href="flash/events/FullScreenEvent.html#FULL_SCREEN" title="FullScreenEvent.FULL_SCREEN" text="FULL_SCREEN The FullScreenEvent.FULL_SCREEN constant defines the value of the type property of a fullScreen event object. This event has the following properties: PropertyValue fullScreentrue if the display state is full screen or false if it is normal. bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe Stage object."/>
<page href="flash/events/FullScreenEvent.html#fullScreen" title="FullScreenEvent.fullScreen" text="fullScreen Indicates whether the Stage object is in full-screen mode (true) or not (false)."/>
<page href="flash/events/FullScreenEvent.html#event:fullScreen" title="FullScreenEvent.fullScreen" text="fullScreen The FullScreenEvent.FULL_SCREEN constant defines the value of the type property of a fullScreen event object. This event has the following properties: PropertyValue fullScreentrue if the display state is full screen or false if it is normal. bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe Stage object."/>
<page href="flash/events/TextEvent.html" title="TextEvent class" text="TextEvent Flash® Player dispatches TextEvent objects when a user enters text in a text field or clicks a hyperlink in an HTML-enabled text field. There are two types of text events: TextEvent.LINK and TextEvent.TEXT_INPUT."/>
<page href="flash/events/TextEvent.html#TextEvent()" title="TextEvent.TextEvent()" text="TextEvent Creates an Event object that contains information about text events. Event objects are passed as parameters to event listeners. type bubbles cancelable text The type of the event. Event listeners can access this information through the inherited type property. Possible values are: TextEvent.LINK and TextEvent.TEXT_INPUT. Determines whether the Event object participates in the bubbling phase of the event flow. Event listeners can access this information through the inherited bubbles property. Determines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. One or more characters of text entered by the user. Event listeners can access this information through the text property."/>
<page href="flash/events/TextEvent.html#clone()" title="TextEvent.clone()" text="clone Creates a copy of the TextEvent object and sets the value of each property to match that of the original."/>
<page href="flash/events/TextEvent.html#toString()" title="TextEvent.toString()" text="toString Returns a string that contains all the properties of the TextEvent object. The string is in the following format: [TextEvent type=value bubbles=value cancelable=value text=value]"/>
<page href="flash/events/TextEvent.html#LINK" title="TextEvent.LINK" text="LINK Defines the value of the type property of a link event object. This event has the following properties: PropertyValue bubblestrue cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe text field containing the hyperlink that has been clicked. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event. textThe remainder of the URL after &quot;event:&quot; In this example, a click on a hyperlink in HTML text will trigger a text event. Depending on the link, either the user is routed to a designated website based on the system's operating system or a circle is drawn based on the user's selected radius. A text field is created and its content is set to an HTML-formatted string using the htmlText property. The links are underlined in order for them to be better identified by the viewer. (Flash Player only changes the mouse pointer once the mouse is over the link.) To make sure the user's mouse click will invoke an ActionScript method, the URL of the link begins with the string &quot;event:&quot; and a listener is added for the TextEvent.LINK event. The linkHandler() method that is triggered once the user clicks on a link manages all the link events for the text field. The first if statement checks the text property of the event, which holds the remainder of the URL after the &quot;event:&quot; string. If the user has clicked on the link for the operating system, the name of the user's current operating system, taken from the system's Capabilities.os property, is used to route the user to the designated website. Otherwise, the selected radius size, passed via the event's text property, is used to draw a circle below the text field. Each time the user clicks on the radius link the earlier circle is cleared and a new red circle with the selected radius size is drawn. package { import flash.display.Sprite; import flash.events.TextEvent; import flash.errors.IOError; import flash.events.IOErrorEvent; import flash.system.Capabilities; import flash.net.navigateToURL; import flash.net.URLRequest; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.display.Shape; import flash.display.Graphics; public class TextEvent_LINKExample extends Sprite { private var myCircle:Shape = new Shape(); public function TextEvent_LINKExample() { var myTextField:TextField = new TextField(); myTextField.autoSize = TextFieldAutoSize.LEFT; myTextField.multiline = true; myTextField.background = true; myTextField.htmlText = &quot;Draw a circle with the radius of &lt;u&gt;&lt;a href=\&quot;event:20\&quot;&gt;20 pixels&lt;/a&gt;&lt;/u&gt;.&lt;br&gt;&quot; + &quot;Draw a circle with the radius of &lt;u&gt;&lt;a href=\&quot;event:50\&quot;&gt;50 pixels&lt;/a&gt;&lt;/u&gt;.&lt;br&gt;&lt;br&gt;&quot; + &quot;&lt;u&gt;&lt;a href=\&quot;event:os\&quot;&gt;Learn about your operating system.&lt;/a&gt;&lt;/u&gt;&lt;br&gt;&quot;; myTextField.addEventListener(TextEvent.LINK, linkHandler); this.addChild(myTextField); this.addChild(myCircle); } private function linkHandler(e:TextEvent):void { var osString:String = Capabilities.os; if(e.text == &quot;os&quot;) { if (osString.search(/Windows/) != -1 ){ navigateToURL(new URLRequest(&quot;http://www.microsoft.com/&quot;), &quot;_self&quot;); }else if (osString.search(/Mac/) != -1 ) { navigateToURL(new URLRequest(&quot;http://www.apple.com/&quot;), &quot;_self&quot;); } else if (osString.search(/linux/i)!= -1) { navigateToURL(new URLRequest(&quot;http://www.tldp.org/&quot;), &quot;_self&quot;); } } else { myCircle.graphics.clear(); myCircle.graphics.beginFill(0xFF0000); myCircle.graphics.drawCircle(100, 150, Number(e.text)); myCircle.graphics.endFill(); } } } }"/>
<page href="flash/events/TextEvent.html#text" title="TextEvent.text" text="text For a textInput event, the character or sequence of characters entered by the user. For a link event, the text of the event attribute of the href attribute of the &lt;a&gt; tag. The following code shows that the link event is dispatched when a user clicks the hypertext link: import flash.text.TextField; import flash.events.TextEvent; var tf:TextField = new TextField(); tf.htmlText = &quot;&lt;a href='event:myEvent'&gt;Click Me.&lt;/a&gt;&quot;; tf.addEventListener(&quot;link&quot;, clickHandler); addChild(tf); function clickHandler(e:TextEvent):void { trace(e.type); // link trace(e.text); // myEvent }"/>
<page href="flash/events/TextEvent.html#TEXT_INPUT" title="TextEvent.TEXT_INPUT" text="TEXT_INPUT Defines the value of the type property of a textInput event object. This event has the following properties: PropertyValue bubblestrue cancelabletrue; call the preventDefault() method to cancel default behavior. currentTargetThe object that is actively processing the Event object with an event listener. targetThe text field into which characters are being entered. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event. textThe character or sequence of characters entered by the user. The following example guides the user in generating a special combination key (similar to a password). This combination key is made of seven alphanumerical characters, where the second and fifth character positions are numeric. Three text fields for the preliminary instructions, the user input, and the warning (error) messages are created. An event listener is added to respond to the user's text input by triggering the textInputHandler() method. (Every time the user makes an input, a TextEvent.TEXT_INPUT event is dispatched. Note that the text events are dispatched when a user enters text characters and not as a response to any keyboard input, such as backspace. In order to catch all keyboard events, a listener for the KeyboardEvent event should be used.) The textInputHandler() method controls and manages the user input. First, the preventDefault() method is used to prevent Flash Player from immediately displaying the text in the input text field. The program is then responsible for updating the field. In order to undo the user's deletion or modification to the already inputted characters (the result string), the content of the input text field is reassigned to the result string when a user inputs some new text. Also in order to produce a consistent user experience, the setSelection() method places the insertion point (caret) position after the last selected character in the text field. The first if statement in the textInputHandler() method checks the input for the second and fifth character positions of the combination key, which must be a number. If the user input is correct, the updateCombination() method is called and the combination key string (result) is appended with the user input. The updateCombination() method also moves the insert point position to after the selected character. Once the seven characters are inputted, the last if statement in the textInputHandler() method turns the inputTextField text field type from INPUT to DYNAMIC, which means the user will no longer be able to make any input or change the content. package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFieldType; import flash.text.TextFieldAutoSize; import flash.events.TextEvent; public class TextEvent_TEXT_INPUTExample extends Sprite { private var instructionTextField:TextField = new TextField(); private var inputTextField:TextField = new TextField(); private var warningTextField:TextField = new TextField(); private var result:String = &quot;&quot;; public function TextEvent_TEXT_INPUTExample() { instructionTextField.x = 10; instructionTextField.y = 10; instructionTextField.background = true; instructionTextField.autoSize = TextFieldAutoSize.LEFT; instructionTextField.text = &quot;Please enter a value in the format A#AA#AA,\n&quot; + &quot;where 'A' represents a letter and '#' represents a number.\n&quot; + &quot;(Note that once you input a character you can't change it.)&quot; ; inputTextField.x = 10; inputTextField.y = 70; inputTextField.height = 20; inputTextField.width = 75; inputTextField.background = true; inputTextField.border = true; inputTextField.type = TextFieldType.INPUT; warningTextField.x = 10; warningTextField.y = 100; warningTextField.autoSize = TextFieldAutoSize.LEFT; inputTextField.addEventListener(TextEvent.TEXT_INPUT, textInputHandler); this.addChild(instructionTextField); this.addChild(inputTextField); this.addChild(warningTextField); } private function textInputHandler(event:TextEvent):void { var charExp:RegExp = /[a-zA-z]/; var numExp:RegExp = /[0-9]/; event.preventDefault(); inputTextField.text = result; inputTextField.setSelection(result.length + 1, result.length + 1); if (inputTextField.text.length == 1 || inputTextField.text.length == 4) { if(numExp.test(event.text) == true) { updateCombination(event.text); } else { warningTextField.text = &quot;You need a single digit number.&quot;; } }else { if(charExp.test(event.text) == true) { updateCombination(event.text); } else { warningTextField.text = &quot;You need an alphabet character.&quot;; } } if(inputTextField.text.length == 7) { inputTextField.type = TextFieldType.DYNAMIC; instructionTextField.text = &quot;CONGRATULATIONS. You've done.&quot;; } } private function updateCombination(s:String):void { warningTextField.text = &quot;&quot;; result += s; inputTextField.text = result; inputTextField.setSelection(result.length + 1, result.length + 1); } } }"/>
<page href="flash/events/TextEvent.html#event:link" title="TextEvent.link" text="link Defines the value of the type property of a link event object. This event has the following properties: PropertyValue bubblestrue cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe text field containing the hyperlink that has been clicked. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event. textThe remainder of the URL after &quot;event:&quot; In this example, a click on a hyperlink in HTML text will trigger a text event. Depending on the link, either the user is routed to a designated website based on the system's operating system or a circle is drawn based on the user's selected radius. A text field is created and its content is set to an HTML-formatted string using the htmlText property. The links are underlined in order for them to be better identified by the viewer. (Flash Player only changes the mouse pointer once the mouse is over the link.) To make sure the user's mouse click will invoke an ActionScript method, the URL of the link begins with the string &quot;event:&quot; and a listener is added for the TextEvent.LINK event. The linkHandler() method that is triggered once the user clicks on a link manages all the link events for the text field. The first if statement checks the text property of the event, which holds the remainder of the URL after the &quot;event:&quot; string. If the user has clicked on the link for the operating system, the name of the user's current operating system, taken from the system's Capabilities.os property, is used to route the user to the designated website. Otherwise, the selected radius size, passed via the event's text property, is used to draw a circle below the text field. Each time the user clicks on the radius link the earlier circle is cleared and a new red circle with the selected radius size is drawn. package { import flash.display.Sprite; import flash.events.TextEvent; import flash.errors.IOError; import flash.events.IOErrorEvent; import flash.system.Capabilities; import flash.net.navigateToURL; import flash.net.URLRequest; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.display.Shape; import flash.display.Graphics; public class TextEvent_LINKExample extends Sprite { private var myCircle:Shape = new Shape(); public function TextEvent_LINKExample() { var myTextField:TextField = new TextField(); myTextField.autoSize = TextFieldAutoSize.LEFT; myTextField.multiline = true; myTextField.background = true; myTextField.htmlText = &quot;Draw a circle with the radius of &lt;u&gt;&lt;a href=\&quot;event:20\&quot;&gt;20 pixels&lt;/a&gt;&lt;/u&gt;.&lt;br&gt;&quot; + &quot;Draw a circle with the radius of &lt;u&gt;&lt;a href=\&quot;event:50\&quot;&gt;50 pixels&lt;/a&gt;&lt;/u&gt;.&lt;br&gt;&lt;br&gt;&quot; + &quot;&lt;u&gt;&lt;a href=\&quot;event:os\&quot;&gt;Learn about your operating system.&lt;/a&gt;&lt;/u&gt;&lt;br&gt;&quot;; myTextField.addEventListener(TextEvent.LINK, linkHandler); this.addChild(myTextField); this.addChild(myCircle); } private function linkHandler(e:TextEvent):void { var osString:String = Capabilities.os; if(e.text == &quot;os&quot;) { if (osString.search(/Windows/) != -1 ){ navigateToURL(new URLRequest(&quot;http://www.microsoft.com/&quot;), &quot;_self&quot;); }else if (osString.search(/Mac/) != -1 ) { navigateToURL(new URLRequest(&quot;http://www.apple.com/&quot;), &quot;_self&quot;); } else if (osString.search(/linux/i)!= -1) { navigateToURL(new URLRequest(&quot;http://www.tldp.org/&quot;), &quot;_self&quot;); } } else { myCircle.graphics.clear(); myCircle.graphics.beginFill(0xFF0000); myCircle.graphics.drawCircle(100, 150, Number(e.text)); myCircle.graphics.endFill(); } } } }"/>
<page href="flash/events/TextEvent.html#event:textInput" title="TextEvent.textInput" text="textInput Defines the value of the type property of a textInput event object. This event has the following properties: PropertyValue bubblestrue cancelabletrue; call the preventDefault() method to cancel default behavior. currentTargetThe object that is actively processing the Event object with an event listener. targetThe text field into which characters are being entered. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event. textThe character or sequence of characters entered by the user. The following example guides the user in generating a special combination key (similar to a password). This combination key is made of seven alphanumerical characters, where the second and fifth character positions are numeric. Three text fields for the preliminary instructions, the user input, and the warning (error) messages are created. An event listener is added to respond to the user's text input by triggering the textInputHandler() method. (Every time the user makes an input, a TextEvent.TEXT_INPUT event is dispatched. Note that the text events are dispatched when a user enters text characters and not as a response to any keyboard input, such as backspace. In order to catch all keyboard events, a listener for the KeyboardEvent event should be used.) The textInputHandler() method controls and manages the user input. First, the preventDefault() method is used to prevent Flash Player from immediately displaying the text in the input text field. The program is then responsible for updating the field. In order to undo the user's deletion or modification to the already inputted characters (the result string), the content of the input text field is reassigned to the result string when a user inputs some new text. Also in order to produce a consistent user experience, the setSelection() method places the insertion point (caret) position after the last selected character in the text field. The first if statement in the textInputHandler() method checks the input for the second and fifth character positions of the combination key, which must be a number. If the user input is correct, the updateCombination() method is called and the combination key string (result) is appended with the user input. The updateCombination() method also moves the insert point position to after the selected character. Once the seven characters are inputted, the last if statement in the textInputHandler() method turns the inputTextField text field type from INPUT to DYNAMIC, which means the user will no longer be able to make any input or change the content. package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFieldType; import flash.text.TextFieldAutoSize; import flash.events.TextEvent; public class TextEvent_TEXT_INPUTExample extends Sprite { private var instructionTextField:TextField = new TextField(); private var inputTextField:TextField = new TextField(); private var warningTextField:TextField = new TextField(); private var result:String = &quot;&quot;; public function TextEvent_TEXT_INPUTExample() { instructionTextField.x = 10; instructionTextField.y = 10; instructionTextField.background = true; instructionTextField.autoSize = TextFieldAutoSize.LEFT; instructionTextField.text = &quot;Please enter a value in the format A#AA#AA,\n&quot; + &quot;where 'A' represents a letter and '#' represents a number.\n&quot; + &quot;(Note that once you input a character you can't change it.)&quot; ; inputTextField.x = 10; inputTextField.y = 70; inputTextField.height = 20; inputTextField.width = 75; inputTextField.background = true; inputTextField.border = true; inputTextField.type = TextFieldType.INPUT; warningTextField.x = 10; warningTextField.y = 100; warningTextField.autoSize = TextFieldAutoSize.LEFT; inputTextField.addEventListener(TextEvent.TEXT_INPUT, textInputHandler); this.addChild(instructionTextField); this.addChild(inputTextField); this.addChild(warningTextField); } private function textInputHandler(event:TextEvent):void { var charExp:RegExp = /[a-zA-z]/; var numExp:RegExp = /[0-9]/; event.preventDefault(); inputTextField.text = result; inputTextField.setSelection(result.length + 1, result.length + 1); if (inputTextField.text.length == 1 || inputTextField.text.length == 4) { if(numExp.test(event.text) == true) { updateCombination(event.text); } else { warningTextField.text = &quot;You need a single digit number.&quot;; } }else { if(charExp.test(event.text) == true) { updateCombination(event.text); } else { warningTextField.text = &quot;You need an alphabet character.&quot;; } } if(inputTextField.text.length == 7) { inputTextField.type = TextFieldType.DYNAMIC; instructionTextField.text = &quot;CONGRATULATIONS. You've done.&quot;; } } private function updateCombination(s:String):void { warningTextField.text = &quot;&quot;; result += s; inputTextField.text = result; inputTextField.setSelection(result.length + 1, result.length + 1); } } }"/>
<page href="flash/events/ProgressEvent.html" title="ProgressEvent class" text="ProgressEvent Flash® Player dispatches ProgressEvent objects when a load operation has begun or a socket has received data. These events are usually generated when SWF files, images or data are loaded into Flash Player. There are two types of progress events: ProgressEvent.PROGRESS and ProgressEvent.SOCKET_DATA."/>
<page href="flash/events/ProgressEvent.html#ProgressEvent()" title="ProgressEvent.ProgressEvent()" text="ProgressEvent Creates an Event object that contains information about progress events. Event objects are passed as parameters to event listeners. type bubbles cancelable bytesLoaded bytesTotal The type of the event. Possible values are:ProgressEvent.PROGRESS and ProgressEvent.SOCKET_DATA. Determines whether the Event object participates in the bubbling stage of the event flow. Determines whether the Event object can be canceled. The number of items or bytes loaded at the time the listener processes the event. The total number of items or bytes that will be loaded if the loading process succeeds."/>
<page href="flash/events/ProgressEvent.html#clone()" title="ProgressEvent.clone()" text="clone Creates a copy of the ProgressEvent object and sets each property's value to match that of the original."/>
<page href="flash/events/ProgressEvent.html#toString()" title="ProgressEvent.toString()" text="toString Returns a string that contains all the properties of the ProgressEvent object. The string is in the following format: [ProgressEvent type=value bubbles=value cancelable=value bytesLoaded=value bytesTotal=value]"/>
<page href="flash/events/ProgressEvent.html#bytesLoaded" title="ProgressEvent.bytesLoaded" text="bytesLoaded The number of items or bytes loaded when the listener processes the event."/>
<page href="flash/events/ProgressEvent.html#bytesTotal" title="ProgressEvent.bytesTotal" text="bytesTotal The total number of items or bytes that will be loaded if the loading process succeeds."/>
<page href="flash/events/ProgressEvent.html#PROGRESS" title="ProgressEvent.PROGRESS" text="PROGRESS Defines the value of the type property of a progress event object. This event has the following properties: PropertyValue bubblesfalse bytesLoadedThe number of items or bytes loaded at the time the listener processes the event. bytesTotalThe total number of items or bytes that ultimately will be loaded if the loading process succeeds. cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe network object reporting progress."/>
<page href="flash/events/ProgressEvent.html#SOCKET_DATA" title="ProgressEvent.SOCKET_DATA" text="SOCKET_DATA Defines the value of the type property of a socketData event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event. bytesLoadedThe number of items or bytes loaded at the time the listener processes the event. bytesTotal0; this property is not used by socketData event objects. targetThe Socket object reporting progress."/>
<page href="flash/events/ProgressEvent.html#event:progress" title="ProgressEvent.progress" text="progress Defines the value of the type property of a progress event object. This event has the following properties: PropertyValue bubblesfalse bytesLoadedThe number of items or bytes loaded at the time the listener processes the event. bytesTotalThe total number of items or bytes that ultimately will be loaded if the loading process succeeds. cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe network object reporting progress."/>
<page href="flash/events/ProgressEvent.html#event:socketData" title="ProgressEvent.socketData" text="socketData Defines the value of the type property of a socketData event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event. bytesLoadedThe number of items or bytes loaded at the time the listener processes the event. bytesTotal0; this property is not used by socketData event objects. targetThe Socket object reporting progress."/>
<page href="flash/events/EventPhase.html" title="EventPhase class" text="EventPhase The EventPhase class provides values for the eventPhase property of the Event class."/>
<page href="flash/events/EventPhase.html#AT_TARGET" title="EventPhase.AT_TARGET" text="AT_TARGET The target phase, which is the second phase of the event flow."/>
<page href="flash/events/EventPhase.html#BUBBLING_PHASE" title="EventPhase.BUBBLING_PHASE" text="BUBBLING_PHASE The bubbling phase, which is the third phase of the event flow."/>
<page href="flash/events/EventPhase.html#CAPTURING_PHASE" title="EventPhase.CAPTURING_PHASE" text="CAPTURING_PHASE The capturing phase, which is the first phase of the event flow."/>
<page href="flash/events/ActivityEvent.html" title="ActivityEvent class" text="ActivityEvent Flash® Player dispatches an ActivityEvent object whenever a camera or microphone reports that it has become active or inactive. There is only one type of activity event: ActivityEvent.ACTIVITY."/>
<page href="flash/events/ActivityEvent.html#ActivityEvent()" title="ActivityEvent.ActivityEvent()" text="ActivityEvent Creates an event object that contains information about activity events. Event objects are passed as parameters to Event listeners. type bubbles cancelable activating The type of the event. Event listeners can access this information through the inherited type property. There is only one type of activity event: ActivityEvent.ACTIVITY. Determines whether the Event object participates in the bubbling phase of the event flow. Event listeners can access this information through the inherited bubbles property. Determines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. Indicates whether the device is activating (true) or deactivating (false). Event listeners can access this information through the activating property."/>
<page href="flash/events/ActivityEvent.html#clone()" title="ActivityEvent.clone()" text="clone Creates a copy of an ActivityEvent object and sets the value of each property to match that of the original."/>
<page href="flash/events/ActivityEvent.html#toString()" title="ActivityEvent.toString()" text="toString Returns a string that contains all the properties of the ActivityEvent object. The following format is used: [ActivityEvent type=value bubbles=value cancelable=value activating=value]"/>
<page href="flash/events/ActivityEvent.html#activating" title="ActivityEvent.activating" text="activating Indicates whether the device is activating (true) or deactivating (false)."/>
<page href="flash/events/ActivityEvent.html#ACTIVITY" title="ActivityEvent.ACTIVITY" text="ACTIVITY The ActivityEvent.ACTIVITY constant defines the value of the type property of an activity event object. This event has the following properties: PropertyValue activatingtrue if the device is activating or false if it is deactivating. bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe object beginning or ending a session, such as a Camera or Microphone object."/>
<page href="flash/events/ActivityEvent.html#event:activity" title="ActivityEvent.activity" text="activity The ActivityEvent.ACTIVITY constant defines the value of the type property of an activity event object. This event has the following properties: PropertyValue activatingtrue if the device is activating or false if it is deactivating. bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe object beginning or ending a session, such as a Camera or Microphone object."/>
<page href="flash/events/TimerEvent.html" title="TimerEvent class" text="TimerEvent Flash® Player dispatches TimerEvent objects whenever a Timer object reaches the interval specified by the Timer.delay property."/>
<page href="flash/events/TimerEvent.html#TimerEvent()" title="TimerEvent.TimerEvent()" text="TimerEvent Creates an Event object with specific information relevant to timer events. Event objects are passed as parameters to event listeners. type bubbles cancelable The type of the event. Event listeners can access this information through the inherited type property. Determines whether the Event object bubbles. Event listeners can access this information through the inherited bubbles property. Determines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property."/>
<page href="flash/events/TimerEvent.html#clone()" title="TimerEvent.clone()" text="clone Creates a copy of the TimerEvent object and sets each property's value to match that of the original."/>
<page href="flash/events/TimerEvent.html#toString()" title="TimerEvent.toString()" text="toString Returns a string that contains all the properties of the TimerEvent object. The string is in the following format: [TimerEvent type=value bubbles=value cancelable=value]"/>
<page href="flash/events/TimerEvent.html#updateAfterEvent()" title="TimerEvent.updateAfterEvent()" text="updateAfterEvent Instructs Flash Player to render after processing of this event completes, if the display list has been modified. The following is an example for the TimerEvent.updateAfterEvent() method. function onTimer(event:TimerEvent):void { if (40 &lt; my_mc.x &amp;&amp; my_mc.x &lt; 375) { my_mc.x-= 50; } else { my_mc.x=374; } event.updateAfterEvent(); } var moveTimer:Timer=new Timer(50,250); moveTimer.addEventListener(TimerEvent.TIMER,onTimer); moveTimer.start();"/>
<page href="flash/events/TimerEvent.html#TIMER" title="TimerEvent.TIMER" text="TIMER Defines the value of the type property of a timer event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe Timer object that has reached its interval."/>
<page href="flash/events/TimerEvent.html#TIMER_COMPLETE" title="TimerEvent.TIMER_COMPLETE" text="TIMER_COMPLETE Defines the value of the type property of a timerComplete event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe Timer object that has completed its requests."/>
<page href="flash/events/TimerEvent.html#event:timer" title="TimerEvent.timer" text="timer Defines the value of the type property of a timer event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe Timer object that has reached its interval."/>
<page href="flash/events/TimerEvent.html#event:timerComplete" title="TimerEvent.timerComplete" text="timerComplete Defines the value of the type property of a timerComplete event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe Timer object that has completed its requests."/>
<page href="flash/events/IMEEvent.html" title="IMEEvent class" text="IMEEvent Flash® Player dispatches IMEEvent objects when a user enters text using an input method editor (IME). IMEs are generally used to enter text from languages that have ideographs instead of letters, such as Japanese, Chinese, and Korean. There is only one IME event: IMEEvent.IME_COMPOSITION."/>
<page href="flash/events/IMEEvent.html#IMEEvent()" title="IMEEvent.IMEEvent()" text="IMEEvent Creates an Event object with specific information relevant to IME events. Event objects are passed as parameters to event listeners. type bubbles cancelable text The type of the event. Event listeners can access this information through the inherited type property. There is only one IME event: IMEEvent.IME_COMPOSITION. Determines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. Determines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. The reading string from the IME. This is the initial string as typed by the user, before selection of any candidates. The final composition string is delivered to the object with keyboard focus in a TextEvent.TEXT_INPUT event. Event listeners can access this information through the text property."/>
<page href="flash/events/IMEEvent.html#clone()" title="IMEEvent.clone()" text="clone Creates a copy of the IMEEvent object and sets the value of each property to match that of the original."/>
<page href="flash/events/IMEEvent.html#toString()" title="IMEEvent.toString()" text="toString Returns a string that contains all the properties of the IMEEvent object. The string is in the following format: [IMEEvent type=value bubbles=value cancelable=value text=value]"/>
<page href="flash/events/IMEEvent.html#IME_COMPOSITION" title="IMEEvent.IME_COMPOSITION" text="IME_COMPOSITION Defines the value of the type property of an imeComposition event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe IME object."/>
<page href="flash/events/IMEEvent.html#event:imeComposition" title="IMEEvent.imeComposition" text="imeComposition Defines the value of the type property of an imeComposition event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe IME object."/>
<page href="flash/events/ErrorEvent.html" title="ErrorEvent class" text="ErrorEvent Flash® Player dispatches ErrorEvent objects when an error causes a network operation to fail. There is only one type of error event: ErrorEvent.ERROR. The ErrorEvent class also serves as the base class for the IOErrorEvent and SecurityErrorEvent classes. You can check for error events that do not have any listeners by using the debugger version of Flash Player. The debugger version of Flash Player displays these events as strings (defined by the text parameter of the ErrorEvent constructor)."/>
<page href="flash/events/ErrorEvent.html#ErrorEvent()" title="ErrorEvent.ErrorEvent()" text="ErrorEvent Creates an Event object that contains information about error events. Event objects are passed as parameters to event listeners. type bubbles cancelable text The type of the event. Event listeners can access this information through the inherited type property. There is only one type of error event: ErrorEvent.ERROR. Determines whether the Event object bubbles. Event listeners can access this information through the inherited bubbles property. Determines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. Text to be displayed as an error message. Event listeners can access this information through the text property."/>
<page href="flash/events/ErrorEvent.html#clone()" title="ErrorEvent.clone()" text="clone Creates a copy of the ErrorEvent object and sets the value of each property to match that of the original."/>
<page href="flash/events/ErrorEvent.html#toString()" title="ErrorEvent.toString()" text="toString Returns a string that contains all the properties of the ErrorEvent object. The string is in the following format: [ErrorEvent type=value bubbles=value cancelable=value text=value]"/>
<page href="flash/events/ErrorEvent.html#ERROR" title="ErrorEvent.ERROR" text="ERROR Defines the value of the type property of an error event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe object experiencing a network operation failure. textText to be displayed as an error message."/>
<page href="flash/events/ErrorEvent.html#event:error" title="ErrorEvent.error" text="error Defines the value of the type property of an error event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe object experiencing a network operation failure. textText to be displayed as an error message."/>
<page href="flash/events/ContextMenuEvent.html" title="ContextMenuEvent class" text="ContextMenuEvent Flash® Player dispatches ContextMenuEvent objects when a user generates or interacts with the context menu. Users generate the context menu by clicking the secondary button of the user's pointing device (usually a mouse or a trackball). There are two types of ContextMenuEvent objects: ContextMenuEvent.MENU_ITEM_SELECT ContextMenuEvent.MENU_SELECT"/>
<page href="flash/events/ContextMenuEvent.html#ContextMenuEvent()" title="ContextMenuEvent.ContextMenuEvent()" text="ContextMenuEvent Creates an Event object that contains specific information about menu events. Event objects are passed as parameters to event listeners. type bubbles cancelable mouseTarget contextMenuOwner The type of the event. Possible values are: ContextMenuEvent.MENU_ITEM_SELECT ContextMenuEvent.MENU_SELECT Determines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. Determines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. The display list object on which the user right-clicked to display the context menu. This could be the contextMenuOwner or one of its display list descendants. The display list object to which the menu is attached. This could be the mouseTarget or one of its ancestors in the display list."/>
<page href="flash/events/ContextMenuEvent.html#clone()" title="ContextMenuEvent.clone()" text="clone Creates a copy of the ContextMenuEvent object and sets the value of each property to match that of the original."/>
<page href="flash/events/ContextMenuEvent.html#toString()" title="ContextMenuEvent.toString()" text="toString Returns a string that contains all the properties of the ContextMenuEvent object. The string is in the following format: [ContextMenuEvent type=value bubbles=value cancelable=value ... contextMenuOwner=value]"/>
<page href="flash/events/ContextMenuEvent.html#contextMenuOwner" title="ContextMenuEvent.contextMenuOwner" text="contextMenuOwner The display list object to which the menu is attached. This could be the mouse target (mouseTarget) or one of its ancestors in the display list."/>
<page href="flash/events/ContextMenuEvent.html#MENU_ITEM_SELECT" title="ContextMenuEvent.MENU_ITEM_SELECT" text="MENU_ITEM_SELECT Defines the value of the type property of a menuItemSelect event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. contextMenuOwnerThe display list object to which the menu is attached. currentTargetThe object that is actively processing the Event object with an event listener. mouseTargetThe display list object on which the user right-clicked to display the context menu. targetThe ContextMenuItem object that has been selected. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/ContextMenuEvent.html#MENU_SELECT" title="ContextMenuEvent.MENU_SELECT" text="MENU_SELECT Defines the value of the type property of a menuSelect event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. contextMenuOwnerThe display list object to which the menu is attached. currentTargetThe object that is actively processing the Event object with an event listener. mouseTargetThe display list object on which the user right-clicked to display the context menu. targetThe ContextMenu object that is about to be displayed. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/ContextMenuEvent.html#mouseTarget" title="ContextMenuEvent.mouseTarget" text="mouseTarget The display list object on which the user right-clicked to display the context menu. This could be the display list object to which the menu is attached (contextMenuOwner) or one of its display list descendants."/>
<page href="flash/events/ContextMenuEvent.html#event:menuItemSelect" title="ContextMenuEvent.menuItemSelect" text="menuItemSelect Defines the value of the type property of a menuItemSelect event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. contextMenuOwnerThe display list object to which the menu is attached. currentTargetThe object that is actively processing the Event object with an event listener. mouseTargetThe display list object on which the user right-clicked to display the context menu. targetThe ContextMenuItem object that has been selected. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/ContextMenuEvent.html#event:menuSelect" title="ContextMenuEvent.menuSelect" text="menuSelect Defines the value of the type property of a menuSelect event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. contextMenuOwnerThe display list object to which the menu is attached. currentTargetThe object that is actively processing the Event object with an event listener. mouseTargetThe display list object on which the user right-clicked to display the context menu. targetThe ContextMenu object that is about to be displayed. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/SyncEvent.html" title="SyncEvent class" text="SyncEvent Flash® Player dispatches SyncEvent objects when a remote SharedObject instance has been updated by the server. There is only one type of sync event: SyncEvent.SYNC."/>
<page href="flash/events/SyncEvent.html#SyncEvent()" title="SyncEvent.SyncEvent()" text="SyncEvent Creates an Event object that contains information about sync events. Event objects are passed as parameters to event listeners. type bubbles cancelable changeList The type of the event. Event listeners can access this information through the inherited type property. There is only one type of sync event: SyncEvent.SYNC. Determines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. Determines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. An array of objects that describe the synchronization with the remote SharedObject. Event listeners can access this object through the changeList property."/>
<page href="flash/events/SyncEvent.html#clone()" title="SyncEvent.clone()" text="clone Creates a copy of the SyncEvent object and sets the value of each property to match that of the original."/>
<page href="flash/events/SyncEvent.html#toString()" title="SyncEvent.toString()" text="toString Returns a string that contains all the properties of the SyncEvent object. The string is in the following format: [SyncEvent type=value bubbles=value cancelable=value list=value]"/>
<page href="flash/events/SyncEvent.html#changeList" title="SyncEvent.changeList" text="changeList An array of objects; each object contains properties that describe the changed members of a remote shared object. The properties of each object are code, name, and oldValue. When you initially connect to a remote shared object that is persistent locally and/or on the server, all the properties of this object are set to empty strings.Otherwise, Flash sets code to &quot;clear&quot;, &quot;success&quot;, &quot;reject&quot;, &quot;change&quot;, or &quot;delete&quot;. A value of &quot;clear&quot; means either that you have successfully connected to a remote shared object that is not persistent on the server or the client, or that all the properties of the object have been deleted--for example, when the client and server copies of the object are so far out of sync that Flash Player resynchronizes the client object with the server object. In the latter case, SyncEvent.SYNC is dispatched and the &quot;code&quot; value is set to &quot;change&quot;. A value of &quot;success&quot; means the client changed the shared object. A value of &quot;reject&quot; means the client tried unsuccessfully to change the object; instead, another client changed the object. A value of &quot;change&quot; means another client changed the object or the server resynchronized the object. A value of &quot;delete&quot; means the attribute was deleted. The name property contains the name of the property that has been changed. The oldValue property contains the former value of the changed property. This parameter is null unless code has a value of &quot;reject&quot; or &quot;change&quot;."/>
<page href="flash/events/SyncEvent.html#SYNC" title="SyncEvent.SYNC" text="SYNC Defines the value of the type property of a sync event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. changeListAn array with properties that describe the array's status. targetThe SharedObject instance that has been updated by the server."/>
<page href="flash/events/SyncEvent.html#event:sync" title="SyncEvent.sync" text="sync Defines the value of the type property of a sync event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. changeListAn array with properties that describe the array's status. targetThe SharedObject instance that has been updated by the server."/>
<page href="flash/events/HTTPStatusEvent.html" title="HTTPStatusEvent class" text="HTTPStatusEvent Flash® Player dispatches HTTPStatusEvent objects when a network request returns an HTTP status code. There is only one type of HTTPStatus event: HTTPStatusEvent.HTTP_STATUS. HTTPStatusEvent objects are always sent before error or completion events. An HTTPStatusEvent object does not necessarily indicate an error condition; it simply reflects the HTTP status code (if any) that is provided by the networking stack. Some Flash Player environments may be unable to detect HTTP status codes; a status code of 0 is always reported in these cases."/>
<page href="flash/events/HTTPStatusEvent.html#HTTPStatusEvent()" title="HTTPStatusEvent.HTTPStatusEvent()" text="HTTPStatusEvent Creates an Event object that contains specific information about HTTP status events. Event objects are passed as parameters to event listeners. type bubbles cancelable status The type of the event. Event listeners can access this information through the inherited type property. There is only one type of HTTPStatus event: HTTPStatusEvent.HTTP_STATUS. Determines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. Determines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. Numeric status. Event listeners can access this information through the status property."/>
<page href="flash/events/HTTPStatusEvent.html#clone()" title="HTTPStatusEvent.clone()" text="clone Creates a copy of the HTTPStatusEvent object and sets the value of each property to match that of the original."/>
<page href="flash/events/HTTPStatusEvent.html#toString()" title="HTTPStatusEvent.toString()" text="toString Returns a string that contains all the properties of the HTTPStatusEvent object. The string is in the following format: [HTTPStatusEvent type=value bubbles=value cancelable=value status=value]"/>
<page href="flash/events/HTTPStatusEvent.html#HTTP_STATUS" title="HTTPStatusEvent.HTTP_STATUS" text="HTTP_STATUS Defines the value of the type property of a httpStatus event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. statusThe HTTP status code returned by the server. targetThe network object receiving an HTTP status code."/>
<page href="flash/events/HTTPStatusEvent.html#status" title="HTTPStatusEvent.status" text="status The HTTP status code returned by the server. For example, a value of 404 indicates that the server has not found a match for the requested URI. HTTP status codes can be found in sections 10.4 and 10.5 of the HTTP specification at ftp://ftp.isi.edu/in-notes/rfc2616.txt. If Flash Player cannot get a status code from the server, or if it cannot communicate with the server, the default value of 0 is passed to your ActionScript code. A value of 0 can be generated in any player (for example, if a malformed URL is requested), and a value of 0 is always generated by the Flash Player plug-in when it is run in the following browsers, which do not pass HTTP status codes to the player: Netscape, Mozilla, Safari, Opera, and Internet Explorer for the Macintosh."/>
<page href="flash/events/HTTPStatusEvent.html#event:httpStatus" title="HTTPStatusEvent.httpStatus" text="httpStatus Defines the value of the type property of a httpStatus event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. statusThe HTTP status code returned by the server. targetThe network object receiving an HTTP status code."/>
<page href="flash/events/IOErrorEvent.html" title="IOErrorEvent class" text="IOErrorEvent Flash® Player dispatches an IOErrorEvent object when an error causes a send or load operation to fail. You can check for error events that do not have any listeners by using the debugger version of Flash Player. Flash Player displays the string defined by the text parameter of the IOErrorEvent constructor. There is only one type of input/output error event: IOErrorEvent.IO_ERROR."/>
<page href="flash/events/IOErrorEvent.html#IOErrorEvent()" title="IOErrorEvent.IOErrorEvent()" text="IOErrorEvent Creates an Event object that contains specific information about ioError events. Event objects are passed as parameters to Event listeners. type bubbles cancelable text The type of the event. Event listeners can access this information through the inherited type property. There is only one type of input/output error event: IOErrorEvent.IO_ERROR. Determines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. Determines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. Text to be displayed as an error message. Event listeners can access this information through the text property."/>
<page href="flash/events/IOErrorEvent.html#clone()" title="IOErrorEvent.clone()" text="clone Creates a copy of the IOErrorEvent object and sets the value of each property to match that of the original."/>
<page href="flash/events/IOErrorEvent.html#toString()" title="IOErrorEvent.toString()" text="toString Returns a string that contains all the properties of the IOErrorEvent object. The string is in the following format: [IOErrorEvent type=value bubbles=value cancelable=value text=value]"/>
<page href="flash/events/IOErrorEvent.html#IO_ERROR" title="IOErrorEvent.IO_ERROR" text="IO_ERROR Defines the value of the type property of an ioError event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe network object experiencing the input/output error. textText to be displayed as an error message."/>
<page href="flash/events/IOErrorEvent.html#event:ioError" title="IOErrorEvent.ioError" text="ioError Defines the value of the type property of an ioError event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe network object experiencing the input/output error. textText to be displayed as an error message."/>
<page href="flash/events/DataEvent.html" title="DataEvent class" text="DataEvent Flash® Player dispatches DataEvent objects when raw data has completed loading into Flash Player. There are two types of data event: DataEvent.DATA: dispatched for data sent or received. DataEvent.UPLOAD_COMPLETE_DATA: dispatched when data is sent and the server has responded."/>
<page href="flash/events/DataEvent.html#DataEvent()" title="DataEvent.DataEvent()" text="DataEvent Creates an event object that contains information about data events. Event objects are passed as parameters to event listeners. type bubbles cancelable data The type of the event. Event listeners can access this information through the inherited type property. There is only one type of data event: DataEvent.DATA. Determines whether the Event object participates in the bubbling phase of the event flow. Event listeners can access this information through the inherited bubbles property. Determines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. The raw data loaded into Flash Player. Event listeners can access this information through the data property."/>
<page href="flash/events/DataEvent.html#clone()" title="DataEvent.clone()" text="clone Creates a copy of the DataEvent object and sets the value of each property to match that of the original."/>
<page href="flash/events/DataEvent.html#toString()" title="DataEvent.toString()" text="toString Returns a string that contains all the properties of the DataEvent object. The string is in the following format: [DataEvent type=value bubbles=value cancelable=value data=value]"/>
<page href="flash/events/DataEvent.html#data" title="DataEvent.data" text="data The raw data loaded into Flash Player."/>
<page href="flash/events/DataEvent.html#DATA" title="DataEvent.DATA" text="DATA Defines the value of the type property of a data event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. dataThe raw data loaded into Flash Player. targetThe XMLSocket object receiving data."/>
<page href="flash/events/DataEvent.html#UPLOAD_COMPLETE_DATA" title="DataEvent.UPLOAD_COMPLETE_DATA" text="UPLOAD_COMPLETE_DATA Defines the value of the type property of an uploadCompleteData event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. dataThe raw data returned from the server after a successful file upload. targetThe FileReference object receiving data after a successful upload."/>
<page href="flash/events/DataEvent.html#event:data" title="DataEvent.data" text="data Defines the value of the type property of a data event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. dataThe raw data loaded into Flash Player. targetThe XMLSocket object receiving data."/>
<page href="flash/events/DataEvent.html#event:uploadCompleteData" title="DataEvent.uploadCompleteData" text="uploadCompleteData Defines the value of the type property of an uploadCompleteData event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. dataThe raw data returned from the server after a successful file upload. targetThe FileReference object receiving data after a successful upload."/>
<page href="flash/events/MouseEvent.html" title="MouseEvent class" text="MouseEvent Flash® Player dispatches MouseEvent objects into the event flow whenever mouse events occur. A mouse event is usually generated by a user input device, such as a mouse or a trackball, that uses a pointer. When nested nodes are involved, mouse events target the deepest possible nested node that is visible in the display list. This node is called the target node. To have a target node's ancestor receive notification of a mouse event, use EventDispatcher.addEventListener() on the ancestor node with the type parameter set to the specific mouse event you want to detect."/>
<page href="flash/events/MouseEvent.html#MouseEvent()" title="MouseEvent.MouseEvent()" text="MouseEvent Creates an Event object that contains information about mouse events. Event objects are passed as parameters to event listeners. type bubbles cancelable localX localY relatedObject ctrlKey altKey shiftKey buttonDown delta The type of the event. Possible values are: MouseEvent.CLICK, MouseEvent.DOUBLE_CLICK, MouseEvent.MOUSE_DOWN, MouseEvent.MOUSE_MOVE, MouseEvent.MOUSE_OUT, MouseEvent.MOUSE_OVER, MouseEvent.MOUSE_UP, MouseEvent.MOUSE_WHEEL, MouseEvent.ROLL_OUT, and MouseEvent.ROLL_OVER. Determines whether the Event object participates in the bubbling phase of the event flow. Determines whether the Event object can be canceled. The horizontal coordinate at which the event occurred relative to the containing sprite. The vertical coordinate at which the event occurred relative to the containing sprite. The complementary InteractiveObject instance that is affected by the event. For example, when a mouseOut event occurs, relatedObject represents the display list object to which the pointing device now points. Indicates whether the Control key is activated. Indicates whether the Alt key is activated (Windows only). Indicates whether the Shift key is activated. Indicates whether the primary mouse button is pressed. Indicates how many lines should be scrolled for each unit the user rotates the mouse wheel. A positive delta value indicates an upward scroll; a negative value indicates a downward scroll. Typical values are 1 to 3, but faster rotation may produce larger values. This parameter is used only for the MouseEvent.mouseWheel event."/>
<page href="flash/events/MouseEvent.html#clone()" title="MouseEvent.clone()" text="clone Creates a copy of the MouseEvent object and sets the value of each property to match that of the original."/>
<page href="flash/events/MouseEvent.html#toString()" title="MouseEvent.toString()" text="toString Returns a string that contains all the properties of the MouseEvent object. The string is in the following format: [MouseEvent type=value bubbles=value cancelable=value ... delta=value]"/>
<page href="flash/events/MouseEvent.html#updateAfterEvent()" title="MouseEvent.updateAfterEvent()" text="updateAfterEvent Instructs Flash Player to render after processing of this event completes, if the display list has been modified."/>
<page href="flash/events/MouseEvent.html#altKey" title="MouseEvent.altKey" text="altKey Indicates whether the Alt key is active (true) or inactive (false). Supported for Windows operating systems only."/>
<page href="flash/events/MouseEvent.html#buttonDown" title="MouseEvent.buttonDown" text="buttonDown Indicates whether the primary mouse button is pressed (true) or not (false)."/>
<page href="flash/events/MouseEvent.html#CLICK" title="MouseEvent.CLICK" text="CLICK Defines the value of the type property of a click event object. This event has the following properties: PropertyValue bubblestrue buttonDowntrue if the primary mouse button is pressed; false otherwise. cancelablefalse; there is no default behavior to cancel. ctrlKeytrue if the Control key is active; false if it is inactive. currentTargetThe object that is actively processing the Event object with an event listener. localXThe horizontal coordinate at which the event occurred relative to the containing sprite. localYThe vertical coordinate at which the event occurred relative to the containing sprite. shiftKeytrue if the Shift key is active; false if it is inactive. stageXThe horizontal coordinate at which the event occurred in global stage coordinates. stageYThe vertical coordinate at which the event occurred in global stage coordinates. targetThe InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/MouseEvent.html#ctrlKey" title="MouseEvent.ctrlKey" text="ctrlKey Indicates whether the Control key is active (true) or inactive (false). On Macintosh computers, you must use this property to represent the Command key."/>
<page href="flash/events/MouseEvent.html#delta" title="MouseEvent.delta" text="delta Indicates how many lines should be scrolled for each unit the user rotates the mouse wheel. A positive delta value indicates an upward scroll; a negative value indicates a downward scroll. Typical values are 1 to 3, but faster rotation may produce larger values. This setting depends on the device and operating system and is usually configurable by the user. This property applies only to the MouseEvent.mouseWheel event."/>
<page href="flash/events/MouseEvent.html#DOUBLE_CLICK" title="MouseEvent.DOUBLE_CLICK" text="DOUBLE_CLICK Defines the value of the type property of a doubleClick event object. This event has the following properties: PropertyValue bubblestrue buttonDowntrue if the primary mouse button is pressed; false otherwise. cancelablefalse; there is no default behavior to cancel. ctrlKeytrue if the Control key is active; false if it is inactive. currentTargetThe object that is actively processing the Event object with an event listener. localXThe horizontal coordinate at which the event occurred relative to the containing sprite. localYThe vertical coordinate at which the event occurred relative to the containing sprite. shiftKeytrue if the Shift key is active; false if it is inactive. stageXThe horizontal coordinate at which the event occurred in global stage coordinates. stageYThe vertical coordinate at which the event occurred in global stage coordinates. targetThe InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/MouseEvent.html#localX" title="MouseEvent.localX" text="localX The horizontal coordinate at which the event occurred relative to the containing sprite. Please see the MOUSE_MOVE constant's example for an illustration of how to use this property."/>
<page href="flash/events/MouseEvent.html#localY" title="MouseEvent.localY" text="localY The vertical coordinate at which the event occurred relative to the containing sprite. Please see the MOUSE_MOVE constant's example for an illustration of how to use this property."/>
<page href="flash/events/MouseEvent.html#MOUSE_DOWN" title="MouseEvent.MOUSE_DOWN" text="MOUSE_DOWN Defines the value of the type property of a mouseDown event object. This event has the following properties: PropertyValue bubblestrue buttonDowntrue if the primary mouse button is pressed; false otherwise. cancelablefalse; the default behavior cannot be canceled. ctrlKeytrue if the Control key is active; false if it is inactive. currentTargetThe object that is actively processing the Event object with an event listener. localXThe horizontal coordinate at which the event occurred relative to the containing sprite. localYThe vertical coordinate at which the event occurred relative to the containing sprite. shiftKeytrue if the Shift key is active; false if it is inactive. stageXThe horizontal coordinate at which the event occurred in global stage coordinates. stageYThe vertical coordinate at which the event occurred in global stage coordinates. targetThe InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/MouseEvent.html#MOUSE_MOVE" title="MouseEvent.MOUSE_MOVE" text="MOUSE_MOVE Defines the value of the type property of a mouseMove event object. This event has the following properties: PropertyValue bubblestrue buttonDowntrue if the primary mouse button is pressed; false otherwise. cancelablefalse; the default behavior cannot be canceled. ctrlKeytrue if the Control key is active; false if it is inactive. currentTargetThe object that is actively processing the Event object with an event listener. localXThe horizontal coordinate at which the event occurred relative to the containing sprite. localYThe vertical coordinate at which the event occurred relative to the containing sprite. shiftKeytrue if the Shift key is active; false if it is inactive. stageXThe horizontal coordinate at which the event occurred in global stage coordinates. stageYThe vertical coordinate at which the event occurred in global stage coordinates. targetThe InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/MouseEvent.html#MOUSE_OUT" title="MouseEvent.MOUSE_OUT" text="MOUSE_OUT Defines the value of the type property of a mouseOut event object. This event has the following properties: PropertyValue bubblestrue buttonDowntrue if the primary mouse button is pressed; false otherwise. cancelablefalse; the default behavior cannot be canceled. ctrlKeytrue if the Control key is active; false if it is inactive. currentTargetThe object that is actively processing the Event object with an event listener. relatedObjectThe display list object to which the pointing device now points. localXThe horizontal coordinate at which the event occurred relative to the containing sprite. localYThe vertical coordinate at which the event occurred relative to the containing sprite. shiftKeytrue if the Shift key is active; false if it is inactive. stageXThe horizontal coordinate at which the event occurred in global stage coordinates. stageYThe vertical coordinate at which the event occurred in global stage coordinates. targetThe InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/MouseEvent.html#MOUSE_OVER" title="MouseEvent.MOUSE_OVER" text="MOUSE_OVER Defines the value of the type property of a mouseOver event object. This event has the following properties: PropertyValue bubblestrue buttonDowntrue if the primary mouse button is pressed; false otherwise. cancelablefalse; the default behavior cannot be canceled. ctrlKeytrue if the Control key is active; false if it is inactive. currentTargetThe object that is actively processing the Event object with an event listener. relatedObjectThe display list object to which the pointing device was pointing. localXThe horizontal coordinate at which the event occurred relative to the containing sprite. localYThe vertical coordinate at which the event occurred relative to the containing sprite. shiftKeytrue if the Shift key is active; false if it is inactive. stageXThe horizontal coordinate at which the event occurred in global stage coordinates. stageYThe vertical coordinate at which the event occurred in global stage coordinates. targetThe InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/MouseEvent.html#MOUSE_UP" title="MouseEvent.MOUSE_UP" text="MOUSE_UP Defines the value of the type property of a mouseUp event object. This event has the following properties: PropertyValue bubblestrue buttonDowntrue if the primary mouse button is pressed; false otherwise. cancelablefalse; the default behavior cannot be canceled. ctrlKeytrue if the Control key is active; false if it is inactive. currentTargetThe object that is actively processing the Event object with an event listener. localXThe horizontal coordinate at which the event occurred relative to the containing sprite. localYThe vertical coordinate at which the event occurred relative to the containing sprite. shiftKeytrue if the Shift key is active; false if it is inactive. stageXThe horizontal coordinate at which the event occurred in global stage coordinates. stageYThe vertical coordinate at which the event occurred in global stage coordinates. targetThe InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event. Please see the MOUSE_MOVE constant's example for an illustration of how to use this constant."/>
<page href="flash/events/MouseEvent.html#MOUSE_WHEEL" title="MouseEvent.MOUSE_WHEEL" text="MOUSE_WHEEL Defines the value of the type property of a mouseWheel event object. This event has the following properties: PropertyValue bubblestrue buttonDowntrue if the primary mouse button is pressed; false otherwise. cancelablefalse; the default behavior cannot be canceled. ctrlKeytrue if the Control key is active; false if it is inactive. currentTargetThe object that is actively processing the Event object with an event listener. deltaThe number of lines that that each notch on the mouse wheel represents. localXThe horizontal coordinate at which the event occurred relative to the containing sprite. localYThe vertical coordinate at which the event occurred relative to the containing sprite. shiftKeytrue if the Shift key is active; false if it is inactive. stageXThe horizontal coordinate at which the event occurred in global stage coordinates. stageYThe vertical coordinate at which the event occurred in global stage coordinates. targetThe InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/MouseEvent.html#relatedObject" title="MouseEvent.relatedObject" text="relatedObject A reference to a display list object that is related to the event. For example, when a mouseOut event occurs, relatedObject represents the display list object to which the pointing device now points. This property applies only to the mouseOut and mouseOver events."/>
<page href="flash/events/MouseEvent.html#ROLL_OUT" title="MouseEvent.ROLL_OUT" text="ROLL_OUT Defines the value of the type property of a rollOut event object. This event has the following properties: PropertyValue bubblesfalse buttonDowntrue if the primary mouse button is pressed; false otherwise. cancelablefalse; there is no default behavior to cancel. ctrlKeytrue if the Control key is active; false if it is inactive. currentTargetThe object that is actively processing the Event object with an event listener. relatedObjectThe display list object to which the pointing device now points. localXThe horizontal coordinate at which the event occurred relative to the containing sprite. localYThe vertical coordinate at which the event occurred relative to the containing sprite. shiftKeytrue if the Shift key is active; false if it is inactive. stageXThe horizontal coordinate at which the event occurred in global stage coordinates. stageYThe vertical coordinate at which the event occurred in global stage coordinates. targetThe InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/MouseEvent.html#ROLL_OVER" title="MouseEvent.ROLL_OVER" text="ROLL_OVER Defines the value of the type property of a rollOver event object. This event has the following properties: PropertyValue bubblesfalse buttonDowntrue if the primary mouse button is pressed; false otherwise. cancelablefalse; there is no default behavior to cancel. ctrlKeytrue if the Control key is active; false if it is inactive. currentTargetThe object that is actively processing the Event object with an event listener. relatedObjectThe display list object to which the pointing device was pointing. localXThe horizontal coordinate at which the event occurred relative to the containing sprite. localYThe vertical coordinate at which the event occurred relative to the containing sprite. shiftKeytrue if the Shift key is active; false if it is inactive. stageXThe horizontal coordinate at which the event occurred in global stage coordinates. stageYThe vertical coordinate at which the event occurred in global stage coordinates. targetThe InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/MouseEvent.html#shiftKey" title="MouseEvent.shiftKey" text="shiftKey Indicates whether the Shift key is active (true) or inactive (false)."/>
<page href="flash/events/MouseEvent.html#stageX" title="MouseEvent.stageX" text="stageX The horizontal coordinate at which the event occurred in global Stage coordinates. This property is calculated when the localX property is set. Please see the MOUSE_MOVE constant's example for an illustration of how to use this property."/>
<page href="flash/events/MouseEvent.html#stageY" title="MouseEvent.stageY" text="stageY The vertical coordinate at which the event occurred in global Stage coordinates. This property is calculated when the localY property is set. Please see the MOUSE_MOVE constant's example for an illustration of how to use this property."/>
<page href="flash/events/MouseEvent.html#event:click" title="MouseEvent.click" text="click Defines the value of the type property of a click event object. This event has the following properties: PropertyValue bubblestrue buttonDowntrue if the primary mouse button is pressed; false otherwise. cancelablefalse; there is no default behavior to cancel. ctrlKeytrue if the Control key is active; false if it is inactive. currentTargetThe object that is actively processing the Event object with an event listener. localXThe horizontal coordinate at which the event occurred relative to the containing sprite. localYThe vertical coordinate at which the event occurred relative to the containing sprite. shiftKeytrue if the Shift key is active; false if it is inactive. stageXThe horizontal coordinate at which the event occurred in global stage coordinates. stageYThe vertical coordinate at which the event occurred in global stage coordinates. targetThe InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/MouseEvent.html#event:doubleClick" title="MouseEvent.doubleClick" text="doubleClick Defines the value of the type property of a doubleClick event object. This event has the following properties: PropertyValue bubblestrue buttonDowntrue if the primary mouse button is pressed; false otherwise. cancelablefalse; there is no default behavior to cancel. ctrlKeytrue if the Control key is active; false if it is inactive. currentTargetThe object that is actively processing the Event object with an event listener. localXThe horizontal coordinate at which the event occurred relative to the containing sprite. localYThe vertical coordinate at which the event occurred relative to the containing sprite. shiftKeytrue if the Shift key is active; false if it is inactive. stageXThe horizontal coordinate at which the event occurred in global stage coordinates. stageYThe vertical coordinate at which the event occurred in global stage coordinates. targetThe InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/MouseEvent.html#event:mouseDown" title="MouseEvent.mouseDown" text="mouseDown Defines the value of the type property of a mouseDown event object. This event has the following properties: PropertyValue bubblestrue buttonDowntrue if the primary mouse button is pressed; false otherwise. cancelablefalse; the default behavior cannot be canceled. ctrlKeytrue if the Control key is active; false if it is inactive. currentTargetThe object that is actively processing the Event object with an event listener. localXThe horizontal coordinate at which the event occurred relative to the containing sprite. localYThe vertical coordinate at which the event occurred relative to the containing sprite. shiftKeytrue if the Shift key is active; false if it is inactive. stageXThe horizontal coordinate at which the event occurred in global stage coordinates. stageYThe vertical coordinate at which the event occurred in global stage coordinates. targetThe InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/MouseEvent.html#event:mouseMove" title="MouseEvent.mouseMove" text="mouseMove Defines the value of the type property of a mouseMove event object. This event has the following properties: PropertyValue bubblestrue buttonDowntrue if the primary mouse button is pressed; false otherwise. cancelablefalse; the default behavior cannot be canceled. ctrlKeytrue if the Control key is active; false if it is inactive. currentTargetThe object that is actively processing the Event object with an event listener. localXThe horizontal coordinate at which the event occurred relative to the containing sprite. localYThe vertical coordinate at which the event occurred relative to the containing sprite. shiftKeytrue if the Shift key is active; false if it is inactive. stageXThe horizontal coordinate at which the event occurred in global stage coordinates. stageYThe vertical coordinate at which the event occurred in global stage coordinates. targetThe InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/MouseEvent.html#event:mouseOut" title="MouseEvent.mouseOut" text="mouseOut Defines the value of the type property of a mouseOut event object. This event has the following properties: PropertyValue bubblestrue buttonDowntrue if the primary mouse button is pressed; false otherwise. cancelablefalse; the default behavior cannot be canceled. ctrlKeytrue if the Control key is active; false if it is inactive. currentTargetThe object that is actively processing the Event object with an event listener. relatedObjectThe display list object to which the pointing device now points. localXThe horizontal coordinate at which the event occurred relative to the containing sprite. localYThe vertical coordinate at which the event occurred relative to the containing sprite. shiftKeytrue if the Shift key is active; false if it is inactive. stageXThe horizontal coordinate at which the event occurred in global stage coordinates. stageYThe vertical coordinate at which the event occurred in global stage coordinates. targetThe InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/MouseEvent.html#event:mouseOver" title="MouseEvent.mouseOver" text="mouseOver Defines the value of the type property of a mouseOver event object. This event has the following properties: PropertyValue bubblestrue buttonDowntrue if the primary mouse button is pressed; false otherwise. cancelablefalse; the default behavior cannot be canceled. ctrlKeytrue if the Control key is active; false if it is inactive. currentTargetThe object that is actively processing the Event object with an event listener. relatedObjectThe display list object to which the pointing device was pointing. localXThe horizontal coordinate at which the event occurred relative to the containing sprite. localYThe vertical coordinate at which the event occurred relative to the containing sprite. shiftKeytrue if the Shift key is active; false if it is inactive. stageXThe horizontal coordinate at which the event occurred in global stage coordinates. stageYThe vertical coordinate at which the event occurred in global stage coordinates. targetThe InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/MouseEvent.html#event:mouseUp" title="MouseEvent.mouseUp" text="mouseUp Defines the value of the type property of a mouseUp event object. This event has the following properties: PropertyValue bubblestrue buttonDowntrue if the primary mouse button is pressed; false otherwise. cancelablefalse; the default behavior cannot be canceled. ctrlKeytrue if the Control key is active; false if it is inactive. currentTargetThe object that is actively processing the Event object with an event listener. localXThe horizontal coordinate at which the event occurred relative to the containing sprite. localYThe vertical coordinate at which the event occurred relative to the containing sprite. shiftKeytrue if the Shift key is active; false if it is inactive. stageXThe horizontal coordinate at which the event occurred in global stage coordinates. stageYThe vertical coordinate at which the event occurred in global stage coordinates. targetThe InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/MouseEvent.html#event:mouseWheel" title="MouseEvent.mouseWheel" text="mouseWheel Defines the value of the type property of a mouseWheel event object. This event has the following properties: PropertyValue bubblestrue buttonDowntrue if the primary mouse button is pressed; false otherwise. cancelablefalse; the default behavior cannot be canceled. ctrlKeytrue if the Control key is active; false if it is inactive. currentTargetThe object that is actively processing the Event object with an event listener. deltaThe number of lines that that each notch on the mouse wheel represents. localXThe horizontal coordinate at which the event occurred relative to the containing sprite. localYThe vertical coordinate at which the event occurred relative to the containing sprite. shiftKeytrue if the Shift key is active; false if it is inactive. stageXThe horizontal coordinate at which the event occurred in global stage coordinates. stageYThe vertical coordinate at which the event occurred in global stage coordinates. targetThe InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/MouseEvent.html#event:rollOut" title="MouseEvent.rollOut" text="rollOut Defines the value of the type property of a rollOut event object. This event has the following properties: PropertyValue bubblesfalse buttonDowntrue if the primary mouse button is pressed; false otherwise. cancelablefalse; there is no default behavior to cancel. ctrlKeytrue if the Control key is active; false if it is inactive. currentTargetThe object that is actively processing the Event object with an event listener. relatedObjectThe display list object to which the pointing device now points. localXThe horizontal coordinate at which the event occurred relative to the containing sprite. localYThe vertical coordinate at which the event occurred relative to the containing sprite. shiftKeytrue if the Shift key is active; false if it is inactive. stageXThe horizontal coordinate at which the event occurred in global stage coordinates. stageYThe vertical coordinate at which the event occurred in global stage coordinates. targetThe InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/MouseEvent.html#event:rollOver" title="MouseEvent.rollOver" text="rollOver Defines the value of the type property of a rollOver event object. This event has the following properties: PropertyValue bubblesfalse buttonDowntrue if the primary mouse button is pressed; false otherwise. cancelablefalse; there is no default behavior to cancel. ctrlKeytrue if the Control key is active; false if it is inactive. currentTargetThe object that is actively processing the Event object with an event listener. relatedObjectThe display list object to which the pointing device was pointing. localXThe horizontal coordinate at which the event occurred relative to the containing sprite. localYThe vertical coordinate at which the event occurred relative to the containing sprite. shiftKeytrue if the Shift key is active; false if it is inactive. stageXThe horizontal coordinate at which the event occurred in global stage coordinates. stageYThe vertical coordinate at which the event occurred in global stage coordinates. targetThe InteractiveObject instance under the pointing device. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/KeyboardEvent.html" title="KeyboardEvent class" text="KeyboardEvent Flash® Player dispatches KeyboardEvent objects in response to user input through a keyboard. There are two types of keyboard events: KeyboardEvent.KEY_DOWN and KeyboardEvent.KEY_UP Because mappings between keys and specific characters vary by device and operating system, use the TextEvent event type for processing character input. To listen globally for key events, listen on the Stage for the capture and target or bubble phase."/>
<page href="flash/events/KeyboardEvent.html#KeyboardEvent()" title="KeyboardEvent.KeyboardEvent()" text="KeyboardEvent Creates an Event object that contains specific information about keyboard events. Event objects are passed as parameters to event listeners. type bubbles cancelable charCode keyCode keyLocation ctrlKey altKey shiftKey The type of the event. Possible values are: KeyboardEvent.KEY_DOWN and KeyboardEvent.KEY_UP Determines whether the Event object participates in the bubbling stage of the event flow. Determines whether the Event object can be canceled. The character code value of the key pressed or released. The character code values returned are English keyboard values. For example, if you press Shift+3, the getASCIICode() method returns # on a Japanese keyboard, just as it does on an English keyboard. The key code value of the key pressed or released. The location of the key on the keyboard. Indicates whether the Control key modifier is activated. Indicates whether the Alt key modifier is activated (Windows only). Indicates whether the Shift key modifier is activated."/>
<page href="flash/events/KeyboardEvent.html#clone()" title="KeyboardEvent.clone()" text="clone Creates a copy of the KeyboardEvent object and sets the value of each property to match that of the original."/>
<page href="flash/events/KeyboardEvent.html#toString()" title="KeyboardEvent.toString()" text="toString Returns a string that contains all the properties of the KeyboardEvent object. The string is in the following format: [KeyboardEvent type=value bubbles=value cancelable=value ... shiftKey=value]"/>
<page href="flash/events/KeyboardEvent.html#updateAfterEvent()" title="KeyboardEvent.updateAfterEvent()" text="updateAfterEvent Instructs Flash Player to render after processing of this event completes, if the display list has been modified"/>
<page href="flash/events/KeyboardEvent.html#altKey" title="KeyboardEvent.altKey" text="altKey Indicates whether the Alt key is active (true) or inactive (false). Supported for Windows operating systems only."/>
<page href="flash/events/KeyboardEvent.html#charCode" title="KeyboardEvent.charCode" text="charCode Contains the character code value of the key pressed or released. The character code values are English keyboard values. For example, if you press Shift+3, charCode is # on a Japanese keyboard, just as it is on an English keyboard. Note: When an input method editor (IME) is running, charCode does not report accurate character codes."/>
<page href="flash/events/KeyboardEvent.html#ctrlKey" title="KeyboardEvent.ctrlKey" text="ctrlKey Indicates whether the Control key is active (true) or inactive (false). Note: The Command key modifier on Macintosh systems must be represented using this key modifier."/>
<page href="flash/events/KeyboardEvent.html#KEY_DOWN" title="KeyboardEvent.KEY_DOWN" text="KEY_DOWN Defines the value of the type property of a keyDown event object. This event has the following properties: PropertyValue bubblestrue cancelablefalse; there is no default behavior to cancel. charCodeThe character code value of the key pressed or released. ctrlKeytrue if the Control key is active; false if it is inactive. currentTargetThe object that is actively processing the Event object with an event listener. keyCodeThe key code value of the key pressed or released. keyLocationThe location of the key on the keyboard. shiftKeytrue if the Shift key is active; false if it is inactive. targetThe InteractiveObject instance with focus. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/KeyboardEvent.html#KEY_UP" title="KeyboardEvent.KEY_UP" text="KEY_UP Defines the value of the type property of a keyUp event object. This event has the following properties: PropertyValue bubblestrue cancelablefalse; there is no default behavior to cancel. charCodeContains the character code value of the key pressed or released. ctrlKeytrue if the Control key is active; false if it is inactive. currentTargetThe object that is actively processing the Event object with an event listener. keyCodeThe key code value of the key pressed or released. keyLocationThe location of the key on the keyboard. shiftKeytrue if the Shift key is active; false if it is inactive. targetThe InteractiveObject instance with focus. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/KeyboardEvent.html#keyCode" title="KeyboardEvent.keyCode" text="keyCode The key code value of the key pressed or released. Note: When an input method editor (IME) is running, keyCode does not report accurate key codes."/>
<page href="flash/events/KeyboardEvent.html#keyLocation" title="KeyboardEvent.keyLocation" text="keyLocation Indicates the location of the key on the keyboard. This is useful for differentiating keys that appear more than once on a keyboard. For example, you can differentiate between the left and right Shift keys by the value of this property: KeyLocation.LEFT for the left and KeyLocation.RIGHT for the right. Another example is differentiating between number keys pressed on the standard keyboard (KeyLocation.STANDARD) versus the numeric keypad (KeyLocation.NUM_PAD)."/>
<page href="flash/events/KeyboardEvent.html#shiftKey" title="KeyboardEvent.shiftKey" text="shiftKey Indicates whether the Shift key modifier is active (true) or inactive (false)."/>
<page href="flash/events/KeyboardEvent.html#event:keyDown" title="KeyboardEvent.keyDown" text="keyDown Defines the value of the type property of a keyDown event object. This event has the following properties: PropertyValue bubblestrue cancelablefalse; there is no default behavior to cancel. charCodeThe character code value of the key pressed or released. ctrlKeytrue if the Control key is active; false if it is inactive. currentTargetThe object that is actively processing the Event object with an event listener. keyCodeThe key code value of the key pressed or released. keyLocationThe location of the key on the keyboard. shiftKeytrue if the Shift key is active; false if it is inactive. targetThe InteractiveObject instance with focus. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/KeyboardEvent.html#event:keyUp" title="KeyboardEvent.keyUp" text="keyUp Defines the value of the type property of a keyUp event object. This event has the following properties: PropertyValue bubblestrue cancelablefalse; there is no default behavior to cancel. charCodeContains the character code value of the key pressed or released. ctrlKeytrue if the Control key is active; false if it is inactive. currentTargetThe object that is actively processing the Event object with an event listener. keyCodeThe key code value of the key pressed or released. keyLocationThe location of the key on the keyboard. shiftKeytrue if the Shift key is active; false if it is inactive. targetThe InteractiveObject instance with focus. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event."/>
<page href="flash/events/SecurityErrorEvent.html" title="SecurityErrorEvent class" text="SecurityErrorEvent Flash® Player dispatches SecurityErrorEvent objects to report the occurrence of a security error. Security errors reported through this class are generally from asynchronous operations, such as loading data, in which security violations may not manifest immediately. Your event listener can access the object's text property to determine what operation was attempted and any URLs that were involved. If there are no event listeners, the debugger version of Flash Player automatically displays an error message that contains the contents of the text property. There is one type of security error event: SecurityErrorEvent.SECURITY_ERROR. Security error events are the final events dispatched for any target object. This means that any other events, including generic error events, are not dispatched for a target object that experiences a security error."/>
<page href="flash/events/SecurityErrorEvent.html#SecurityErrorEvent()" title="SecurityErrorEvent.SecurityErrorEvent()" text="SecurityErrorEvent Creates an Event object that contains information about security error events. Event objects are passed as parameters to event listeners. type bubbles cancelable text The type of the event. Event listeners can access this information through the inherited type property. There is only one type of error event: SecurityErrorEvent.SECURITY_ERROR. Determines whether the Event object participates in the bubbling stage of the event flow. Event listeners can access this information through the inherited bubbles property. Determines whether the Event object can be canceled. Event listeners can access this information through the inherited cancelable property. Text to be displayed as an error message. Event listeners can access this information through the text property."/>
<page href="flash/events/SecurityErrorEvent.html#clone()" title="SecurityErrorEvent.clone()" text="clone Creates a copy of the SecurityErrorEvent object and sets the value of each property to match that of the original."/>
<page href="flash/events/SecurityErrorEvent.html#toString()" title="SecurityErrorEvent.toString()" text="toString Returns a string that contains all the properties of the SecurityErrorEvent object. The string is in the following format: [securityErrorEvent type=value bubbles=value cancelable=value text=value]"/>
<page href="flash/events/SecurityErrorEvent.html#SECURITY_ERROR" title="SecurityErrorEvent.SECURITY_ERROR" text="SECURITY_ERROR The SecurityErrorEvent.SECURITY_ERROR constant defines the value of the type property of a securityError event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe network object reporting the security error. textText to be displayed as an error message."/>
<page href="flash/events/SecurityErrorEvent.html#event:securityError" title="SecurityErrorEvent.securityError" text="securityError The SecurityErrorEvent.SECURITY_ERROR constant defines the value of the type property of a securityError event object. This event has the following properties: PropertyValue bubblesfalse cancelablefalse; there is no default behavior to cancel. currentTargetThe object that is actively processing the Event object with an event listener. targetThe network object reporting the security error. textText to be displayed as an error message."/>
<page href="flash/errors/StackOverflowError.html" title="StackOverflowError class" text="StackOverflowError ActionScript throws a StackOverflowError exception when the stack available to the script is exhausted. ActionScript uses a stack to store information about each method call made in a script, such as the local variables that the method uses. The amount of stack space available varies from system to system. A StackOverflowError exception might indicate that infinite recursion has occurred, in which case a termination case needs to be added to the function. It also might indicate that the recursive algorithm has a proper terminating condition but has exhausted the stack anyway. In this case, try to express the algorithm iteratively instead."/>
<page href="flash/errors/StackOverflowError.html#StackOverflowError()" title="StackOverflowError.StackOverflowError()" text="StackOverflowError Creates a new StackOverflowError object. message A string associated with the error object."/>
<page href="flash/errors/MemoryError.html" title="MemoryError class" text="MemoryError The MemoryError exception is thrown when a memory allocation request fails. On a desktop machine, memory allocation failures are rare unless an allocation request is extremely large. For example, a 32-bit Windows program can access only 2GB of address space, so a request for 10 billion bytes is impossible. By default, Flash Player does not impose a limit on how much memory an ActionScript program can allocate."/>
<page href="flash/errors/MemoryError.html#MemoryError()" title="MemoryError.MemoryError()" text="MemoryError Creates a new MemoryError object. message A string associated with the error object."/>
<page href="flash/errors/EOFError.html" title="EOFError class" text="EOFError An EOFError exception is thrown when you attempt to read past the end of the available data. For example, an EOFError is thrown when one of the read methods in the IDataInput interface is called and there is insufficient data to satisfy the read request."/>
<page href="flash/errors/EOFError.html#EOFError()" title="EOFError.EOFError()" text="EOFError Creates a new EOFError object. message A string associated with the error object."/>
<page href="flash/errors/ScriptTimeoutError.html" title="ScriptTimeoutError class" text="ScriptTimeoutError The ScriptTimeoutError exception is thrown when the script timeout interval is reached. The script timeout interval is 15 seconds. There are two XML attributes that you can add to the mx:Application tag: scriptTimeLimit (the number of seconds until script timeout) and scriptRecursionLimit (the depth of recursive calls permitted). Two ScriptTimeoutError exceptions are thrown. The first exception you can catch and exit cleanly. If there is no exception handler, the uncaught exception terminates execution. The second exception is thrown but cannot be caught by user code; it goes to the uncaught exception handler. It is uncatchable to prevent Flash® Player from hanging indefinitely."/>
<page href="flash/errors/ScriptTimeoutError.html#ScriptTimeoutError()" title="ScriptTimeoutError.ScriptTimeoutError()" text="ScriptTimeoutError Creates a new ScriptTimeoutError object. message A string associated with the error object."/>
<page href="flash/errors/IOError.html" title="IOError class" text="IOError The IOError exception is thrown when some type of input or output failure occurs. For example, an IOError exception is thrown if a read/write operation is attempted on a socket that has not connected or that has become disconnected."/>
<page href="flash/errors/IOError.html#IOError()" title="IOError.IOError()" text="IOError Creates a new IOError object. message A string associated with the error object."/>
<page href="flash/errors/IllegalOperationError.html" title="IllegalOperationError class" text="IllegalOperationError The IllegalOperationError exception is thrown when a method is not implemented or the implementation doesn't cover the current usage. Examples of illegal operation error exceptions include: A base class, such as DisplayObjectContainer, provides more functionality than a Stage can support (such as masks) Certain accessibility methods are called when Flash Player is compiled without accessibility support The mms.cfg setting prohibits a FileReference action ActionScript tries to run a FileReference.browse() call when a browse dialog box is already open ActionScript tries to use an unsupported protocol for a FileReference object (such as FTP) Authoring-only features are invoked from a run-time player. An attempt is made to set the name of a Timeline-placed object."/>
<page href="flash/errors/IllegalOperationError.html#IllegalOperationError()" title="IllegalOperationError.IllegalOperationError()" text="IllegalOperationError Creates a new IllegalOperationError object. message A string associated with the error object."/>
<page href="flash/errors/InvalidSWFError.html" title="InvalidSWFError class" text="InvalidSWFError Flash Player throws this exception when it encounters a corrupted SWF file."/>
<page href="flash/system/ApplicationDomain.html" title="ApplicationDomain class" text="ApplicationDomain The ApplicationDomain class is a container for discrete groups of class definitions. Application domains are used to partition classes that are in the same security domain. They allow multiple definitions of the same class to exist and allow children to reuse parent definitions. Application domains are used when an external SWF file is loaded through the Loader class. All ActionScript 3.0 definitions in the loaded SWF file are stored in the application domain, which is specified by the applicationDomain property of the LoaderContext object that you pass as a context parameter of the Loader object's load() or loadBytes() method. The LoaderInfo object also contains an applicationDomain property, which is read-only. All code in a SWF file is defined to exist in an application domain. The current application domain is where your main application runs. The system domain contains all application domains, including the current domain, which means that it contains all Flash Player classes. Every application domain, except the system domain, has an associated parent domain. The parent domain of your main application's application domain is the system domain. Loaded classes are defined only when their parent doesn't already define them. You cannot override a loaded class definition with a newer definition. For usage examples of application domains, see Programming ActionScript 3.0. The ApplicationDomain() constructor function allows you to create an ApplicationDomain object."/>
<page href="flash/system/ApplicationDomain.html#ApplicationDomain()" title="ApplicationDomain.ApplicationDomain()" text="ApplicationDomain Creates a new application domain. parentDomain If no parent domain is passed in, this application domain takes the system domain as its parent."/>
<page href="flash/system/ApplicationDomain.html#getDefinition()" title="ApplicationDomain.getDefinition()" text="getDefinition Gets a public definition from the specified application domain. The definition can be that of a class, a namespace, or a function. name The name of the definition. No public definition exists with the specified name."/>
<page href="flash/system/ApplicationDomain.html#hasDefinition()" title="ApplicationDomain.hasDefinition()" text="hasDefinition Checks to see if a public definition exists within the specified application domain. The definition can be that of a class, a namespace, or a function. name The name of the definition."/>
<page href="flash/system/ApplicationDomain.html#currentDomain" title="ApplicationDomain.currentDomain" text="currentDomain Gets the current application domain in which your code is executing."/>
<page href="flash/system/ApplicationDomain.html#parentDomain" title="ApplicationDomain.parentDomain" text="parentDomain Gets the parent domain of this application domain."/>
<page href="flash/system/System.html" title="System class" text="System The System class contains properties related to certain operations that take place on the user's computer, such as operations with shared objects, local settings for cameras and microphones, and use of the Clipboard. Additional properties and methods are in other classes within the flash.system package: the Capabilities class, the Security class, and the IME class. This class contains only static methods and properties. You cannot create new instances of the System class."/>
<page href="flash/system/System.html#exit()" title="System.exit()" text="exit Closes the Flash player. For the standalone Flash Player debugger version only. Player Version: Flash Player 9 Update 3. code A value to pass to the operating system. Typically, if the process exits normally, the value is 0."/>
<page href="flash/system/System.html#gc()" title="System.gc()" text="gc Forces the garbage collection process. For Flash Player debugger version only. Player Version: Flash Player 9 Update 3."/>
<page href="flash/system/System.html#pause()" title="System.pause()" text="pause Pauses the Flash player. After calling this method, nothing in the player continues except the delivery of Socket events. For Flash Player debugger version only. Player Version: Flash Player 9 Update 3."/>
<page href="flash/system/System.html#resume()" title="System.resume()" text="resume Resumes the Flash player after using System.pause(). For Flash Player debugger version only. Player Version: Flash Player 9 Update 3."/>
<page href="flash/system/System.html#setClipboard()" title="System.setClipboard()" text="setClipboard Replaces the contents of the Clipboard with a specified text string. Note: Because of security concerns, it is not possible to read the contents of the system Clipboard. In other words, there is no corresponding System.getClipboard() method. string A plain-text string of characters to put on the system Clipboard, replacing its current contents (if any)."/>
<page href="flash/system/System.html#ime" title="System.ime" text="ime The currently installed system IME. To register for imeComposition events, call addEventListener() on this instance."/>
<page href="flash/system/System.html#totalMemory" title="System.totalMemory" text="totalMemory The amount of memory (in bytes) currently in use by Adobe® Flash® Player."/>
<page href="flash/system/System.html#useCodePage" title="System.useCodePage" text="useCodePage A Boolean value that tells Flash Player which code page to use to interpret external text files. 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. The default value of useCodePage is false. Text that you load as an external file (using flash.display.Loader.load() or the flash.net.URLLoader, flash.net.URLStream, or XML class) must have been saved as Unicode 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, set useCodePage to true. Add the following 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 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 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 to display your text. 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 useCodePage set to false. This way, Flash Player 6 and later interprets the text as Unicode."/>
<page href="flash/system/IMEConversionMode.html" title="IMEConversionMode class" text="IMEConversionMode This class contains constants for use with the IME.conversionMode property. Setting conversionMode to either ALPHANUMERIC_FULL or JAPANESE_KATAKANA_FULL causes the player to use a full width font, whereas using ALPHANUMERIC_HALF or JAPANESE_KATAKANA_HALF uses a half width font."/>
<page href="flash/system/IMEConversionMode.html#ALPHANUMERIC_FULL" title="IMEConversionMode.ALPHANUMERIC_FULL" text="ALPHANUMERIC_FULL The string &quot;ALPHANUMERIC_FULL&quot;, for use with the IME.conversionMode property. This constant is used with all IMEs. Use the syntax IMEConversionMode.ALPHANUMERIC_FULL."/>
<page href="flash/system/IMEConversionMode.html#ALPHANUMERIC_HALF" title="IMEConversionMode.ALPHANUMERIC_HALF" text="ALPHANUMERIC_HALF The string &quot;ALPHANUMERIC_HALF&quot;, for use with the IME.conversionMode property. This constant is used with all IMEs. Use the syntax IMEConversionMode.ALPHANUMERIC_HALF."/>
<page href="flash/system/IMEConversionMode.html#CHINESE" title="IMEConversionMode.CHINESE" text="CHINESE The string &quot;CHINESE&quot;, for use with the IME.conversionMode property. This constant is used with simplified and traditional Chinese IMEs. Use the syntax IMEConversionMode.CHINESE."/>
<page href="flash/system/IMEConversionMode.html#JAPANESE_HIRAGANA" title="IMEConversionMode.JAPANESE_HIRAGANA" text="JAPANESE_HIRAGANA The string &quot;JAPANESE_HIRAGANA&quot;, for use with the IME.conversionMode property. This constant is used with Japanese IMEs. Use the syntax IMEConversionMode.JAPANESE_HIRAGANA."/>
<page href="flash/system/IMEConversionMode.html#JAPANESE_KATAKANA_FULL" title="IMEConversionMode.JAPANESE_KATAKANA_FULL" text="JAPANESE_KATAKANA_FULL The string &quot;JAPANESE_KATAKANA_FULL&quot;, for use with the IME.conversionMode property. This constant is used with Japanese IMEs. Use the syntax IMEConversionMode.JAPANESE_KATAKANA_FULL."/>
<page href="flash/system/IMEConversionMode.html#JAPANESE_KATAKANA_HALF" title="IMEConversionMode.JAPANESE_KATAKANA_HALF" text="JAPANESE_KATAKANA_HALF The string &quot;JAPANESE_KATAKANA_HALF&quot;, for use with the IME.conversionMode property. This constant is used with Japanese IMEs. Use the syntax IMEConversionMode.JAPANESE_KATAKANA_HALF."/>
<page href="flash/system/IMEConversionMode.html#KOREAN" title="IMEConversionMode.KOREAN" text="KOREAN The string &quot;KOREAN&quot;, for use with the IME.conversionMode property. This constant is used with Korean IMEs. Use the syntax IMEConversionMode.KOREAN."/>
<page href="flash/system/IMEConversionMode.html#UNKNOWN" title="IMEConversionMode.UNKNOWN" text="UNKNOWN The string &quot;UNKNOWN&quot;, which can be returned by a call to the IME.conversionMode property. This value cannot be set, and is returned only if the player is unable to identify the currently active IME. Use the syntax IMEConversionMode.UNKNOWN."/>
<page href="flash/system/Security.html" title="Security class" text="Security The Security class lets you specify how SWF files in different domains can communicate with each other."/>
<page href="flash/system/Security.html#allowDomain()" title="Security.allowDomain()" text="allowDomain Lets SWF files and HTML files in the identified domains access objects and variables in the SWF file that contains the allowDomain() call. If two SWF files are served from the same domain — for example, http://mysite.com/swfA.swf and http://mysite.com/swfB.swf — then swfA.swf can examine and modify variables, objects, properties, methods, and so on in swfB.swf, and swfB.swf can do the same for swfA.swf. This is called cross-movie scripting or cross-scripting. If two SWF files are served from different domains — for example, http://siteA.com/swfA.swf and http://siteB.com/siteB.swf — then, by default, Flash Player does not allow swfA.swf to script swfB.swf, nor swfB.swf to script swfA.swf. A SWF file gives SWF files from other domains by calling Security.allowDomain(). This is called cross-domain scripting. By calling Security.allowDomain(&quot;siteA.com&quot;), siteB.swf gives siteA.swf permission to script it. In any cross-domain situation, it is important to be clear about the two parties involved. For the purposes of this discussion, the side performing the cross-scripting is called the accessing party (usually the accessing SWF), and the other side is called the party being accessed (usually the SWF being accessed). When siteA.swf scripts siteB.swf, siteA.swf is the accessing party, and siteB.swf is the party being accessed. Cross-domain permissions that are established with allowDomain() are asymmetrical. In the previous example, siteA.swf can script siteB.swf, but siteB.swf cannot script siteA.swf, because siteA.swf has not called allowDomain() to give SWF files at siteB.com permission to script it. You can set up symmetrical permissions by having both SWF files call allowDomain(). In addition to protecting SWF files from cross-domain scripting originated by other SWF files, Flash Player protects SWF files from cross-domain scripting originated by HTML files. HTML-to-SWF scripting can occur with older Flash browser functions such as SetVariable or callbacks established through ExternalInterface.addCallback(). When HTML-to-SWF scripting crosses domains, the SWF file being accessed must call allowDomain(), just as when the accessing party is a SWF file, or the operation will fail. Specifying an IP address as a parameter to allowDomain() does not permit access by all parties that originate at the specified IP address. Instead, it permits access only by a party that contains the specified IP address it its URL, rather than a domain name that maps to that IP address. Version-specific differences Flash Player's cross-domain security rules have evolved from version to version. The following table summarizes the differences. Latest SWF version involved in cross-scripting allowDomain() needed? allowInsecureDomain() needed? Which SWF must call allowDomain() or allowInsecureDomain()? What can be specified in allowDomain() or allowInsecureDomain()? 5 or earlier No No N/A N/A 6 Yes, if superdomains don't match No The SWF file being accessed, or any SWF file with the same superdomain as the SWF file being accessed Text-based domain (mysite.com) IP address (192.168.1.1) 7 Yes, if domains don't match exactly Yes, if performing HTTP-to-HTTPS access (even if domains match exactly) The SWF file being accessed, or any SWF file with exactly the same domain as the SWF file being accessed Text-based domain (mysite.com) IP address (192.168.1.1) 8 or later Yes, if domains don't match exactly Yes, if performing HTTP-to-HTTPS access (even if domains match exactly) SWF being accessed Text-based domain (mysite.com) IP address (192.168.1.1) Wildcard (~~) The versions that control the behavior of Flash Player are SWF versions (the published version of a SWF file), not the version of Flash Player itself. For example, when Flash Player 8 is playing a SWF file published for version 7, it applies behavior that is consistent with version 7. This practice ensures that player upgrades do not change the behavior of Security.allowDomain() in deployed SWF files. The version column in the previous table shows the latest SWF version involved in a cross-scripting operation. Flash Player determines its behavior according to either the accessing SWF file's version or the version of the SWF file that is being accessed, whichever is later. The following paragraphs provide more detail about Flash Player security changes involving Security.allowDomain(). Version 5. There are no cross-domain scripting restrictions. Version 6. Cross-domain scripting security is introduced. By default, Flash Player forbids cross-domain scripting; Security.allowDomain() can permit it. To determine whether two files are in the same domain, Flash Player uses each file's superdomain, which is the exact host name from the file's URL, minus the first segment, down to a minimum of two segments. For example, the superdomain of www.mysite.com is mysite.com. SWF files from www.mysite.com and store.mysite.com to script each other without a call to Security.allowDomain(). Version 7. Superdomain matching is changed to exact domain matching. Two files are permitted to script each other only if the host names in their URLs are identical; otherwise, a call to Security.allowDomain() is required. By default, files loaded from non-HTTPS URLs are no longer permitted to script files loaded from HTTPS URLs, even if the files are loaded from exactly the same domain. This restriction helps protect HTTPS files, because a non-HTTPS file is vulnerable to modification during download, and a maliciously modified non-HTTPS file could corrupt an HTTPS file, which is otherwise immune to such tampering. Security.allowInsecureDomain() is introduced to allow HTTPS SWF files that are being accessed to voluntarily disable this restriction, but the use of Security.allowInsecureDomain() is discouraged. Version 8. There are two major areas of change: Calling Security.allowDomain() now permits cross-scripting operations only if the SWF file being accessed is the SWF file that called Security.allowDomain(). In other words, a SWF file that calls Security.allowDomain() now permits access only to itself. In previous versions, calling Security.allowDomain() permitted cross-scripting operations where the SWF file being accessed could be any SWF file in the same domain as the SWF file that called Security.allowDomain(). Calling Security.allowDomain() previously opened up the entire domain of the calling SWF file. Support has been added for wildcard values with Security.allowDomain(&quot;~~&quot;) and Security.allowInsecureDomain(&quot;~~&quot;). The wildcard (~~) value permits cross-scripting operations where the accessing file is any file at all, loaded from anywhere. Think of the wildcard as a global permission. Wildcard permissions are required to enable certain kinds of operations under the local file security rules. Specifically, for a local SWF file with network-access permissions to script a SWF file on the Internet, the Internet SWF file being accessed must call Security.allowDomain(&quot;~~&quot;), reflecting that the origin of a local SWF file is unknown. (If the Internet SWF file is loaded from an HTTPS URL, the Internet SWF file must instead call Security.allowInsecureDomain(&quot;~~&quot;).) Occasionally, you may 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't know the final domain of the child SWF file. This can happen, for example, when you use load-balancing redirects or third-party servers. In this situation, you can use the url property of the URLRequest object that you pass to Loader.load(). For example, if you load a child SWF file into a parent SWF, you can access the contentLoaderInfo property of the Loader object for the parent SWF: Security.allowDomain(loader.contentLoaderInfo.url) Make sure that you wait until the child SWF file begins loading to get the correct value of the url property. To determine when the child SWF has begun loading, use the progress event. 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't know what the domain of its parent will be. In this situation, you can access the loaderInfo property of the display object that is the SWF's root object. In the child SWF, call Security.allowDomain( this.root.loaderInfo.loaderURL). You don't have to wait for the parent SWF file to load; the parent will already be loaded by the time the child loads. If you are publishing for Flash Player 8 or later, you can also handle these situations by calling Security.allowDomain(&quot;~~&quot;). However, this can sometimes be a dangerous shortcut, because it allows the calling SWF file to be accessed by any other SWF file from any domain. It is usually safer to use the _url property. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper domains One or more strings or URLRequest objects that name the domains from which you want to allow access. You can specify the special domain &quot;~~&quot; to allow access from all domains. Specifying &quot;~~&quot; is the only way to allow access to nonlocal SWF files from local SWF files that have been published using Access Network Only for the Local Playback Security option in the Flash authoring tool."/>
<page href="flash/system/Security.html#allowInsecureDomain()" title="Security.allowInsecureDomain()" text="allowInsecureDomain Lets SWF files and HTML files in the identified domains access objects and variables in the calling SWF file, which is hosted by means of the HTTPS protocol. This method is not recommended; see &quot;Security considerations,&quot; later in this entry. This method works in the same way as Security.allowDomain(), but it also permits operations in which the accessing party is loaded with a non-HTTPS protocol, and the party being accessed is loaded with HTTPS. In Flash Player 7 and later, non-HTTPS files are not allowed to script HTTPS files. The allowInsecureDomain() method lifts this restriction when the HTTPS SWF file being accessed uses it. Use allowInsecureDomain() only to enable scripting from non-HTTPS files to HTTPS files. Use it to enable scripting when the accessing non-HTTPS file and the HTTPS file being accessed are served from the same domain, for example, if a SWF file at http://mysite.com wants to script a SWF file at https://mysite.com. Do not use this method to enable scripting between non-HTTPS files, between HTTPS files, or from HTTPS files to non-HTTPS files. For those situations, use allowDomain() instead. Security considerations: Flash Player provides allowInsecureDomain() to maximize flexibility, but calling this method is not recommended. Serving a file over HTTPS provides several protections for you and your users, and calling allowInsecureDomain weakens one of those protections. The following scenario illustrates how allowInsecureDomain() can compromise security, if it is not used with careful consideration. Note that the following information is only one possible scenario, designed to help you understand allowInsecureDomain() through a real-world example of cross-scripting. It does not cover all issues with security architecture and should be used for background information only. The Flash Player Developer Center contains extensive information on Flash Player and security. For more information, see http://www.adobe.com/devnet/security/. Suppose you are building an e-commerce site that consists of two components: a catalog, which does not need to be secure, because it contains only public information; and a shopping cart/checkout component, which must be secure to protect users' financial and personal information. Suppose you are considering serving the catalog from http://mysite.com/catalog.swf and the cart from https://mysite.com/cart.swf. One requirement for your site is that a third party should not be able to steal your users' credit card numbers by taking advantage of a weakness in your security architecture. Suppose that a middle-party attacker intervenes between your server and your users, attempting to steal the credit card numbers that your users enter into your shopping cart application. A middle party might, for example, be an unscrupulous ISP used by some of your users, or a malicious administrator at a user's workplace — anyone who has the ability to view or alter network packets transmitted over the public Internet between your users and your servers. This situation is not uncommon. If cart.swf uses HTTPS to transmit credit card information to your servers, then the middle-party attacker can't directly steal this information from network packets, because the HTTPS transmission is encrypted. However, the attacker can use a different technique: altering the contents of one of your SWF files as it is delivered to the user, replacing your SWF file with an altered version that transmits the user's information to a different server, owned by the attacker. The HTTPS protocol, among other things, prevents this &quot;modification&quot; attack from working, because, in addition to being encrypted, HTTPS transmissions are tamper-resistant. If a middle-party attacker alters a packet, the receiving side detects the alteration and discards the packet. So the attacker in this situation can't alter cart.swf, because it is delivered over HTTPS. However, suppose that you want to allow buttons in catalog.swf, served over HTTP, to add items to the shopping cart in cart.swf, served over HTTPS. To accomplish this, cart.swf calls allowInsecureDomain(), which allows catalog.swf to script cart.swf. This action has an unintended consequence: Now the attacker can alter catalog.swf as it is initially being downloaded by the user, because catalog.swf is delivered with HTTP and is not tamper-resistant. The attacker's altered catalog.swf can now script cart.swf, because cart.swf contains a call to allowInsecureDomain(). The altered catalog.swf file can use ActionScript to access the variables in cart.swf, thus reading the user's credit card information and other sensitive data. The altered catalog.swf can then send this data to an attacker's server. Obviously, this implementation is not desired, but you still want to allow cross-scripting between the two SWF files on your site. Here are two possible ways to redesign this hypothetical e-commerce site to avoid allowInsecureDomain(): Serve all SWF files in the application over HTTPS. This is by far the simplest and most reliable solution. In the scenario described, you would serve both catalog.swf and cart.swf over HTTPS. You might experience slightly higher bandwidth consumption and server CPU load when switching a file such as catalog.swf from HTTP to HTTPS, and your users might experience slightly longer application load times. You need to experiment with real servers to determine the severity of these effects; usually they are no worse than 10-20% each, and sometimes they are not present at all. You can usually improve results by using HTTPS-accelerating hardware or software on your servers. A major benefit of serving all cooperating SWF files over HTTPS is that you can use an HTTPS URL as the main URL in the user's browser without generating any mixed-content warnings from the browser. Also, the browser's padlock icon becomes visible, providing your users with a common and trusted indicator of security. Use HTTPS-to-HTTP scripting, rather than HTTP-to-HTTPS scripting. In the scenario described, you could store the contents of the user's shopping cart in catalog.swf, and have cart.swf manage only the checkout process. At checkout time, cart.swf could retrieve the cart contents from ActionScript variables in catalog.swf. The restriction on HTTP-to-HTTPS scripting is asymmetrical; although an HTTP-delivered catalog.swf file cannot safely be allowed to script an HTTPS-delivered cart.swf file, an HTTPS cart.swf file can script the HTTP catalog.swf file. This approach is more delicate than the all-HTTPS approach; you must be careful not to trust any SWF file delivered over HTTP, because of its vulnerability to tampering. For example, when cart.swf retrieves the ActionScript variable that describes the cart contents, the ActionScript code in cart.swf cannot trust that the value of this variable is in the format that you expect. You must verify that the cart contents do not contain invalid data that might lead cart.swf to take an undesired action. You must also accept the risk that a middle party, by altering catalog.swf, could supply valid but inaccurate data to cart.swf; for example, by placing items in the user's cart. The usual checkout process mitigates this risk somewhat by displaying the cart contents and total cost for final approval by the user, but the risk remains present. Web browsers have enforced separation between HTTPS and non-HTTPS files for years, and the scenario described illustrates one good reason for this restriction. Flash Player gives you the ability to work around this security restriction when you absolutely must, but be sure to consider the consequences carefully before doing so. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper domains One or more strings or URLRequest objects that name the domains from which you want to allow access. You can specify the special domain &quot;~~&quot; to allow access from all domains. Specifying &quot;~~&quot; is the only way to allow access to nonlocal SWF files from local SWF files that have been published using the Access Network Only option for the Local Playback Security setting (File &gt; Publish Settings &gt; Flash tab) in the Flash authoring tool."/>
<page href="flash/system/Security.html#loadPolicyFile()" title="Security.loadPolicyFile()" text="loadPolicyFile Loads a cross-domain policy file from a location specified by the url parameter. Flash Player uses policy files to determine whether to permit Flash movies to load data from servers other than their own. By default, Flash Player looks for policy files in only one location: /crossdomain.xml on the server to which a data-loading request is being made. With Security.loadPolicyFile(), Flash Player can load policy files from arbitrary locations, as shown in the following example: Security.loadPolicyFile(&quot;http://www.example.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. For example, following the previous code, these lines do not throw an exception: import flash.net.~~; var request:URLRequest = new URLRequest(&quot;http://www.example.com/sub/dir/vars.txt&quot;); var loader:URLLoader = new URLLoader(); loader.load(request); var loader2:URLLoader = new URLLoader(); var request2:URLRequest = new URLRequest(&quot;http://www.example.com/sub/dir/deep/vars2.txt&quot;); loader2.load(request2); However, the following code does throw a security exception: import flash.net.~~; var request3:URLRequest = new URLRequest(&quot;http://www.example.com/elsewhere/vars3.txt&quot;); var loader3:URLLoader = new URLLoader(); loader3.load(request3); You 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: 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. The ability to connect to ports lower than 1024 can be granted by a policy file loaded with loadPolicyFile() only. 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. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper url The URL location of the cross-domain policy file to be loaded."/>
<page href="flash/system/Security.html#showSettings()" title="Security.showSettings()" text="showSettings Displays the Security Settings panel in Flash Player. panel A value from the SecurityPanel class that specifies which Security Settings panel you want to display. If you omit this parameter, SecurityPanel.DEFAULT is used."/>
<page href="flash/system/Security.html#exactSettings" title="Security.exactSettings" text="exactSettings Determines how Flash Player chooses the domain to use for certain Flash Player settings, including settings for camera and microphone permissions, storage quotas, and storage of persistent shared objects. You may set exactSettings to false in order to have the SWF file use the same settings that were used in Flash Player 6. In Flash Player 6, the domain used for these player settings was based on the trailing portion of the domain of the SWF file. If the domain of a SWF file includes more than two segments, such as www.example.com, the first segment of the domain (&quot;www&quot;) is removed, and the remaining portion of the domain is used: example.com. So, in Flash Player 6, www.example.com and store.example.com both use example.com as the domain for these settings. Similarly, www.example.co.uk and store.example.co.uk both use example.co.uk as the domain for these settings. In Flash Player 7 and later, player settings are chosen by default according to a SWF file's exact domain; for example, a SWF file from www.example.com would use the player settings for www.example.com, and a SWF file from store.example.com would use the separate player settings for store.example.com. When Security.exactSettings is set to true, Flash Player uses exact domains for player settings. When it is set to false, the Flash Player uses domain settings used in Flash Player 6. The default value for exactSettings is true. If you change exactSettings from its default value, you must do so before any events occur that require Flash Player to choose player settings — for example, using a camera or microphone, or retrieving a persistent shared object. If you previously published a version 6 SWF file and created persistent shared objects from it, and you now need to retrieve those persistent shared objects from that SWF file after porting it to version 7 or later, or from a different SWF file of version 7 or later, you must set Security.exactSettings to false before calling SharedObject.getLocal(). Flash Player already used the value of exactSettings at least once in a decision about player settings."/>
<page href="flash/system/Security.html#LOCAL_TRUSTED" title="Security.LOCAL_TRUSTED" text="LOCAL_TRUSTED The SWF file is a local file and has been trusted by the user, using either the Settings Manager or a FlashPlayerTrust configuration file. The SWF file can read from local data sources and communicate with the Internet."/>
<page href="flash/system/Security.html#LOCAL_WITH_FILE" title="Security.LOCAL_WITH_FILE" text="LOCAL_WITH_FILE The SWF file is a local file, has not been trusted by the user, and was not published with a networking designation. The SWF file may read from local data sources but may not communicate with the Internet."/>
<page href="flash/system/Security.html#LOCAL_WITH_NETWORK" title="Security.LOCAL_WITH_NETWORK" text="LOCAL_WITH_NETWORK The SWF file is a local file, has not been trusted by the user, and was published with a networking designation. The SWF file can communicate with the Internet but cannot read from local data sources."/>
<page href="flash/system/Security.html#REMOTE" title="Security.REMOTE" text="REMOTE The SWF file is from an Internet URL and operates under domain-based sandbox rules."/>
<page href="flash/system/Security.html#sandboxType" title="Security.sandboxType" text="sandboxType Indicates the type of security sandbox in which the calling SWF file is operating. Security.sandboxType has one of the following values: remote (Security.REMOTE): This SWF file is from an Internet URL and operates under domain-based sandbox rules. localWithFile (Security.LOCAL_WITH_FILE): This SWF file is a local file, has not been trusted by the user, and was not published with a networking designation. The SWF file may read from local data sources but may not communicate with the Internet. localWithNetwork (Security.LOCAL_WITH_NETWORK): This SWF file is a local file, has not been trusted by the user, and was published with a networking designation. The SWF file can communicate with the Internet but cannot read from local data sources. localTrusted (Security.LOCAL_TRUSTED): This SWF file is a local file and has been trusted by the user, using either the Settings Manager or a FlashPlayerTrust configuration file. The SWF file can read from local data sources and communicate with the Internet. A SWF file of any version may use this property, but is only supported in Flash Player 8 or later. Thus you can examine this property, for example, from a version 7 SWF file playing in Flash Player 8. This all-versions support means that, if you publish for a version earlier than 8, you will not know at publish time whether this property will be supported at playback time. Thus, in a SWF file of version 7 or earlier, this property has an undefined value; that should happen only when the player version (indicated by flash.system.Capabilities.version) is earlier than 8. In that situation, you can determine the sandbox type according to whether the SWF file is a local file or not. If it is a local file, Flash Player will classify the SWF file as localTrusted. (Before Flash Player 8, this was how all local content was treated.) If it is not a local file, Flash Player will classify the SWF file as remote. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper"/>
<page href="flash/system/IME.html" title="IME class" text="IME The IME class lets you directly manipulate the operating system's input method editor (IME) in the Flash Player application that is running on a client computer. You can determine whether an IME is installed, whether or not the IME is currently enabled, and which IME is enabled. You can disable or enable the IME in the Flash Player application, and you can perform other limited functions, depending on the operating system. IMEs let users type non-ASCII text characters in multibyte languages such as Chinese, Japanese, and Korean. For more information on working with IMEs, see the documentation for the operating system for which you are developing applications. For additional resources, see the following websites: http://www.microsoft.com/globaldev/default.mspx http://developer.apple.com/documentation/ http://java.sun.com If an IME is not active on the user's computer, calls to IME methods or properties, other than Capabilities.hasIME, will fail. Once you manually activate an IME, subsequent ActionScript calls to IME methods and properties will work as expected. For example, if you are using a Japanese IME, it must be activated before any IME method or property is called. The following table shows the platform coverage of this class: Capability Windows Mac OSX Determine whether the IME is installed: Capabilities.hasIME Yes Yes Set IME on or off: IME.enabled Yes Yes Find out whether IME is on or off: IME.enabled Yes Yes Get or set IME conversion mode: IME.conversionMode Yes Yes ~~~~ Send IME the string to be converted: IME.setCompositionString() Yes ~~ No Get from IME the original string before conversion: System.ime.addEventListener() Yes ~~ No Send request to convert to IME: IME.doConversion() Yes ~~ No ~~ Not all Windows IMEs support all of these operations. The only IME that supports them all is the Japanese IME. ~~~~ On the Macintosh, only the Japanese IME supports these methods, and third-party IMEs do not support them. The ActionScript 3.0 version of this class does not support Macintosh Classic."/>
<page href="flash/system/IME.html#doConversion()" title="IME.doConversion()" text="doConversion Instructs the IME to select the first candidate for the current composition string. The call was not successful."/>
<page href="flash/system/IME.html#setCompositionString()" title="IME.setCompositionString()" text="setCompositionString Sets the IME composition string. When this string is set, the user can select IME candidates before committing the result to the text field that currently has focus. If no text field has focus, this method fails and throws an error. composition The string to send to the IME. The call is not successful."/>
<page href="flash/system/IME.html#conversionMode" title="IME.conversionMode" text="conversionMode The conversion mode of the current IME. Possible values are IME mode string constants that indicate the conversion mode: ALPHANUMERIC_FULL ALPHANUMERIC_HALF CHINESE JAPANESE_HIRAGANA JAPANESE_KATAKANA_FULL JAPANESE_KATAKANA_HALF KOREAN UNKNOWN (read-only value; this value cannot be set) A set attempt was not successful."/>
<page href="flash/system/IME.html#enabled" title="IME.enabled" text="enabled Indicates whether the system IME is enabled (true) or disabled (false). An enabled IME performs multibyte input; a disabled IME performs alphanumeric input. A set attempt was not successful."/>
<page href="flash/system/IME.html#event:imeComposition" title="IME.imeComposition" text="imeComposition Dispatched when a user has completed an input method editor (IME) composition and the reading string is available. IMEs are generally used to enter text from languages that have ideographs instead of letters, such as Japanese, Chinese and Korean."/>
<page href="flash/system/SecurityPanel.html" title="SecurityPanel class" text="SecurityPanel The SecurityPanel class provides values for specifying which Security Settings panel you want to display. This class contains static constants that are used with the Security.showSettings() method. You cannot create new instances of the SecurityPanel class."/>
<page href="flash/system/SecurityPanel.html#CAMERA" title="SecurityPanel.CAMERA" text="CAMERA When passed to Security.showSettings(), displays the Camera panel in Flash Player Settings."/>
<page href="flash/system/SecurityPanel.html#DEFAULT" title="SecurityPanel.DEFAULT" text="DEFAULT When passed to Security.showSettings(), displays the panel that was open the last time the user closed the Flash Player Settings."/>
<page href="flash/system/SecurityPanel.html#LOCAL_STORAGE" title="SecurityPanel.LOCAL_STORAGE" text="LOCAL_STORAGE When passed to Security.showSettings(), displays the Local Storage Settings panel in Flash Player Settings."/>
<page href="flash/system/SecurityPanel.html#MICROPHONE" title="SecurityPanel.MICROPHONE" text="MICROPHONE When passed to Security.showSettings(), displays the Microphone panel in Flash Player Settings."/>
<page href="flash/system/SecurityPanel.html#PRIVACY" title="SecurityPanel.PRIVACY" text="PRIVACY When passed to Security.showSettings(), displays the Privacy Settings panel in Flash Player Settings."/>
<page href="flash/system/SecurityPanel.html#SETTINGS_MANAGER" title="SecurityPanel.SETTINGS_MANAGER" text="SETTINGS_MANAGER When passed to Security.showSettings(), displays the Settings Manager (in a separate browser window)."/>
<page href="flash/system/Capabilities.html" title="Capabilities class" text="Capabilities The Capabilities class provides properties that describe the system and player that are hosting a SWF file. For example, a mobile phone's screen might be 100 square pixels, black and white, whereas a PC screen might be 1000 square pixels, color. By using the Capabilities object to determine what type of device a user has, you can provide appropriate content to as many users as possible. When you know the device's capabilities, you can tell the server to send the appropriate SWF files or tell the SWF file to alter its presentation. You can send a player's capabilities information, which is stored in the Capabilities.serverString property as a URL-encoded string, using the GET or POST HTTP method. The following example shows a server string for a computer that has MP3 support and 1600 x 1200 pixel resolution and that is running Windows XP with an input method editor (IME) installed: A=t&amp;SA=t&amp;SV=t&amp;EV=t&amp;MP3=t&amp;AE=t&amp;VE=t&amp;ACC=f&amp;PR=t&amp;SP=t&amp; SB=f&amp;DEB=t&amp;V=WIN%209%2C0%2C0%2C0&amp;M=Adobe%20Windows&amp; R=1600x1200&amp;DP=72&amp;COL=color&amp;AR=1.0&amp;OS=Windows%20XP&amp; L=en&amp;PT=External&amp;AVD=f&amp;LFD=f&amp;WD=f&amp;IME=t The following table lists the possible ActionScript properties and corresponding server strings: ActionScript property Server string avHardwareDisable AVD hasAccessibility ACC hasAudio A hasAudioEncoder AE hasEmbeddedVideo EV hasIME IME hasMP3 MP3 hasPrinting PR hasScreenBroadcast SB hasScreenPlayback SP hasStreamingAudio SA hasStreamingVideo SV hasTLS TLS hasVideoEncoder VE isDebugger DEB language L localFileReadDisable LFD manufacturer M os OS pixelAspectRatio AR playerType PT screenColor COL screenDPI DP screenResolutionX R screenResolutionY R version V All properties of the Capabilities class are read-only."/>
<page href="flash/system/Capabilities.html#avHardwareDisable" title="Capabilities.avHardwareDisable" text="avHardwareDisable Specifies whether access to the user's camera and microphone has been administratively prohibited (true) or allowed (false). The server string is AVD."/>
<page href="flash/system/Capabilities.html#hasAccessibility" title="Capabilities.hasAccessibility" text="hasAccessibility Specifies whether the player is running in an environment that supports (true) or does not support (false) communication with accessibility aids. The server string is ACC."/>
<page href="flash/system/Capabilities.html#hasAudio" title="Capabilities.hasAudio" text="hasAudio Specifies whether the player is running on a system that has audio capabilities. This property is always true. The server string is A."/>
<page href="flash/system/Capabilities.html#hasAudioEncoder" title="Capabilities.hasAudioEncoder" text="hasAudioEncoder Specifies whether the player can (true) or cannot (false) encode an audio stream, such as that coming from a microphone. The server string is AE."/>
<page href="flash/system/Capabilities.html#hasEmbeddedVideo" title="Capabilities.hasEmbeddedVideo" text="hasEmbeddedVideo Specifies whether the player is running on a system that supports (true) or does not support (false) embedded video. The server string is EV."/>
<page href="flash/system/Capabilities.html#hasIME" title="Capabilities.hasIME" text="hasIME Specifies whether the player is running on a system that does (true) or does not (false) have an input method editor (IME) installed. The server string is IME."/>
<page href="flash/system/Capabilities.html#hasMP3" title="Capabilities.hasMP3" text="hasMP3 Specifies whether the player is running on a system that does (true) or does not (false) have an MP3 decoder. The server string is MP3."/>
<page href="flash/system/Capabilities.html#hasPrinting" title="Capabilities.hasPrinting" text="hasPrinting Specifies whether the player is running on a system that does (true) or does not (false) support printing. The server string is PR."/>
<page href="flash/system/Capabilities.html#hasScreenBroadcast" title="Capabilities.hasScreenBroadcast" text="hasScreenBroadcast Specifies whether the player does (true) or does not (false) support the development of screen broadcast applications to be run through Flash Media Server. The server string is SB."/>
<page href="flash/system/Capabilities.html#hasScreenPlayback" title="Capabilities.hasScreenPlayback" text="hasScreenPlayback Specifies whether the player does (true) or does not (false) support the playback of screen broadcast applications that are being run through Flash Media Server. The server string is SP."/>
<page href="flash/system/Capabilities.html#hasStreamingAudio" title="Capabilities.hasStreamingAudio" text="hasStreamingAudio Specifies whether the player can (true) or cannot (false) play streaming audio. The server string is SA."/>
<page href="flash/system/Capabilities.html#hasStreamingVideo" title="Capabilities.hasStreamingVideo" text="hasStreamingVideo Specifies whether the player can (true) or cannot (false) play streaming video. The server string is SV."/>
<page href="flash/system/Capabilities.html#hasTLS" title="Capabilities.hasTLS" text="hasTLS Specifies whether the player is on a system that supports native SSL sockets through NetConnection (true) or does not (false). The server string is TLS."/>
<page href="flash/system/Capabilities.html#hasVideoEncoder" title="Capabilities.hasVideoEncoder" text="hasVideoEncoder Specifies whether the player can (true) or cannot (false) encode a video stream, such as that coming from a web camera. The server string is VE."/>
<page href="flash/system/Capabilities.html#isDebugger" title="Capabilities.isDebugger" text="isDebugger Specifies whether the player is a special debugging version (true), or an officially released version (false). The server string is DEB."/>
<page href="flash/system/Capabilities.html#language" title="Capabilities.language" text="language Specifies the language code of the system on which the player is running. The language is specified as a lowercase two-letter language code from ISO 639-1. For Chinese, an additional uppercase two-letter country code from ISO 3166 distinguishes between Simplified and Traditional Chinese. The languages codes are based on the English names of the language: for example, hu specifies Hungarian. On English systems, this property returns only the language code (en), not the country code. On Microsoft Windows systems, this property returns the user interface (UI) language, which refers to the language used for all menus, dialog boxes, error messages, and help files. The following table lists the possible values: Language Value Czech cs Danish da Dutch nl English en Finnish fi French fr German de Hungarian hu Italian it Japanese ja Korean ko Norwegian no Other/unknown xu Polish pl Portuguese pt Russian ru Simplified Chinese zh-CN Spanish es Swedish sv Traditional Chinese zh-TW Turkish tr The server string is L. In the following example, depending on the language of the user's operating system, different content is displayed. The Capabilities.language property returns the ISO 639-1 language code (for example, &quot;en&quot; for English). The switch statement checks for the language code and set the content of the myTextField text field to a greeting specific to the language. If the language code was not supported by the example, a default error string is returned. package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.system.Capabilities; public class Capabilities_languageExample extends Sprite { public function Capabilities_languageExample() { var myTextField:TextField = new TextField(); myTextField.x = 10; myTextField.y = 10; myTextField.background = true; myTextField.autoSize = TextFieldAutoSize.LEFT; var greetingEnglish:String = &quot;Hello World&quot;; var greetingGerman:String = &quot;Hallo Welt&quot;; var greetingFrench:String = &quot;Bonjour Monde&quot;; var greetingSpanish:String = &quot;Hola Mundo&quot;; var lang:String = Capabilities.language; switch (lang) { case &quot;en&quot;: myTextField.text = greetingEnglish; break; case &quot;de&quot;: myTextField.text = greetingGerman; break; case &quot;fr&quot;: myTextField.text = greetingFrench; break; case &quot;es&quot;: myTextField.text = greetingSpanish; break; default: myTextField.text = &quot;Sorry your system's language is not supported at this time.&quot;; } this.addChild(myTextField); } } }"/>
<page href="flash/system/Capabilities.html#localFileReadDisable" title="Capabilities.localFileReadDisable" text="localFileReadDisable Specifies whether read access to the user's hard disk has been administratively prohibited (true) or allowed (false). If this property is true, Flash Player cannot read files (including the first SWF file that Flash Player launches with) from the user's hard disk. For example, attempts to read a file on the user's hard disk using load methods will fail if this property is set to true. Reading runtime shared libraries is also 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."/>
<page href="flash/system/Capabilities.html#manufacturer" title="Capabilities.manufacturer" text="manufacturer Specifies the manufacturer of Flash Player, in the format &quot;Adobe OSName&quot;. The value for OSName could be &quot;Windows&quot;, &quot;Macintosh&quot;, &quot;Linux&quot;, or another operating system name. The server string is M."/>
<page href="flash/system/Capabilities.html#os" title="Capabilities.os" text="os Specifies 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."/>
<page href="flash/system/Capabilities.html#pixelAspectRatio" title="Capabilities.pixelAspectRatio" text="pixelAspectRatio Specifies the pixel aspect ratio of the screen. The server string is AR."/>
<page href="flash/system/Capabilities.html#playerType" title="Capabilities.playerType" text="playerType Specifies the type of player. This property can have one of the following values: &quot;StandAlone&quot; for the stand-alone Flash Player &quot;External&quot; for the external Flash Player or in test mode &quot;PlugIn&quot; for the Flash Player browser plug-in &quot;ActiveX&quot; for the Flash Player ActiveX control used by Microsoft Internet Explorer The server string is PT."/>
<page href="flash/system/Capabilities.html#screenColor" title="Capabilities.screenColor" text="screenColor Specifies the screen color. This property can have the value &quot;color&quot;, &quot;gray&quot; (for grayscale), or &quot;bw&quot; (for black and white). The server string is COL."/>
<page href="flash/system/Capabilities.html#screenDPI" title="Capabilities.screenDPI" text="screenDPI Specifies the dots-per-inch (dpi) resolution of the screen, in pixels. The server string is DP."/>
<page href="flash/system/Capabilities.html#screenResolutionX" title="Capabilities.screenResolutionX" text="screenResolutionX Specifies the maximum horizontal resolution of the screen. The server string is R (which returns both the width and height of the screen)."/>
<page href="flash/system/Capabilities.html#screenResolutionY" title="Capabilities.screenResolutionY" text="screenResolutionY Specifies the maximum vertical resolution of the screen. The server string is R (which returns both the width and height of the screen)."/>
<page href="flash/system/Capabilities.html#serverString" title="Capabilities.serverString" text="serverString A URL-encoded string that specifies values for each Capabilities property. The following example shows a URL-encoded string: A=t&amp;SA=t&amp;SV=t&amp;EV=t&amp;MP3=t&amp;AE=t&amp;VE=t&amp;ACC=f&amp;PR=t&amp;SP=t&amp; SB=f&amp;DEB=t&amp;V=WIN%208%2C5%2C0%2C208&amp;M=Adobe%20Windows&amp; R=1600x1200&amp;DP=72&amp;COL=color&amp;AR=1.0&amp;OS=Windows%20XP&amp; L=en&amp;PT=External&amp;AVD=f&amp;LFD=f&amp;WD=f"/>
<page href="flash/system/Capabilities.html#version" title="Capabilities.version" text="version Specifies the Flash Player platform and version information. The format of the version number is: platform majorVersion, minorVersion, buildNumber, internalBuildNumber. Possible values for platform are &quot;WIN&quot;, &quot;MAC&quot;, and &quot;UNIX&quot;. Here are some examples of version information: WIN 9,0,0,0 // Flash Player 9 for Windows MAC 7,0,25,0 // Flash Player 7 for Macintosh UNIX 5,0,55,0 // Flash Player 5 for UNIX The server string is V."/>
<page href="flash/system/LoaderContext.html" title="LoaderContext class" text="LoaderContext The LoaderContext class provides options for loading SWF files and other media by using the Loader class. The LoaderContext class is used as the context parameter in the load() and loadBytes() methods of the Loader class. When loading SWF files with the Loader.load() method, you have two decisions to make: into which security domain the loaded SWF file should be placed, and into which application domain within that security domain? For more details on these choices, see the applicationDomain and securityDomain properties. When loading a SWF file with the Loader.loadBytes() method, you have the same application domain choice to make as for Loader.load(), but it's not necessary to specify a security domain, because Loader.loadBytes() always places its loaded SWF file into the security domain of the loading SWF file. When loading images (JPEG, GIF, or PNG) instead of SWF files, there is no need to specify a SecurityDomain or an application domain, because those concepts are meaningful only for SWF files. Instead, you have only one decision to make: do you need programmatic access to the pixels of the loaded image? If so, see the checkPolicyFile property."/>
<page href="flash/system/LoaderContext.html#LoaderContext()" title="LoaderContext.LoaderContext()" text="LoaderContext Creates a new LoaderContext object, with the specified settings. For complete details on these settings, see the descriptions of the properties of this class. checkPolicyFile applicationDomain securityDomain Specifies whether Flash Player should check for the existence of a cross-domain policy file before loading the object. Specifies the ApplicationDomain object to use for a Loader object. Specifies the SecurityDomain object to use for a Loader object."/>
<page href="flash/system/LoaderContext.html#applicationDomain" title="LoaderContext.applicationDomain" text="applicationDomain Specifies the application domain to use for the Loader.load() or Loader.loadBytes() method. Use this property only when loading a SWF file written in ActionScript 3.0 (not an image or a SWF file written in ActionScript 1.0 or ActionScript 2.0). Every security domain is divided into one or more application domains, represented by ApplicationDomain objects. Application domains are not for security purposes; they are for managing cooperating units of ActionScript code. If you are loading a SWF file from another domain, and allowing it to be placed in a separate security domain, then you cannot control the choice of application domain into which the loaded SWF file is placed; and if you have specified a choice of application domain, it will be ignored. However, if you are loading a SWF file into your own security domain — either because the SWF file comes from your own domain, or because you are importing it into your security domain — then you can control the choice of application domain for the loaded SWF file. You can pass an application domain only from your own security domain in LoaderContext.applicationDomain. Attempting to pass an application domain from any other security domain results in a SecurityError exception. You have four choices for what kind of ApplicationDomain property to use: Child of loader's ApplicationDomain. The default. You can explicitly represent this choice with the syntax new ApplicationDomain(ApplicationDomain.currentDomain). This allows the loaded SWF file to use the parent's classes directly, for example by writing new MyClassDefinedInParent(). The parent, however, cannot use this syntax; if the parent wishes to use the child's classes, it must call ApplicationDomain.getDefinition() to retrieve them. The advantage of this choice is that, if the child defines a class with the same name as a class already defined by the parent, no error results; the child simply inherits the parent's definition of that class, and the child's conflicting definition goes unused unless either child or parent calls the ApplicationDomain.getDefinition() method to retrieve it. Loader's own ApplicationDomain. You use this application domain when using ApplicationDomain.currentDomain. When the load is complete, parent and child can use each other's classes directly. If the child attempts to define a class with the same name as a class already defined by the parent, the parent class is used and the child class is ignored. Child of the system ApplicationDomain. You use this application domain when using new ApplicationDomain(null). This separates loader and loadee entirely, allowing them to define separate versions of classes with the same name without conflict or overshadowing. The only way either side sees the other's classes is by calling the ApplicationDomain.getDefinition() method. Child of some other ApplicationDomain. Occasionally you may have a more complex ApplicationDomain hierarchy. You can load a SWF file into any ApplicationDomain from your own SecurityDomain. For example, new ApplicationDomain(ApplicationDomain.currentDomain.parentDomain.parentDomain) loads a SWF file into a new child of the current domain's parent's parent. When a load is complete, either side (loading or loaded) may need to find its own ApplicationDomain, or the other side's ApplicationDomain, for the purpose of calling ApplicationDomain.getDefinition(). Either side can retrieve a reference to its own application domain by using ApplicationDomain.currentDomain. The loading SWF file can retrieve a reference to the loaded SWF file's ApplicationDomain via Loader.contentLoaderInfo.applicationDomain. If the loaded SWF file knows how it was loaded, it can find its way to the loading SWF file's ApplicationDomain object. For example, if the child was loaded in the default way, it can find the loading SWF file's application domain by using ApplicationDomain.currentDomain.parentDomain. For more information, see the &quot;ApplicationDomain class&quot; section of the &quot;Client System Environment&quot; chapter of Programming ActionScript 3.0."/>
<page href="flash/system/LoaderContext.html#checkPolicyFile" title="LoaderContext.checkPolicyFile" text="checkPolicyFile Specifies whether Flash Player should attempt to download a cross-domain policy file from the loaded object's server before beginning to load the object itself. This flag is applicable to the Loader.load() method, but not to the Loader.loadBytes() method. Set this flag to true when you are loading an image (JPEG, GIF, or PNG) from outside the calling SWF file's own domain, and you expect to need access to the content of that image from ActionScript. Examples of accessing image content include referencing the Loader.content property to obtain a Bitmap object, and calling the BitmapData.draw() method to obtain a copy of the loaded image's pixels. If you attempt one of these operations without having specified checkPolicyFile at loading time, you may get a SecurityError exception because the needed policy file has not been downloaded yet. When you call the Loader.load() method with LoaderContext.checkPolicyFile set to true, Flash Player does not begin downloading the specified object in URLRequest.url until it has either successfully downloaded a relevant cross-domain policy file or discovered that no such policy file exists. Flash Player first considers policy files that have already been downloaded, then attempts to download any pending policy files specified in calls to the Security.loadPolicyFile() method, then attempts to download a policy file from the default location that corresponds to URLRequest.url, which is /crossdomain.xml on the same server as URLRequest.url. In all cases, Flash Player requires that the given policy file exist on its server, that it provide access to the object at URLRequest.url by virtue of the policy file's location, and that it permit access by the domain of the calling SWF file by virtue of one or more &lt;allow-access-from&gt; tags. If you set checkPolicyFile to true, Flash Player waits until policy file completion to begin the main download that you specify in the Loader.load() method. Therefore, as long as the policy file that you need exists, as soon as you have received any ProgressEvent.PROGRESS or Event.COMPLETE events from the contentLoaderInfo property of your Loader object, the policy file download is complete, and you can safely begin performing operations that require the policy file. If you set checkPolicyFile to true, and no relevant policy file is found, you will not receive any error indication until you attempt an operation that throws a SecurityError exception. However, once the LoaderInfo object dispatches a ProgressEvent.PROGRESS or Event.COMPLETE event, you can test whether a relevant policy file was found by checking the value of the LoaderInfo.childAllowsParent property. If you will not need pixel-level access to the image that you are loading, you should not set the checkPolicyFile property to true. Checking for a policy file in this case is wasteful, because it may delay the start of your download, and it may consume network bandwidth unnecessarily. Also try to avoid setting checkPolicyFile to true if you are using the Loader.load() method to download a SWF file. This is because SWF-to-SWF permissions are not controlled by policy files, but rather by the Security.allowDomain() method, and thus checkPolicyFile has no effect when you load a SWF file. Checking for a policy file in this case is wasteful, because it may delay the download of the SWF file, and it may consume network bandwidth unnecessarily. (Flash Player cannot tell whether your main download will be a SWF file or an image, because the policy file download occurs before the main download.) Be careful with checkPolicyFile if you are downloading an object from a URL that may use server-side HTTP redirects. Flash Player always attempts to retrieve policy files that correspond to the initial URL that you specify in URLRequest.url. If the final object comes from a different URL because of HTTP redirects, then the initially downloaded policy files might not be applicable to the object's final URL, which is the URL that matters in security decisions. If you find yourself in this situation, you can examine the value of LoaderInfo.url after you have received a ProgressEvent.PROGRESS or Event.COMPLETE event, which tells you the object's final URL. Then call the Security.loadPolicyFile() method with a policy file URL based on the object's final URL. Then poll the value of LoaderInfo.childAllowsParent until it becomes true."/>
<page href="flash/system/LoaderContext.html#securityDomain" title="LoaderContext.securityDomain" text="securityDomain Specifies the security domain to use for a Loader.load() operation. Use this property only when loading a SWF file (not an image). The choice of security domain is meaningful only if you are loading a SWF file that might come from a different domain (a different server) than the loading SWF file. When you load a SWF file from your own domain, it is always placed into your security domain. But when you load a SWF file from a different domain, you have two options. You can allow the loaded SWF file to be placed in its &quot;natural&quot; security domain, which is different from that of the loading SWF file; this is the default. The other option is to specify that you want to place the loaded SWF file placed into the same security domain as the loading SWF file, by setting myLoaderContext.securityDomain to be equal to SecurityDomain.currentDomain. This is called import loading, and it is equivalent, for security purposes, to copying the loaded SWF file to your own server and loading it from there. In order for import loading to succeed, the loaded SWF file's server must have a policy file trusting the domain of the loading SWF file. You can pass your own security domain only in LoaderContext.securityDomain. Attempting to pass any other security domain results in a SecurityError exception. For more information, see the &quot;Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/system/SecurityDomain.html" title="SecurityDomain class" text="SecurityDomain The SecurityDomain class represents the current security &quot;sandbox,&quot; also known as a security domain. By passing an instance of this class to Loader.load(), you can request that loaded media be placed in a particular sandbox."/>
<page href="flash/system/SecurityDomain.html#currentDomain" title="SecurityDomain.currentDomain" text="currentDomain Gets the current security domain."/>
<page href="flash/display/InterpolationMethod.html" title="InterpolationMethod class" text="InterpolationMethod The InterpolationMethod class provides values for the interpolationMethod parameter in the Graphics.beginGradientFill() and Graphics.lineGradientStyle() methods. This parameter determines the RGB space that Flash Player uses when rendering the gradient."/>
<page href="flash/display/InterpolationMethod.html#LINEAR_RGB" title="InterpolationMethod.LINEAR_RGB" text="LINEAR_RGB Specifies that the linear RGB interpolation method should be used. This means that Flash Player uses an RGB color space based on a linear RGB color model."/>
<page href="flash/display/InterpolationMethod.html#RGB" title="InterpolationMethod.RGB" text="RGB Specifies that the RGB interpolation method should be used. This means that Flash Player uses the exponential sRGB (standard RGB) space when rendering the gradient. The sRGB space is a W3C-endorsed standard that defines a non-linear conversion between red, green, and blue component values and the actual intensity of the visible component color. For example, consider a simple linear gradient between two colors (with the spreadMethod parameter set to SpreadMethod.REFLECT). The different interpolation methods affect the appearance as follows: InterpolationMethod.LINEAR_RGB InterpolationMethod.RGB"/>
<page href="flash/display/Bitmap.html" title="Bitmap class" text="Bitmap The Bitmap class represents display objects that represent bitmap images. These can be images that you load with the flash.display.Loader class, or they can be images that you create with the Bitmap() constructor. The Bitmap() constructor allows you to create a Bitmap object that contains a reference to a BitmapData object. After you create a Bitmap object, use the addChild() or addChildAt() method of the parent DisplayObjectContainer instance to place the bitmap on the display list. A Bitmap object can share its BitmapData reference among several Bitmap objects, independent of translation or rotation properties. Because you can create multiple Bitmap objects that reference the same BitmapData object, multiple display objects can use the same complex BitmapData object without incurring the memory overhead of a BitmapData object for each display object instance. A BitmapData object can be drawn to the screen by a Bitmap object in one of two ways: by using the vector renderer as a fill-bitmap shape, or by using a faster pixel-copying routine. The pixel-copying routine is substantially faster than the vector renderer, but the Bitmap object must meet certain conditions to use it: No stretching, rotation, or skewing can be applied to the Bitmap object. No color transform can be applied to the Bitmap object. No blend mode can be applied to the Bitmap object. No clipping can be done through mask layers or setMask() methods. The image itself cannot be a mask. The destination coordinates must be on a whole pixel boundary. If you load a Bitmap object from a domain other than that of the Loader object used to load the image, and there is no cross-domain policy file that permits access to the domain of the Loader object, then a script in that domain cannot access the Bitmap object or its properties and methods. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper Note: The Bitmap class is not a subclass of the InteractiveObject class, so it cannot dispatch mouse events. However, you can use the addEventListener() method of the display object container that contains the Bitmap object."/>
<page href="flash/display/Bitmap.html#Bitmap()" title="Bitmap.Bitmap()" text="Bitmap Initializes a Bitmap object to refer to the specified BitmapData object. bitmapData pixelSnapping smoothing The BitmapData object being referenced. Whether or not the Bitmap object is snapped to the nearest pixel. Whether or not the bitmap is smoothed when scaled. For example, the following examples show the same bitmap scaled by a factor of 3, with smoothing set to false (left) and true (right):"/>
<page href="flash/display/Bitmap.html#bitmapData" title="Bitmap.bitmapData" text="bitmapData The BitmapData object being referenced."/>
<page href="flash/display/Bitmap.html#pixelSnapping" title="Bitmap.pixelSnapping" text="pixelSnapping Controls whether or not the Bitmap object is snapped to the nearest pixel. The PixelSnapping class includes possible values: PixelSnapping.NEVER—No pixel snapping occurs. PixelSnapping.ALWAYS—The image is always snapped to the nearest pixel, independent of transformation. PixelSnapping.AUTO—The image is snapped to the nearest pixel if it is drawn with no rotation or skew and it is drawn at a scale factor of 99.9% to 100.1%. If these conditions are satisfied, the bitmap image is drawn at 100% scale, snapped to the nearest pixel. Internally, this value allows the image to be drawn as fast as possible using the vector renderer."/>
<page href="flash/display/Bitmap.html#smoothing" title="Bitmap.smoothing" text="smoothing Controls whether or not the bitmap is smoothed when scaled. If true, the bitmap is smoothed when scaled. If false, the bitmap is not smoothed when scaled."/>
<page href="flash/display/Graphics.html" title="Graphics class" text="Graphics The Graphics class contains a set of methods that you can use to create a vector shape. Display objects that support drawing include Sprite and Shape objects. Each of these classes includes a graphics property that is a Graphics object. The following are among those helper functions provided for ease of use: drawRect(), drawRoundRect(), drawCircle(), and drawEllipse(). You cannot create a Graphics object directly from ActionScript code. If you call new Graphics(), an exception is thrown. The Graphics class is final; it cannot be subclassed."/>
<page href="flash/display/Graphics.html#beginBitmapFill()" title="Graphics.beginBitmapFill()" text="beginBitmapFill Fills a drawing area with a bitmap image. The bitmap can be repeated or tiled to fill the area. The fill remains in effect until you call the beginFill(), beginBitmapFill(), or beginGradientFill() method. Calling the clear() method clears the fill. Flash Player does not render the fill until the endFill() method is called. bitmap matrix repeat smooth A transparent or opaque bitmap image that contains the bits to be displayed. A matrix object (of the flash.geom.Matrix class), which you can use to define transformations on the bitmap. For instance, you can use the following matrix to rotate a bitmap by 45 degrees (pi/4 radians): matrix = new flash.geom.Matrix(); matrix.rotate(Math.PI/4); If true, the bitmap image repeats in a tiled pattern. If false, the bitmap image does not repeat, and the edges of the bitmap are used for any fill area that extends beyond the bitmap. For example, consider the following bitmap (a 20 x 20-pixel checkerboard pattern): When repeat is set to true (as in the following example), the bitmap fill repeats the bitmap: When repeat is set to false, the bitmap fill uses the edge pixels for the fill area outside of the bitmap: If false, upscaled bitmap images are rendered by using a nearest-neighbor algorithm and look pixelated. If true, upscaled bitmap images are rendered by using a bilinear algorithm. Rendering by using the nearest neighbor algorithm is usually faster. The following example uses an image (image1.jpg) that is rotated and repeated to fill in a rectangle. The image file (image1.jpg) is loaded using the Loader and URLRequest objects. Here the file is in the same directory as the SWF file. The SWF file needs to be compiled with Local Playback Security set to Access Local Files Only. When the image is loaded (Event is complete), the drawImage() method is called. The ioErrorHandler() method writes a trace comment if the image was not loaded properly. In drawImage() method, a BitmapData object is instantiated and its width and height are set to the image (image1.jpg). Then the source image is drawn into the BitmapData object. Next, a rectangle is drawn in the mySprite Sprite object and the BitmapData object is used to fill it. Using a Matrix object, the beginBitmapFill() method rotates the image 45 degrees, then it begins filling the rectangle with the image until it is finished. package { import flash.display.Sprite; import flash.display.BitmapData; import flash.display.Loader; import flash.net.URLRequest; import flash.events.Event; import flash.events.IOErrorEvent; import flash.geom.Matrix; public class Graphics_beginBitmapFillExample extends Sprite { private var url:String = &quot;image1.jpg&quot;; private var loader:Loader = new Loader(); public function Graphics_beginBitmapFillExample() { var request:URLRequest = new URLRequest(url); loader.load(request); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, drawImage); loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); } private function drawImage(event:Event):void { var mySprite:Sprite = new Sprite(); var myBitmap:BitmapData = new BitmapData(loader.width, loader.height, false); myBitmap.draw(loader, new Matrix()); var matrix:Matrix = new Matrix(); matrix.rotate(Math.PI/4); mySprite.graphics.beginBitmapFill(myBitmap, matrix, true); mySprite.graphics.drawRect(100, 50, 200, 90); mySprite.graphics.endFill(); addChild(mySprite); } private function ioErrorHandler(event:IOErrorEvent):void { trace(&quot;Unable to load image: &quot; + url); } } }"/>
<page href="flash/display/Graphics.html#beginFill()" title="Graphics.beginFill()" text="beginFill Specifies a simple one-color fill that Flash Player uses for subsequent calls to other Graphics methods (such as lineTo() or drawCircle()) for the object. The fill remains in effect until you call the beginFill(), beginBitmapFill(), or beginGradientFill() method. Calling the clear() method clears the fill. Flash Player does not render the fill until the endFill() method is called. color alpha The color of the fill (0xRRGGBB). The alpha value of the fill (0.0 to 1.0). Please see the example at the end of this class for an illustration of how to use this method."/>
<page href="flash/display/Graphics.html#beginGradientFill()" title="Graphics.beginGradientFill()" text="beginGradientFill Specifies a gradient fill that Flash Player uses for subsequent calls to other Graphics methods (such as lineTo() or drawCircle()) for the object. The fill remains in effect until you call the beginFill(), beginBitmapFill(), or beginGradientFill() method. Calling the clear() method clears the fill. Flash Player does not render the fill until the endFill() method is called. type colors alphas ratios matrix spreadMethod interpolationMethod focalPointRatio A value from the GradientType class that specifies which gradient type to use: GradientType.LINEAR or GradientType.RADIAL. An array of RGB hexadecimal color values to be used in the gradient; for example, red is 0xFF0000, blue is 0x0000FF, and so on. You can specify up to 15 colors. For each color, be sure you specify a corresponding value in the alphas and ratios parameters. An array of alpha values for the corresponding colors in the colors array; valid values are 0 to 1. If the value is less than 0, the default is 0. If the value is greater than 1, the default is 1. An array of color distribution ratios; valid values are 0 to 255. This value defines the percentage of the width where the color is sampled at 100%. The value 0 represents the left-hand position in the gradient box, and 255 represents the right-hand position in the gradient box. Note: This value represents positions in the gradient box, not the coordinate space of the final gradient, which might be wider or thinner than the gradient box. Specify a value for each value in the colors parameter. For example, for a linear gradient that includes two colors, blue and green, the following example illustrates the placement of the colors in the gradient based on different values in the ratios array: ratios Gradient [0, 127] [0, 255] [127, 255] The values in the array must increase sequentially; for example, [0, 63, 127, 190, 255]. A transformation matrix as defined by the flash.geom.Matrix class. The flash.geom.Matrix class includes a createGradientBox() method, which lets you conveniently set up the matrix for use with the beginGradientFill() method. A value from the SpreadMethod class that specifies which spread method to use, either: SpreadMethod.PAD, SpreadMethod.REFLECT, or SpreadMethod.REPEAT. For example, consider a simple linear gradient between two colors: import flash.geom.* import flash.display.* var fillType:String = GradientType.LINEAR; var colors:Array = [0xFF0000, 0x0000FF]; var alphas:Array = [1, 1]; var ratios:Array = [0x00, 0xFF]; var matr:Matrix = new Matrix(); matr.createGradientBox(20, 20, 0, 0, 0); var spreadMethod:String = SpreadMethod.PAD; this.graphics.beginGradientFill(fillType, colors, alphas, ratios, matr, spreadMethod); this.graphics.drawRect(0,0,100,100); This example uses SpreadMethod.PAD for the spread method, and the gradient fill looks like the following: If you use SpreadMethod.REFLECT for the spread method, the gradient fill looks like the following: If you use SpreadMethod.REPEAT for the spread method, the gradient fill looks like the following: A value from the InterpolationMethod class that specifies which value to use: InterpolationMethod.linearRGB or InterpolationMethod.RGB For example, consider a simple linear gradient between two colors (with the spreadMethod parameter set to SpreadMethod.REFLECT). The different interpolation methods affect the appearance as follows: InterpolationMethod.LINEAR_RGB InterpolationMethod.RGB A number that controls the location of the focal point of the gradient. 0 means that the focal point is in the center. 1 means that the focal point is at one border of the gradient circle. -1 means that the focal point is at the other border of the gradient circle. A value less than -1 or greater than 1 is rounded to -1 or 1. For example, the following example shows a focalPointRatio set to 0.75: If the type parameter is not valid."/>
<page href="flash/display/Graphics.html#clear()" title="Graphics.clear()" text="clear Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings."/>
<page href="flash/display/Graphics.html#curveTo()" title="Graphics.curveTo()" text="curveTo Draws a curve using the current line style from the current drawing position to (anchorX, anchorY) and using the control point that (controlX, controlY) specifies. The current drawing position is then set to (anchorX, anchorY). If the movie clip in which you are drawing contains content created with the Flash drawing tools, calls to the curveTo() method are drawn underneath this content. If you call the curveTo() method before any calls to the moveTo() method, the default of the current drawing position is (0, 0). If any of the parameters are missing, this method fails and the current drawing position is not changed. The curve drawn is a quadratic Bezier curve. Quadratic Bezier curves consist of two anchor points and one control point. The curve interpolates the two anchor points and curves toward the control point. controlX controlY anchorX anchorY A number that specifies the horizontal position of the control point relative to the registration point of the parent display object. A number that specifies the vertical position of the control point relative to the registration point of the parent display object. A number that specifies the horizontal position of the next anchor point relative to the registration point of the parent display object. A number that specifies the vertical position of the next anchor point relative to the registration point of the parent display object. The following example draws a green circular object with a width and height of 100 pixels, 250 pixels to the right from the registration point (0, 0) of Sprite display object. Draw four curves to produce a circle and fill it green. Note that due to the nature of the quadratic Bezier equation, this is not a perfect circle. The best way to draw a circle is to use the Graphics class's drawCircle() method. package { import flash.display.Sprite; import flash.display.Shape; public class Graphics_curveToExample1 extends Sprite { public function Graphics_curveToExample1():void { var roundObject:Shape = new Shape(); roundObject.graphics.beginFill(0x00FF00); roundObject.graphics.moveTo(250, 0); roundObject.graphics.curveTo(300, 0, 300, 50); roundObject.graphics.curveTo(300, 100, 250, 100); roundObject.graphics.curveTo(200, 100, 200, 50); roundObject.graphics.curveTo(200, 0, 250, 0); roundObject.graphics.endFill(); this.addChild(roundObject); } } }"/>
<page href="flash/display/Graphics.html#drawCircle()" title="Graphics.drawCircle()" text="drawCircle Draws a circle. You must set the line style, fill, or both before you call the drawCircle() method, by calling the linestyle(), lineGradientStyle(), beginFill(), beginGradientFill(), or beginBitmapFill() method. x y radius The x location of the center of the circle relative to the registration point of the parent display object (in pixels). The y location of the center of the circle relative to the registration point of the parent display object (in pixels). The radius of the circle (in pixels). Please see the example at the end of this class for an illustration of how to use this method."/>
<page href="flash/display/Graphics.html#drawEllipse()" title="Graphics.drawEllipse()" text="drawEllipse Draws an ellipse. You must set the line style, fill, or both before you call the drawEllipse() method, by calling the linestyle(), lineGradientStyle(), beginFill(), beginGradientFill(), or beginBitmapFill() method. x y width height The x location of the center of the ellipse relative to the registration point of the parent display object (in pixels). The y location of the center of the ellipse relative to the registration point of the parent display object (in pixels). The width of the ellipse (in pixels). The height of the ellipse (in pixels). The following example uses the function drawEgg() to draw three different sized eggs (three sizes of ellipses), depending on the eggSize parameter. The constructor calls the function drawEgg() and passes the horizontal and vertical parameters for where the egg should be drawn, plus the type of egg (eggSize). (The height and width of the eggs (the ellipses) can be used to decide where to display them.) Function drawEgg() draws the different size ellipses and fills them white using beginFill() method. There is no advance error handling written for his function. package { import flash.display.Sprite; import flash.display.Shape; public class Graphics_drawEllipseExample extends Sprite { public static const SMALL:uint = 0; public static const MEDIUM:uint = 1; public static const LARGE:uint = 2; public function Graphics_drawEllipseExample() { drawEgg(SMALL, 0, 100); drawEgg(MEDIUM, 100, 60); drawEgg(LARGE, 250, 35); } public function drawEgg(eggSize:uint, x:Number, y:Number):void { var myEgg:Shape = new Shape(); myEgg.graphics.beginFill(0xFFFFFF); myEgg.graphics.lineStyle(1); switch(eggSize) { case SMALL: myEgg.graphics.drawEllipse(x, y, 60, 70); break; case MEDIUM: myEgg.graphics.drawEllipse(x, y, 120, 150); break; case LARGE: myEgg.graphics.drawEllipse(x, y, 150, 200); break; default: trace (&quot;Wrong size! There is no egg.&quot;); break; } myEgg.graphics.endFill(); this.addChild(myEgg); } } }"/>
<page href="flash/display/Graphics.html#drawRect()" title="Graphics.drawRect()" text="drawRect Draws a rectangle. You must set the line style, fill, or both before you call the drawRect() method, by calling the linestyle(), lineGradientStyle(), beginFill(), beginGradientFill(), or beginBitmapFill() method. x y width height A number indicating the horizontal position relative to the registration point of the parent display object (in pixels). A number indicating the vertical position relative to the registration point of the parent display object (in pixels). The width of the rectangle (in pixels). The height of the rectangle (in pixels). Please see the example at the end of this class for an illustration of how to use this method. If the width or height parameters are not a number (Number.NaN)."/>
<page href="flash/display/Graphics.html#drawRoundRect()" title="Graphics.drawRoundRect()" text="drawRoundRect Draws a rounded rectangle. You must set the line style, fill, or both before you call the drawRoundRect() method, by calling the linestyle(), lineGradientStyle(), beginFill(), beginGradientFill(), or beginBitmapFill() method. x y width height ellipseWidth ellipseHeight A number indicating the horizontal position relative to the registration point of the parent display object (in pixels). A number indicating the vertical position relative to the registration point of the parent display object (in pixels). The width of the round rectangle (in pixels). The height of the round rectangle (in pixels). The width of the ellipse used to draw the rounded corners (in pixels). The height of the ellipse used to draw the rounded corners (in pixels). Optional; if no value is specified, the default value matches that provided for the ellipseWidth parameter. Please see the example at the end of this class for an illustration of how to use this method. If the width, height, ellipseWidth or ellipseHeight parameters are not a number (Number.NaN)."/>
<page href="flash/display/Graphics.html#endFill()" title="Graphics.endFill()" text="endFill Applies a fill to the lines and curves that were added since the last call to the beginFill(), beginGradientFill(), or beginBitmapFill() method. Flash uses the fill that was specified in the previous call to the beginFill(), beginGradientFill(), or beginBitmapFill() method. 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."/>
<page href="flash/display/Graphics.html#lineGradientStyle()" title="Graphics.lineGradientStyle()" text="lineGradientStyle Specifies a gradient for the line style that Flash Player uses for subsequent calls to other Graphics methods (such as lineTo() or drawCircle()) for the object. The line style remains in effect until you call the lineStyle() method or the lineGradientStyle() method with different parameters. You can call the lineGradientStyle() method in the middle of drawing a path to specify different styles for different line segments within a path. Call lineStyle() before you call lineGradientStyle() to enable a stroke, otherwise the value of the line style remains undefined. Calls to clear() set the line style back to undefined. type colors alphas ratios matrix spreadMethod interpolationMethod focalPointRatio A value from the GradientType class that specifies which gradient type to use, either GradientType.LINEAR or GradientType.RADIAL. An array of RGB hex color values to be used in the gradient (for example, red is 0xFF0000, blue is 0x0000FF, and so on). An array of alpha values for the corresponding colors in the colors array; valid values are 0 to 100. If the value is less than 0, Flash Player uses 0. If the value is greater than 100, Flash Player uses 100. An array of color distribution ratios; valid values are from 0 to 255. This value defines the percentage of the width where the color is sampled at 100%. The value 0 represents the left-hand position in the gradient box, and 255 represents the right-hand position in the gradient box. This value represents positions in the gradient box, not the coordinate space of the final gradient, which might be wider or thinner than the gradient box. Specify a value for each value in the colors parameter. For example, for a linear gradient that includes two colors, blue and green, the following figure illustrates the placement of the colors in the gradient based on different values in the ratios array: ratios Gradient [0, 127] [0, 255] [127, 255] The values in the array must increase, sequentially; for example, [0, 63, 127, 190, 255]. A transformation matrix as defined by the flash.geom.Matrix class. The flash.geom.Matrix class includes a createGradientBox() method, which lets you conveniently set up the matrix for use with the lineGradientStyle() method. A value from the SpreadMethod class that specifies which spread method to use: SpreadMethod.PAD SpreadMethod.REFLECT SpreadMethod.REPEAT A value from the InterpolationMethod class that specifies which value to use. For example, consider a simple linear gradient between two colors (with the spreadMethod parameter set to SpreadMethod.REFLECT). The different interpolation methods affect the appearance as follows: InterpolationMethod.LINEAR_RGB InterpolationMethod.RGB A number that controls the location of the focal point of the gradient. The value 0 means the focal point is in the center. The value 1 means the focal point is at one border of the gradient circle. The value -1 means that the focal point is at the other border of the gradient circle. Values less than -1 or greater than 1 are rounded to -1 or 1. The following image shows a gradient with a focalPointRatio of -0.75: The following example draws a rectangle and a circle that use a gradient stroke from red to green to blue. The method createGradientBox() from the Matrix class is used to define the gradient box to 200 width and 40 height. The thickness of line is set to 5 pixels. Thickness of the stroke must be defined for lineGradientStyle() method. The gradient is set to linear. Colors for the gradient are set to red, green, and blue. Transparency (alpha value) for the colors is set to 1 (opaque). The distribution of gradient is even, where the colors are sampled at 100% at 0 (left-hand position in the gradient box), 128 (middle in the box) and 255 (right-hand position in the box). The width of the rectangle encompasses all the spectrum of the gradient, while the circle encompasses 50% from the middle of the spectrum. package { import flash.display.Sprite; import flash.display.Shape; import flash.geom.Matrix; import flash.display.GradientType; public class Graphics_lineGradientStyleExample extends Sprite { public function Graphics_lineGradientStyleExample() { var myShape:Shape = new Shape(); var gradientBoxMatrix:Matrix = new Matrix(); gradientBoxMatrix.createGradientBox(200, 40, 0, 0, 0); myShape.graphics.lineStyle(5); myShape.graphics.lineGradientStyle(GradientType.LINEAR, [0xFF0000, 0x00FF00, 0x0000FF], [1, 1, 1], [0, 128, 255], gradientBoxMatrix); myShape.graphics.drawRect(0, 0, 200, 40); myShape.graphics.drawCircle(100, 120, 50); this.addChild(myShape); } } }"/>
<page href="flash/display/Graphics.html#lineStyle()" title="Graphics.lineStyle()" text="lineStyle Specifies a line style that Flash uses for subsequent calls to other Graphics methods (such as lineTo() or drawCircle()) for the object. The line style remains in effect until you call the lineGradientStyle() method or the lineStyle() method with different parameters. You can call lineStyle() in the middle of drawing a path to specify different styles for different line segments within the path. Note: Calls to the clear() method set the line style back to undefined. thickness color alpha pixelHinting scaleMode caps joints miterLimit 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, the default is 0. The value 0 indicates hairline thickness; the maximum thickness is 255. If a value greater than 255 is passed, the default is 255. A hexadecimal color value of the line; for example, red is 0xFF0000, blue is 0x0000FF, and so on. If a value is not indicated, the default is 0x000000 (black). Optional. A number that indicates the alpha value of the color of the line; valid values are 0 to 1. If a value is not indicated, the default is 1 (solid). If the value is less than 0, the default is 0. If the value is greater than 1, the default is 1. A Boolean value that specifies whether to hint strokes to full pixels. This affects both the position of anchors of a curve and the line stroke size itself. With pixelHinting set to true, Flash Player hints line widths to full pixel widths. With pixelHinting set to false, disjoints can appear for curves and straight lines. For example, the following illustrations show how Flash Player renders two rounded rectangles that are identical, except that the pixelHinting parameter used in the lineStyle() method is set differently (the images are scaled by 200%, to emphasize the difference): If a value is not supplied, the line does not use pixel hinting. A value from the LineScaleMode class that specifies which scale mode to use: LineScaleMode.NORMAL—Always scale the line thickness when the object is scaled (the default). LineScaleMode.NONE—Never scale the line thickness. LineScaleMode.VERTICAL—Do not scale the line thickness if the object is scaled vertically only. For example, consider the following circles, drawn with a one-pixel line, and each with the scaleMode parameter set to LineScaleMode.VERTICAL. The circle on the left is scaled vertically only, and the circle on the right is scaled both vertically and horizontally: LineScaleMode.HORIZONTAL—Do not scale the line thickness if the object is scaled horizontally only. For example, consider the following circles, drawn with a one-pixel line, and each with the scaleMode parameter set to LineScaleMode.HORIZONTAL. The circle on the left is scaled horizontally only, and the circle on the right is scaled both vertically and horizontally: A value from the CapsStyle class that specifies the type of caps at the end of lines. Valid values are: CapsStyle.NONE, CapsStyle.ROUND, and CapsStyle.SQUARE. If a value is not indicated, Flash uses round caps. For example, the following illustrations show the different capsStyle settings. For each setting, the illustration shows a blue line with a thickness of 30 (for which the capsStyle applies), and a superimposed black line with a thickness of 1 (for which no capsStyle applies): A value from the JointStyle class that specifies the type of joint appearance used at angles. Valid values are: JointStyle.BEVEL, JointStyle.MITER, and JointStyle.ROUND. If a value is not indicated, Flash uses round joints. For example, the following illustrations show the different joints settings. For each setting, the illustration shows an angled blue line with a thickness of 30 (for which the jointStyle applies), and a superimposed angled black line with a thickness of 1 (for which no jointStyle applies): Note: For joints set to JointStyle.MITER, you can use the miterLimit parameter to limit the length of the miter. A number that indicates the limit at which a miter is cut off. Valid values range from 1 to 255 (and values outside of that range are rounded to 1 or 255). This value is only used if the jointStyle is set to &quot;miter&quot;. The miterLimit value represents the length that a miter can extend beyond the point at which the lines meet to form a joint. The value expresses a factor of the line thickness. For example, with a miterLimit factor of 2.5 and a thickness of 10 pixels, the miter is cut off at 25 pixels. For example, consider the following angled lines, each drawn with a thickness of 20, but with miterLimit set to 1, 2, and 4. Superimposed are black reference lines showing the meeting points of the joints: Notice that a given miterLimit value has a specific maximum angle for which the miter is cut off. The following table lists some examples: miterLimit value: Angles smaller than this are cut off: 1.414 90 degrees 2 60 degrees 4 30 degrees 8 15 degrees Please see the lineTo() or moveTo() method's example for illustrations of how to use the getStyle() method."/>
<page href="flash/display/Graphics.html#lineTo()" title="Graphics.lineTo()" text="lineTo Draws 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 display object in which you are drawing contains content that was created with the Flash drawing tools, calls to the lineTo() method are drawn underneath the content. If you call lineTo() before any calls to the moveTo() method, the default position for the current drawing is (0, 0). If any of the parameters are missing, this method fails and the current drawing position is not changed. x y A number that indicates the horizontal position relative to the registration point of the parent display object (in pixels). A number that indicates the vertical position relative to the registration point of the parent display object (in pixels). The following example draws a trapezoid using lineTo() method, starting at pixels (100, 100). The line thickness is set to 10 pixels, color is gold and opaque, caps at the end of lines is set to none (since all lines are jointed), and the joint between the lines is set to MITER with miter limit set to 10, to have sharp, pointed corners. package { import flash.display.Sprite; import flash.display.LineScaleMode; import flash.display.CapsStyle; import flash.display.JointStyle; import flash.display.Shape; public class Graphics_lineToExample extends Sprite { public function Graphics_lineToExample() { var trapezoid:Shape = new Shape(); trapezoid.graphics.lineStyle(10, 0xFFD700, 1, false, LineScaleMode.VERTICAL, CapsStyle.NONE, JointStyle.MITER, 10); trapezoid.graphics.moveTo(100, 100); trapezoid.graphics.lineTo(120, 50); trapezoid.graphics.lineTo(200, 50); trapezoid.graphics.lineTo(220, 100); trapezoid.graphics.lineTo(100, 100); this.addChild(trapezoid); } } }"/>
<page href="flash/display/Graphics.html#moveTo()" title="Graphics.moveTo()" text="moveTo Moves 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. x y A number that indicates the horizontal position relative to the registration point of the parent display object (in pixels). A number that indicates the vertical position relative to the registration point of the parent display object (in pixels). The following example draws a dashed line of three pixels thickness using moveTo() and lineTo() methods. Using the lineStyle() method, the line thickness is set to 3 pixels. It is also set not to scale. Color is set to red with 25 percent opacity. The CapsStyle property is set to square (the default is round). Since Graphics_moveToExample is an instance of the Sprite class, it has access to all the Graphics class methods. The Graphics class methods can be used to directly draw on the Graphic_moveToExample Sprite object. However, not putting the vector drawing object in a Shape limits the way they can be managed, moved, or changed. package { import flash.display.Sprite; import flash.display.CapsStyle; import flash.display.LineScaleMode; public class Graphics_moveToExample extends Sprite { public function Graphics_moveToExample() { graphics.lineStyle(3, 0x990000, 0.25, false, LineScaleMode.NONE, CapsStyle.SQUARE); graphics.moveTo(10, 20); graphics.lineTo(20, 20); graphics.moveTo(30, 20); graphics.lineTo(50, 20); graphics.moveTo(60, 20); graphics.lineTo(80, 20); graphics.moveTo(90, 20); graphics.lineTo(110, 20); graphics.moveTo(120, 20); graphics.lineTo(130, 20); } } }"/>
<page href="flash/display/StageScaleMode.html" title="StageScaleMode class" text="StageScaleMode The StageScaleMode class provides values for the Stage.scaleMode property."/>
<page href="flash/display/StageScaleMode.html#EXACT_FIT" title="StageScaleMode.EXACT_FIT" text="EXACT_FIT Specifies that the entire Adobe® Flash® application be visible in the specified area without trying to preserve the original aspect ratio. Distortion can occur."/>
<page href="flash/display/StageScaleMode.html#NO_BORDER" title="StageScaleMode.NO_BORDER" text="NO_BORDER Specifies that the entire Flash application fill the specified area, without distortion but possibly with some cropping, while maintaining the original aspect ratio of the application."/>
<page href="flash/display/StageScaleMode.html#NO_SCALE" title="StageScaleMode.NO_SCALE" text="NO_SCALE Specifies that the size of the Flash application be fixed, so that it remains unchanged even as the size of the player window changes. Cropping might occur if the player window is smaller than the content."/>
<page href="flash/display/StageScaleMode.html#SHOW_ALL" title="StageScaleMode.SHOW_ALL" text="SHOW_ALL Specifies that the entire Flash application be visible in the specified area without distortion while maintaining the original aspect ratio of the application. Borders can appear on two sides of the application."/>
<page href="flash/display/MovieClip.html" title="MovieClip class" text="MovieClip The MovieClip class inherits from the following classes: Sprite, DisplayObjectContainer, InteractiveObject, DisplayObject, and EventDispatcher. Unlike the Sprite object, a MovieClip object has a timeline. The 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 in the Flash authoring tool. Children instances placed on the Stage in the Flash authoring tool cannot be accessed by code from within the constructor of a parent instance since they have not been created at that point in code execution. Before accessing the child, the parent must instead either create the child instance by code or delay access to a callback function that listens for the child to dispatch its Event.ADDED_TO_STAGE event. If you modify any of the following properties of a MovieClip object that contains a motion tween, Flash Player stops the playhead in that MovieClip object: alpha, blendMode, filters, height, opaqueBackground, rotation, scaleX, scaleY, scale9Grid, scrollRect, transform, visible, width, x, or y. However, it does not stop the playhead in any child MovieClip objects of that MovieClip object."/>
<page href="flash/display/MovieClip.html#MovieClip()" title="MovieClip.MovieClip()" text="MovieClip Creates a new MovieClip instance. After creating the MovieClip, call the addChild() or addChildAt() method of a display object container that is onstage."/>
<page href="flash/display/MovieClip.html#gotoAndPlay()" title="MovieClip.gotoAndPlay()" text="gotoAndPlay Starts playing the SWF file at the specified frame. This happens after all remaining actions in the frame have finished executing. To specify a scene as well as a frame, specify a value for the scene parameter. frame scene A number representing the frame number, or a string representing the label of the frame, to which the playhead is sent. If you specify a number, it is relative to the scene you specify. If you do not specify a scene, Flash Player uses the current scene to determine the global frame number to play. If you do specify a scene, the playhead jumps to the frame number in the specified scene. The name of the scene to play. This parameter is optional. The following code uses the gotoAndPlay() method to direct the playhead of the mc1 movie clip to advance five frames ahead of its current location: mc1.gotoAndPlay(mc1.currentFrame + 5);"/>
<page href="flash/display/MovieClip.html#gotoAndStop()" title="MovieClip.gotoAndStop()" text="gotoAndStop Brings the playhead to the specified frame of the movie clip and stops it there. This happens after all remaining actions in the frame have finished executing. If you want to specify a scene in addition to a frame, specify a scene parameter. frame scene A number representing the frame number, or a string representing the label of the frame, to which the playhead is sent. If you specify a number, it is relative to the scene you specify. If you do not specify a scene, Flash Player uses the current scene to determine the global frame number at which to go to and stop. If you do specify a scene, the playhead goes to the frame number in the specified scene and stops. The name of the scene. This parameter is optional. The following code uses the gotoAndStop() method and the currentFrame property to direct the playhead of the mc1 movie clip to advance five frames ahead of its current location and stop: mc1.gotoAndStop(mc1.currentFrame + 5); If the scene or frame specified are not found in this movie clip."/>
<page href="flash/display/MovieClip.html#nextFrame()" title="MovieClip.nextFrame()" text="nextFrame Sends the playhead to the next frame and stops it. This happens after all remaining actions in the frame have finished executing. In the following example, two SimpleButton objects control the timeline. The prev button moves the playhead to the previous frame, and the nextBtn button moves the playhead to the next frame: import flash.events.MouseEvent; mc1.stop(); prevBtn.addEventListener(MouseEvent.CLICK, goBack); nextBtn.addEventListener(MouseEvent.CLICK, goForward); function goBack(event:MouseEvent):void { mc1.prevFrame(); } function goForward(event:MouseEvent):void { mc1.nextFrame(); }"/>
<page href="flash/display/MovieClip.html#nextScene()" title="MovieClip.nextScene()" text="nextScene Moves the playhead to the next scene of the MovieClip instance. This happens after all remaining actions in the frame have finished executing. In the following example, two SimpleButton objects control the timeline. The prevBtn button moves the playhead to the previous scene, and the nextBtn button moves the playhead to the next scene: import flash.events.MouseEvent; mc1.stop(); prevBtn.addEventListener(MouseEvent.CLICK, goBack); nextBtn.addEventListener(MouseEvent.CLICK, goForward); function goBack(event:MouseEvent):void { mc1.prevScene(); } function goForward(event:MouseEvent):void { mc1.nextScene(); }"/>
<page href="flash/display/MovieClip.html#play()" title="MovieClip.play()" text="play Moves the playhead in the timeline of the movie clip. The following code uses the stop() method to stop a movie clip named mc1 and to resume playing when the user clicks the text field named continueText: import flash.text.TextField; import flash.events.MouseEvent; var continueText:TextField = new TextField(); continueText.text = &quot;Play movie...&quot;; addChild(continueText); mc1.stop(); continueText.addEventListener(MouseEvent.CLICK, resumeMovie); function resumeMovie(event:MouseEvent):void { mc1.play(); }"/>
<page href="flash/display/MovieClip.html#prevFrame()" title="MovieClip.prevFrame()" text="prevFrame Sends the playhead to the previous frame and stops it. This happens after all remaining actions in the frame have finished executing. In the following example, two SimpleButton objects control the timeline. The prev button moves the playhead to the previous frame, and the nextBtn button moves the playhead to the next frame: import flash.events.MouseEvent; mc1.stop(); prevBtn.addEventListener(MouseEvent.CLICK, goBack); nextBtn.addEventListener(MouseEvent.CLICK, goForward); function goBack(event:MouseEvent):void { mc1.prevFrame(); } function goForward(event:MouseEvent):void { mc1.nextFrame(); }"/>
<page href="flash/display/MovieClip.html#prevScene()" title="MovieClip.prevScene()" text="prevScene Moves the playhead to the previous scene of the MovieClip instance. This happens after all remaining actions in the frame have finished executing. In the following example, two SimpleButton objects control the timeline. The prevBtn button moves the playhead to the previous scene, and the nextBtn button moves the playhead to the next scene: import flash.events.MouseEvent; mc1.stop(); prevBtn.addEventListener(MouseEvent.CLICK, goBack); nextBtn.addEventListener(MouseEvent.CLICK, goForward); function goBack(event:MouseEvent):void { mc1.prevScene(); } function goForward(event:MouseEvent):void { mc1.nextScene(); }"/>
<page href="flash/display/MovieClip.html#stop()" title="MovieClip.stop()" text="stop Stops the playhead in the movie clip."/>
<page href="flash/display/MovieClip.html#currentFrame" title="MovieClip.currentFrame" text="currentFrame Specifies the number of the frame in which the playhead is located in the timeline of the MovieClip instance. If the movie clip has multiple scenes, this value is the frame number in the current scene. The following code uses the gotoAndStop() method and the currentFrame property to direct the playhead of the mc1 movie clip to advance five frames ahead of its current location and stop: mc1.gotoAndStop(mc1.currentFrame + 5);"/>
<page href="flash/display/MovieClip.html#currentLabel" title="MovieClip.currentLabel" text="currentLabel The current label in which the playhead is located in the timeline of the MovieClip instance. If the current frame has no label, currentLabel is set to the name of the previous frame that includes a label. If the current frame and previous frames do not include a label, currentLabel returns null. The following code illustrates how to access the currentLabel property of a MovieClip object named mc1: trace(mc1.currentLabel);"/>
<page href="flash/display/MovieClip.html#currentLabels" title="MovieClip.currentLabels" text="currentLabels Returns an array of FrameLabel objects from the current scene. If the MovieClip instance does not use scenes, the array includes all frame labels from the entire MovieClip instance. The following code illustrates how to use the currentLabels property of a MovieClip object named mc1: import flash.display.FrameLabel; var labels:Array = mc1.currentLabels; for (var i:uint = 0; i &lt; labels.length; i++) { var label:FrameLabel = labels[i]; trace(&quot;frame &quot; + label.frame + &quot;: &quot; + label.name); }"/>
<page href="flash/display/MovieClip.html#currentScene" title="MovieClip.currentScene" text="currentScene The current scene in which the playhead is located in the timeline of the MovieClip instance. The following code illustrates how to use the currentScene property of a MovieClip object named mc1: import flash.display.Scene; var scene:Scene = mc1.currentScene; trace(scene.name + &quot;: &quot; + scene.numFrames + &quot; frames&quot;);"/>
<page href="flash/display/MovieClip.html#enabled" title="MovieClip.enabled" text="enabled A 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's Over, Down, and Up frames are disabled. The movie clip continues to receive events (for example, mouseDown, mouseUp, keyDown, and keyUp). The enabled property governs only 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. If enabled is set to false, the object is not included in automatic tab ordering. The following code illustrates how to use the enabled property to disable the button-like properties of a MovieClip object named mc1: mc1.enabled = false;"/>
<page href="flash/display/MovieClip.html#framesLoaded" title="MovieClip.framesLoaded" text="framesLoaded The number of frames that are loaded from a streaming SWF file. You can use the frameLoaded property to determine whether the contents of a specific frame and all the frames before it loaded and are available locally in the browser. You can also use it to monitor 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 finishes loading. If the movie clip contains multiple scenes, the framesLoaded property returns the number of frames loaded for all scenes in the movie clip. The following code illustrates how to use the framesLoaded property and the totalFrames property to determine if a streaming MovieClip object named mc1 is fully loaded: if (mc1.framesLoaded == mc1.totalFrames) { trace(&quot;OK.&quot;); }"/>
<page href="flash/display/MovieClip.html#scenes" title="MovieClip.scenes" text="scenes An array of Scene objects, each listing the name, the number of frames, and the frame labels for a scene in the MovieClip instance. The following code illustrates how to use the scenes property of a MovieClip object named mc1: import flash.display.Scene; for (var i:uint = 0; i &lt; mc1.scenes.length; i++) { var scene:Scene = mc1.scenes[i]; trace(&quot;scene &quot; + scene.name + &quot;: &quot; + scene.numFrames + &quot; frames&quot;); }"/>
<page href="flash/display/MovieClip.html#totalFrames" title="MovieClip.totalFrames" text="totalFrames The total number of frames in the MovieClip instance. If the movie clip contains multiple frames, the totalFrames property returns the total number of frames in all scenes in the movie clip. The following code illustrates the use of the totalFrames property of a MovieClip object named mc1: trace(mc1.totalFrames);"/>
<page href="flash/display/MovieClip.html#trackAsMenu" title="MovieClip.trackAsMenu" text="trackAsMenu Indicates whether other display objects that are SimpleButton or MovieClip objects can receive mouse release events. The trackAsMenu property lets you create menus. You can set the trackAsMenu property on any SimpleButton or MovieClip object. The default value of the trackAsMenu property is false. You can change the trackAsMenu property at any time; the modified movie clip immediately uses the new behavior. The following code illustrates how to use the trackAsMenu property to enable mouse release events for a MovieClip object named mc1: mc1.trackAsMenu = true;"/>
<page href="flash/display/StageAlign.html" title="StageAlign class" text="StageAlign The StageAlign class provides constant values to use for the Stage.align property."/>
<page href="flash/display/StageAlign.html#BOTTOM" title="StageAlign.BOTTOM" text="BOTTOM Specifies that the Stage is aligned at the bottom."/>
<page href="flash/display/StageAlign.html#BOTTOM_LEFT" title="StageAlign.BOTTOM_LEFT" text="BOTTOM_LEFT Specifies that the Stage is aligned in the bottom-left corner."/>
<page href="flash/display/StageAlign.html#BOTTOM_RIGHT" title="StageAlign.BOTTOM_RIGHT" text="BOTTOM_RIGHT Specifies that the Stage is aligned in the bottom-right corner."/>
<page href="flash/display/StageAlign.html#LEFT" title="StageAlign.LEFT" text="LEFT Specifies that the Stage is aligned on the left."/>
<page href="flash/display/StageAlign.html#RIGHT" title="StageAlign.RIGHT" text="RIGHT Specifies that the Stage is aligned to the right."/>
<page href="flash/display/StageAlign.html#TOP" title="StageAlign.TOP" text="TOP Specifies that the Stage is aligned at the top."/>
<page href="flash/display/StageAlign.html#TOP_LEFT" title="StageAlign.TOP_LEFT" text="TOP_LEFT Specifies that the Stage is aligned in the top-left corner."/>
<page href="flash/display/StageAlign.html#TOP_RIGHT" title="StageAlign.TOP_RIGHT" text="TOP_RIGHT Specifies that the Stage is aligned in the top-right corner."/>
<page href="flash/display/LineScaleMode.html" title="LineScaleMode class" text="LineScaleMode The LineScaleMode class provides values for the scaleMode parameter in the Graphics.lineStyle() method."/>
<page href="flash/display/LineScaleMode.html#HORIZONTAL" title="LineScaleMode.HORIZONTAL" text="HORIZONTAL With this setting used as the scaleMode parameter of the lineStyle() method, the thickness of the line scales only vertically. For example, consider the following circles, drawn with a one-pixel line, and each with the scaleMode parameter set to LineScaleMode.VERTICAL. The circle on the left is scaled only vertically, and the circle on the right is scaled both vertically and horizontally."/>
<page href="flash/display/LineScaleMode.html#NONE" title="LineScaleMode.NONE" text="NONE With this setting used as the scaleMode parameter of the lineStyle() method, the thickness of the line never scales."/>
<page href="flash/display/LineScaleMode.html#NORMAL" title="LineScaleMode.NORMAL" text="NORMAL With this setting used as the scaleMode parameter of the lineStyle() method, the thickness of the line always scales when the object is scaled (the default)."/>
<page href="flash/display/LineScaleMode.html#VERTICAL" title="LineScaleMode.VERTICAL" text="VERTICAL With this setting used as the scaleMode parameter of the lineStyle() method, the thickness of the line scales only horizontally. For example, consider the following circles, drawn with a one-pixel line, and each with the scaleMode parameter set to LineScaleMode.HORIZONTAL. The circle on the left is scaled only horizontally, and the circle on the right is scaled both vertically and horizontally."/>
<page href="flash/display/DisplayObjectContainer.html" title="DisplayObjectContainer class" text="DisplayObjectContainer The DisplayObjectContainer class is the base class for all objects that can serve as display object containers on the display list. The display list manages all objects displayed in Flash Player. Use the DisplayObjectContainer class to arrange the display objects in the display list. Each DisplayObjectContainer object has its own child list for organizing the z-order of the objects. The z-order is the front-to-back order that determines which object is drawn in front, which is behind, and so on. DisplayObject is an abstract base class; therefore, you cannot call DisplayObject directly. Invoking new DisplayObject() throws an ArgumentError exception. The DisplayObjectContainer class is an abstract base class for all objects that can contain child objects. It cannot be instantiated directly; calling the new DisplayObjectContainer() constructor throws an ArgumentError exception. For more information, see the &quot;Display Programming&quot; chapter of the Programming ActionScript 3.0 book."/>
<page href="flash/display/DisplayObjectContainer.html#DisplayObjectContainer()" title="DisplayObjectContainer.DisplayObjectContainer()" text="DisplayObjectContainer Calling the new DisplayObjectContainer() constructor throws an ArgumentError exception. You can, however, call constructors for the following subclasses of DisplayObjectContainer: new Loader() new Sprite() new MovieClip()"/>
<page href="flash/display/DisplayObjectContainer.html#addChild()" title="DisplayObjectContainer.addChild()" text="addChild Adds a child DisplayObject instance to this DisplayObjectContainer instance. The child is added to the front (top) of all other children in this DisplayObjectContainer instance. (To add a child to a specific index position, use the addChildAt() method.) If you add a child object that already has a different display object container as a parent, the object is removed from the child list of the other display object container. child The DisplayObject instance to add as a child of this DisplayObjectContainer instance. The following example sets up two Sprite objects named container1 and container2. A Sprite is a type of display object container. The example calls the addChild() method to set up the display hierarchy: container1 is a child of container2, and two other display objects, circle1 and circle2, are children of container1. The calls to the trace() method show the number of children of each object. Note that grandchildren are not included in the numChildren count: import flash.display.Sprite; var container1:Sprite = new Sprite(); var container2:Sprite = new Sprite(); var circle1:Sprite = new Sprite(); circle1.graphics.beginFill(0xFFCC00); circle1.graphics.drawCircle(40, 40, 40); var circle2:Sprite = new Sprite(); circle2.graphics.beginFill(0x00CCFF); circle2.graphics.drawCircle(80, 40, 40); container2.addChild(container1); container1.addChild(circle1); container1.addChild(circle2); trace(container1.numChildren); // 2 trace(container2.numChildren); // 1 trace(circle1.numChildren); // 0 trace(circle2.numChildren); // 0 Throws if the child is the same as the parent. Also throws if the caller is a child (or grandchild etc.) of the child being added."/>
<page href="flash/display/DisplayObjectContainer.html#addChildAt()" title="DisplayObjectContainer.addChildAt()" text="addChildAt Adds a child DisplayObject instance to this DisplayObjectContainer instance. The child is added at the index position specified. An index of 0 represents the back (bottom) of the display list for this DisplayObjectContainer object. For example, the following example shows three display objects, labeled a, b, and c, at index positions 0, 2, and 1, respectively: If you add a child object that already has a different display object container as a parent, the object is removed from the child list of the other display object container. child index The DisplayObject instance to add as a child of this DisplayObjectContainer instance. The index position to which the child is added. If you specify a currently occupied index position, the child object that exists at that position and all higher positions are moved up one position in the child list. The following example creates a container display object container and adds a display objects circle1 to its display list. Then, by calling container.addChildAt(circle2, 0), it adds the circle2 object to index position zero (the back), and moves the circle1 object to index position 1: import flash.display.Sprite; var container:Sprite = new Sprite(); var circle1:Sprite = new Sprite(); var circle2:Sprite = new Sprite(); container.addChild(circle1); container.addChildAt(circle2, 0); trace(container.getChildAt(0) == circle2); // true trace(container.getChildAt(1) == circle1); // true Throws if the index position does not exist in the child list."/>
<page href="flash/display/DisplayObjectContainer.html#areInaccessibleObjectsUnderPoint()" title="DisplayObjectContainer.areInaccessibleObjectsUnderPoint()" text="areInaccessibleObjectsUnderPoint Indicates whether the security restrictions would cause any display objects to be omitted from the list returned by calling the DisplayObjectContainer.getObjectsUnderPoint() method with the specified point point. By default, content from one domain cannot access objects from another domain unless they are permitted to do so with a call to the Security.allowDomain() method. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper The point parameter is in the coordinate space of the Stage, which may differ from the coordinate space of the display object container (unless the display object container is the Stage). You can use the globalToLocal() and the localToGlobal() methods to convert points between these coordinate spaces. point The point under which to look. The following code creates a display object container named container. The next block of code uses a Loader object to load a JPEG file named &quot;test.jpg&quot; from a remote file server. Note that the checkPolicyFile property of the LoaderContext object used as a parameter in the load() method is set to false. Once the file is loaded, the code calls the loaded() method, which in turn calls container.areInaccessibleObjectsUnderPoint(), which returns a value of true because the loaded content is assumed to be from an inaccessible domain: import flash.display.Sprite; import flash.display.Loader; import flash.system.LoaderContext; import flash.net.URLRequest; import flash.events.Event; import flash.geom.Point; var container:Sprite = new Sprite(); var urlReq:URLRequest = new URLRequest(&quot;http://localhost/RemoteFile.swf&quot;); var ldr:Loader = new Loader(); var context:LoaderContext = new LoaderContext(); context.checkPolicyFile = false; ldr.load(urlReq, context); ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded); ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, urlNotFound); function loaded(event:Event):void { var pt:Point = new Point(1, 1); trace(container.areInaccessibleObjectsUnderPoint(pt)); // true } function urlNotFound(event:Event):void { trace(&quot;The URL was not found.&quot;); } This example assumes that the SWF file produced by this code is loaded from a different domain than that of the JPEG file, and that the loaded JPEG file occupies the point (1, 1)."/>
<page href="flash/display/DisplayObjectContainer.html#contains()" title="DisplayObjectContainer.contains()" text="contains Determines whether the specified display object is a child of the DisplayObjectContainer instance or the instance itself. The search includes the entire display list including this DisplayObjectContainer instance. Grandchildren, great-grandchildren, and so on each return true. child The child object to test. The following example sets up a number of Sprite objects and adds some to the child list of others. (A Sprite object is a type of display object container.) The relationship between various objects is shown by calling the contains() method: import flash.display.Sprite; var sprite1:Sprite = new Sprite(); var sprite2:Sprite = new Sprite(); var sprite3:Sprite = new Sprite(); var sprite4:Sprite = new Sprite(); sprite1.addChild(sprite2); sprite2.addChild(sprite3); trace(sprite1.contains(sprite1)); // true trace(sprite1.contains(sprite2)); // true trace(sprite1.contains(sprite3)); // true trace(sprite1.contains(sprite4)); // false"/>
<page href="flash/display/DisplayObjectContainer.html#getChildAt()" title="DisplayObjectContainer.getChildAt()" text="getChildAt Returns the child display object instance that exists at the specified index. index The index position of the child object. The following example creates a display object container named container and then adds a three display objects to the child list of the container object. The calls to the getChildAt() method then reveal the positions of the child objects: import flash.display.Sprite; var container:Sprite = new Sprite(); var sprite1:Sprite = new Sprite(); var sprite2:Sprite = new Sprite(); var sprite3:Sprite = new Sprite(); container.addChild(sprite1); container.addChild(sprite2); container.addChildAt(sprite3, 0); trace(container.getChildAt(0) == sprite3); // true trace(container.getChildAt(1) == sprite1); // true trace(container.getChildAt(2) == sprite2); // true Throws if the index does not exist in the child list."/>
<page href="flash/display/DisplayObjectContainer.html#getChildByName()" title="DisplayObjectContainer.getChildByName()" text="getChildByName Returns the child display object that exists with the specified name. If more that one child display object has the specified name, the method returns the first object in the child list. The getChildAt() method is faster than the getChildByName() method. The getChildAt() method accesses a child from a cached array, whereas the getChildByName() method has to traverse a linked list to access a child. name The name of the child to return. The following example creates a display object container named container and then adds two child display objects to the container. Then, the code calls the getChildByName() and getChildIndex() methods to return the index position of the child of the container object that has the name &quot;sprite1&quot;. import flash.display.Sprite; import flash.display.DisplayObject; var container:Sprite = new Sprite(); var sprite1:Sprite = new Sprite(); sprite1.name = &quot;sprite1&quot;; var sprite2:Sprite = new Sprite(); sprite2.name = &quot;sprite2&quot;; container.addChild(sprite1); container.addChild(sprite2); var target:DisplayObject = container.getChildByName(&quot;sprite1&quot;); trace(container.getChildIndex(target)); // 0 This child display object belongs to a sandbox to which you do not have access. You can avoid this situation by having the child movie call the Security.allowDomain() method."/>
<page href="flash/display/DisplayObjectContainer.html#getChildIndex()" title="DisplayObjectContainer.getChildIndex()" text="getChildIndex Returns the index position of a child DisplayObject instance. child The DisplayObject instance to identify. The following example creates a display object container named container and then adds two child display objects to the container. Then, the code calls the getChildByName() and getChildIndex() methods to return the index position of the child of the container object that has the name &quot;sprite1&quot;. import flash.display.Sprite; import flash.display.DisplayObject; var container:Sprite = new Sprite(); var sprite1:Sprite = new Sprite(); sprite1.name = &quot;sprite1&quot;; var sprite2:Sprite = new Sprite(); sprite2.name = &quot;sprite2&quot;; container.addChild(sprite1); container.addChild(sprite2); var target:DisplayObject = container.getChildByName(&quot;sprite1&quot;); trace(container.getChildIndex(target)); // 0 Throws if the child parameter is not a child of this object."/>
<page href="flash/display/DisplayObjectContainer.html#getObjectsUnderPoint()" title="DisplayObjectContainer.getObjectsUnderPoint()" text="getObjectsUnderPoint Returns an array of objects that lie under the specified point and are children (or grandchildren, and so on) of this DisplayObjectContainer instance. Any child objects that are inaccessible for security reasons are omitted from the returned array. To determine whether this security restriction affects the returned array, call the areInaccessibleObjectsUnderPoint() method. The point parameter is in the coordinate space of the Stage, which may differ from the coordinate space of the display object container (unless the display object container is the Stage). You can use the globalToLocal() and the localToGlobal() methods to convert points between these coordinate spaces. point The point under which to look. The following example creates a display object container named container and then adds two overlapping child display objects to the container. Then the code calls the getObjectsUnderPoint() twice — first using a point that touches only one object, then using a point where the objects overlap — and the length of the return Array shows the number of objects at each point in the container: import flash.display.Sprite; import flash.geom.Point; var container:Sprite = new Sprite(); var square1:Sprite = new Sprite(); square1.graphics.beginFill(0xFFCC00); square1.graphics.drawRect(0, 0, 40, 40); var square2:Sprite = new Sprite(); square2.graphics.beginFill(0x00CCFF); square2.graphics.drawRect(20, 0, 30, 40); container.addChild(square1); container.addChild(square2); var pt:Point = new Point(10, 20); var objects:Array = container.getObjectsUnderPoint(pt); trace(objects.length); // 1 pt = new Point(35, 20); objects = container.getObjectsUnderPoint(pt); trace(objects.length); // 2"/>
<page href="flash/display/DisplayObjectContainer.html#removeChild()" title="DisplayObjectContainer.removeChild()" text="removeChild Removes the specified child DisplayObject instance from the child list of the DisplayObjectContainer instance. The parent property of the removed child is set to null , and the object is garbage collected if no other references to the child exist. The index positions of any display objects above the child in the DisplayObjectContainer are decreased by 1. The garbage collector is the process by which Flash Player reallocates unused memory space. When a variable or object is no longer actively referenced or stored somewhere, the garbage collector sweeps through and wipes out the memory space it used to occupy if no other references to it exist. child The DisplayObject instance to remove. The following example creates a display object container named container and then adds two child display objects to the container. An event listener is added to the container object, so that when the user clicks a child object of the container, the removeChild() method removes the child clicked from the child list of the container: import flash.display.DisplayObject; import flash.display.Sprite; import flash.events.MouseEvent; var container:Sprite = new Sprite(); addChild(container); var circle1:Sprite = new Sprite(); circle1.graphics.beginFill(0xFFCC00); circle1.graphics.drawCircle(40, 40, 40); var circle2:Sprite = new Sprite(); circle2.graphics.beginFill(0x00CCFF); circle2.graphics.drawCircle(120, 40, 40); container.addChild(circle1); container.addChild(circle2); container.addEventListener(MouseEvent.CLICK, clicked); function clicked(event:MouseEvent):void { container.removeChild(DisplayObject(event.target)); } Throws if the child parameter is not a child of this object."/>
<page href="flash/display/DisplayObjectContainer.html#removeChildAt()" title="DisplayObjectContainer.removeChildAt()" text="removeChildAt Removes a child DisplayObject from the specified index position in the child list of the DisplayObjectContainer. The parent property of the removed child is set to null, and the object is garbage collected if no other references to the child exist. The index positions of any display objects above the child in the DisplayObjectContainer are decreased by 1. The garbage collector is the process by which Flash Player reallocates unused memory space. When a variable or object is no longer actively referenced or stored somewhere, the garbage collector sweeps through and wipes out the memory space it used to occupy if no other references to it exist. index The child index of the DisplayObject to remove. The following example creates a display object container named container and then adds two child display objects to the container. The code then shows that when you call the removeChildAt() method to remove the child at the lowest index position (0), any other child object in the list moves down one position: import flash.display.Sprite; var container:Sprite = new Sprite(); var sprite1:Sprite = new Sprite(); sprite1.name = &quot;sprite1&quot;; var sprite2:Sprite = new Sprite(); sprite2.name = &quot;sprite2&quot;; container.addChild(sprite1); container.addChild(sprite2); trace(container.numChildren) // 2 container.removeChildAt(0); trace(container.numChildren) // 1 trace(container.getChildAt(0).name); // sprite2 This child display object belongs to a sandbox to which the calling object does not have access. You can avoid this situation by having the child movie call the Security.allowDomain() method."/>
<page href="flash/display/DisplayObjectContainer.html#setChildIndex()" title="DisplayObjectContainer.setChildIndex()" text="setChildIndex Changes the position of an existing child in the display object container. This affects the layering of child objects. For example, the following example shows three display objects, labeled a, b, and c, at index positions 0, 1, and 2, respectively: When you use the setChildIndex() method and specify an index position that is already occupied, the child that occupies that position and all objects higher in the child list move up one position in the list. For example, if the display object container in the previous example is named container, you can swap the position of the display objects labeled a and b by calling the following code: container.setChildIndex(container.getChildAt(1), 0); This code results in the following arrangement of objects: child index The child DisplayObject instance for which you want to change the index number. The resulting index number for the child display object. The following example creates a display object container named container and then adds three slightly overlapping child display objects to the container. When the user clicks any of these objects, the clicked() method calls the setChildIndex() method to move the clicked object to the top-most position in the child list of the container object: import flash.display.Sprite; import flash.events.MouseEvent; var container:Sprite = new Sprite(); addChild(container); var circle1:Sprite = new Sprite(); circle1.graphics.beginFill(0xFF0000); circle1.graphics.drawCircle(40, 40, 40); circle1.addEventListener(MouseEvent.CLICK, clicked); var circle2:Sprite = new Sprite(); circle2.graphics.beginFill(0x00FF00); circle2.graphics.drawCircle(100, 40, 40); circle2.addEventListener(MouseEvent.CLICK, clicked); var circle3:Sprite = new Sprite(); circle3.graphics.beginFill(0x0000FF); circle3.graphics.drawCircle(70, 80, 40); circle3.addEventListener(MouseEvent.CLICK, clicked); container.addChild(circle1); container.addChild(circle2); container.addChild(circle3); addChild(container); function clicked(event:MouseEvent):void { var circle:Sprite = Sprite(event.target); var topPosition:uint = container.numChildren - 1; container.setChildIndex(circle, topPosition); } Throws if the index does not exist in the child list."/>
<page href="flash/display/DisplayObjectContainer.html#swapChildren()" title="DisplayObjectContainer.swapChildren()" text="swapChildren Swaps the z-order (front-to-back order) of the two specified child objects. All other child objects in the display object container remain in the same index positions. child1 child2 The first child object. The second child object. The following example creates a display object container named container, then adds two child display objects to the container, and then shows the effect of a call to the swapChildren() method: import flash.display.Sprite; var container:Sprite = new Sprite(); var sprite1:Sprite = new Sprite(); sprite1.name = &quot;sprite1&quot;; var sprite2:Sprite = new Sprite(); sprite2.name = &quot;sprite2&quot;; container.addChild(sprite1); container.addChild(sprite2); trace(container.getChildAt(0).name); // sprite1 trace(container.getChildAt(1).name); // sprite2 container.swapChildren(sprite1, sprite2); trace(container.getChildAt(0).name); // sprite2 trace(container.getChildAt(1).name); // sprite1 Throws if either child parameter is not a child of this object."/>
<page href="flash/display/DisplayObjectContainer.html#swapChildrenAt()" title="DisplayObjectContainer.swapChildrenAt()" text="swapChildrenAt Swaps the z-order (front-to-back order) of the child objects at the two specified index positions in the child list. All other child objects in the display object container remain in the same index positions. index1 index2 The index position of the first child object. The index position of the second child object. The following example creates a display object container named container, then adds three child display objects to the container, and then shows how a call to the swapChildrenAt() method rearranges the child list of the display object container: import flash.display.Sprite; var container:Sprite = new Sprite(); var sprite1:Sprite = new Sprite(); sprite1.name = &quot;sprite1&quot;; var sprite2:Sprite = new Sprite(); sprite2.name = &quot;sprite2&quot;; var sprite3:Sprite = new Sprite(); sprite3.name = &quot;sprite3&quot;; container.addChild(sprite1); container.addChild(sprite2); container.addChild(sprite3); trace(container.getChildAt(0).name); // sprite1 trace(container.getChildAt(1).name); // sprite2 trace(container.getChildAt(2).name); // sprite3 container.swapChildrenAt(0, 2); trace(container.getChildAt(0).name); // sprite3 trace(container.getChildAt(1).name); // sprite2 trace(container.getChildAt(2).name); // sprite1 If either index does not exist in the child list."/>
<page href="flash/display/DisplayObjectContainer.html#mouseChildren" title="DisplayObjectContainer.mouseChildren" text="mouseChildren Determines whether or not the children of the object are mouse enabled. If an object is mouse enabled, a user can interact with it by using a mouse. The default is true. This property is useful when you create a button with an instance of the Sprite class (instead of using the SimpleButton class). When you use a Sprite instance to create a button, you can choose to decorate the button by using the addChild() method to add additional Sprite instances. This process can cause unexpected behavior with mouse events because the Sprite instances you add as children can become the target object of a mouse event when you expect the parent instance to be the target object. To ensure that the parent instance serves as the target objects for mouse events, you can set the mouseChildren property of the parent instance to false. No event is dispatched by setting this property. You must use the addEventListener() method to create interactive functionality. The following example sets up a Sprite object (a type of display object container) named container and shows that when you set its mouseChildren property to false, the target of a mouseClick event is the container object, not any one of its child objects: import flash.display.Sprite; import flash.events.MouseEvent; var container:Sprite = new Sprite(); container.name = &quot;container&quot;; addChild(container); var circle:Sprite = new Sprite(); circle.name = &quot;circle&quot;; circle.graphics.beginFill(0xFFCC00); circle.graphics.drawCircle(40, 40, 40); container.addChild(circle); container.mouseChildren = false; container.addEventListener(MouseEvent.CLICK, clicked); function clicked(event:MouseEvent):void { trace(event.target.name); // container }"/>
<page href="flash/display/DisplayObjectContainer.html#numChildren" title="DisplayObjectContainer.numChildren" text="numChildren Returns the number of children of this object. The following example sets up two Sprite objects named container1 and container2. A Sprite is a type of display object container. The example calls the addChild() method to set up the display hierarchy: container1 is a child of container2, and two other display objects, circle1 and circle2, are children of container1. The calls to the trace() method show the number of children of each object. Note that grandchildren are not included in the numChildren count: import flash.display.Sprite; var container1:Sprite = new Sprite(); var container2:Sprite = new Sprite(); var circle1:Sprite = new Sprite(); circle1.graphics.beginFill(0xFFCC00); circle1.graphics.drawCircle(40, 40, 40); var circle2:Sprite = new Sprite(); circle2.graphics.beginFill(0x00CCFF); circle2.graphics.drawCircle(80, 40, 40); container2.addChild(container1); container1.addChild(circle1); container1.addChild(circle2); trace(container1.numChildren); // 2 trace(container2.numChildren); // 1 trace(circle1.numChildren); // 0 trace(circle2.numChildren); // 0"/>
<page href="flash/display/DisplayObjectContainer.html#tabChildren" title="DisplayObjectContainer.tabChildren" text="tabChildren Determines whether the children of the object are tab enabled. Enables or disables tabbing for the children of the object. The default is true. The following example creates a container1 display object container and adds two display objects, circle1 and circle2, to its child list. The example sets tabChildren to false for the children so it can manage its own tab order using tabIndex: import flash.display.Sprite; var container:Sprite = new Sprite(); container.tabChildren = false; var circle1:Sprite = new Sprite(); circle1.graphics.beginFill(0xFFCC00); circle1.graphics.drawCircle(40, 40, 40); circle1.tabIndex = 1; var circle2:Sprite = new Sprite(); circle2.graphics.beginFill(0x00CCFF); circle2.graphics.drawCircle(120, 40, 40); circle2.tabIndex = 0; container.addChild(circle1); container.addChild(circle2); To see the results of this example, compile and run the file. When you click one of the circles, you can press the TAB key to switch the display object that has focus (indicated by a yellow highlight rectangle). Calling this property of the Stage object throws an exception. The Stage object does not implement this property."/>
<page href="flash/display/DisplayObjectContainer.html#textSnapshot" title="DisplayObjectContainer.textSnapshot" text="textSnapshot Returns a TextSnapshot object for this DisplayObjectContainer instance. The following example works only in the Flash authoring environment. Flex does not include any ways of adding static text to a file. To prepare the Flash file for this example, add one or more static text fields in the first frame of a movie. Then insert the following script into the first frame and run the file. The output will be the static text that you added: trace(this.textSnapshot.getText(0, this.textSnapshot.charCount));"/>
<page href="flash/display/JointStyle.html" title="JointStyle class" text="JointStyle The JointStyle class is an enumeration of constant values that specify the joint style to use in drawing lines. These constants are provided for use as values in the joints parameter of the flash.display.Graphics.lineStyle() method. The method supports three types of joints: miter, round, and bevel, as the following example shows:"/>
<page href="flash/display/JointStyle.html#BEVEL" title="JointStyle.BEVEL" text="BEVEL Specifies beveled joints in the joints parameter of the flash.display.Graphics.lineStyle() method."/>
<page href="flash/display/JointStyle.html#MITER" title="JointStyle.MITER" text="MITER Specifies mitered joints in the joints parameter of the flash.display.Graphics.lineStyle() method."/>
<page href="flash/display/JointStyle.html#ROUND" title="JointStyle.ROUND" text="ROUND Specifies round joints in the joints parameter of the flash.display.Graphics.lineStyle() method."/>
<page href="flash/display/ActionScriptVersion.html" title="ActionScriptVersion class" text="ActionScriptVersion The ActionScriptVersion class is an enumeration of constant values that indicate the language version of a loaded SWF file. The language version constants are provided for use in checking the actionScriptVersion property of a flash.display.LoaderInfo object."/>
<page href="flash/display/ActionScriptVersion.html#ACTIONSCRIPT2" title="ActionScriptVersion.ACTIONSCRIPT2" text="ACTIONSCRIPT2 ActionScript language version 2.0 and earlier."/>
<page href="flash/display/ActionScriptVersion.html#ACTIONSCRIPT3" title="ActionScriptVersion.ACTIONSCRIPT3" text="ACTIONSCRIPT3 ActionScript language version 3.0."/>
<page href="flash/display/FrameLabel.html" title="FrameLabel class" text="FrameLabel The FrameLabel object contains properties that specify a frame number and the corresponding label name. The Scene class includes a labels property, which is an array of FrameLabel objects for the scene."/>
<page href="flash/display/FrameLabel.html#frame" title="FrameLabel.frame" text="frame The frame number containing the label."/>
<page href="flash/display/FrameLabel.html#name" title="FrameLabel.name" text="name The name of the label."/>
<page href="flash/display/StageQuality.html" title="StageQuality class" text="StageQuality The StageQuality class provides values for the Stage.quality property."/>
<page href="flash/display/StageQuality.html#BEST" title="StageQuality.BEST" text="BEST Specifies very high rendering quality: graphics are anti-aliased using a 4 x 4 pixel grid and bitmaps are always smoothed."/>
<page href="flash/display/StageQuality.html#HIGH" title="StageQuality.HIGH" text="HIGH Specifies high rendering quality: graphics are anti-aliased using a 4 x 4 pixel grid, and bitmaps are smoothed if the movie is static."/>
<page href="flash/display/StageQuality.html#LOW" title="StageQuality.LOW" text="LOW Specifies low rendering quality: graphics are not anti-aliased, and bitmaps are not smoothed."/>
<page href="flash/display/StageQuality.html#MEDIUM" title="StageQuality.MEDIUM" text="MEDIUM Specifies medium rendering quality: graphics are anti-aliased using a 2 x 2 pixel grid, but bitmaps are not smoothed. This setting is suitable for movies that do not contain text."/>
<page href="flash/display/InteractiveObject.html" title="InteractiveObject class" text="InteractiveObject The InteractiveObject class is the abstract base class for all display objects with which the user can interact, using the mouse and keyboard. You cannot instantiate the InteractiveObject class directly. A call to the new InteractiveObject() constructor throws an ArgumentError exception. The InteractiveObject class itself does not include any APIs for rendering content onscreen. For that reason, if you want create a custom subclass of the InteractiveObject class, you will want to extend one of its subclasses that do have APIs for rendering content onscreen, such as the Sprite, SimpleButton, TextField, or MovieClip class."/>
<page href="flash/display/InteractiveObject.html#InteractiveObject()" title="InteractiveObject.InteractiveObject()" text="InteractiveObject Calling the new InteractiveObject() constructor throws an ArgumentError exception. You can, however, call constructors for the following subclasses of InteractiveObject: new SimpleButton() new TextField() new Loader() new Sprite() new MovieClip()"/>
<page href="flash/display/InteractiveObject.html#contextMenu" title="InteractiveObject.contextMenu" text="contextMenu Specifies the context menu associated with this object."/>
<page href="flash/display/InteractiveObject.html#doubleClickEnabled" title="InteractiveObject.doubleClickEnabled" text="doubleClickEnabled Specifies whether the object receives doubleClick events. The default value is false, which means that by default an InteractiveObject instance does not receive doubleClick events. If the doubleClickEnabled property is set to true, the instance receives doubleClick events within its bounds. The mouseEnabled property of the InteractiveObject instance must also be set to true for the object to receive doubleClick events. No event is dispatched by setting this property. You must use the addEventListener() method to add an event listener for the doubleClick event."/>
<page href="flash/display/InteractiveObject.html#focusRect" title="InteractiveObject.focusRect" text="focusRect Specifies whether this object displays a focus rectangle. A value of null indicates that this object obeys the stageFocusRect property set on the Stage."/>
<page href="flash/display/InteractiveObject.html#mouseEnabled" title="InteractiveObject.mouseEnabled" text="mouseEnabled Specifies whether this object receives mouse messages. The default value is true, which means that by default any InteractiveObject instance that is on the display list receives mouse events. If mouseEnabled is set to false, the instance does not receive any mouse events. Any children of this instance on the display list are not affected. To change the mouseEnabled behavior for all children of an object on the display list, use flash.display.DisplayObjectContainer.mouseChildren. No event is dispatched by setting this property. You must use the addEventListener() method to create interactive functionality."/>
<page href="flash/display/InteractiveObject.html#tabEnabled" title="InteractiveObject.tabEnabled" text="tabEnabled Specifies whether this object is in the tab order. If this object is in the tab order, the value is true; otherwise, the value is false. By default, the value is false, except for the following: For a SimpleButton object, the value is true. For a TextField object with type = &quot;input&quot;, the value is true. For a Sprite object or MovieClip object with buttonMode = true, the value is true."/>
<page href="flash/display/InteractiveObject.html#tabIndex" title="InteractiveObject.tabIndex" text="tabIndex Specifies the tab ordering of objects in a SWF file. The tabIndex property is -1 by default, meaning no tab index is set for the object. 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 includes only objects that have tabIndex properties. The tabIndex property can 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. Do not use the same tabIndex value for multiple objects. The custom tab ordering that the tabIndex property defines 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."/>
<page href="flash/display/InteractiveObject.html#event:click" title="InteractiveObject.click" text="click Dispatched when a user presses and releases the main button of the user's pointing device over the same InteractiveObject. For a click event to occur, it must always follow this series of events in the order of occurrence: mouseDown event, then mouseUp. The target object must be identical for both of these events; otherwise the click event does not occur. Any number of other mouse events can occur at any time between the mouseDown or mouseUp events; the click event still occurs."/>
<page href="flash/display/InteractiveObject.html#event:doubleClick" title="InteractiveObject.doubleClick" text="doubleClick Dispatched when a user presses and releases the main button of a pointing device twice in rapid succession over the same InteractiveObject when that object's doubleClickEnabled flag is set to true. For a doubleClick event to occur, it must immediately follow the following series of events: mouseDown, mouseUp, click, mouseDown, mouseUp. All of these events must share the same target as the doubleClick event. The second click, represented by the second mouseDown and mouseUp events, must occur within a specific period of time after the click event. The allowable length of this period varies by operating system and can often be configured by the user. If the target is a selectable text field, the word under the pointer is selected as the default behavior. If the target InteractiveObject does not have its doubleClickEnabled flag set to true it receives two click events. The doubleClickEnabled property defaults to false. The double-click text selection behavior of a TextField object is not related to the doubleClick event. Use TextField.doubleClickEnabled to control TextField selections."/>
<page href="flash/display/InteractiveObject.html#event:focusIn" title="InteractiveObject.focusIn" text="focusIn Dispatched after a display object gains focus. This situation happens when a user highlights the object with a pointing device or keyboard navigation. The recipient of such focus is called the target object of this event, while the corresponding InteractiveObject instance that lost focus because of this change is called the related object. A reference to the related object is stored in the receiving object's relatedObject property. The shiftKey property is not used. This event follows the dispatch of the previous object's focusOut event."/>
<page href="flash/display/InteractiveObject.html#event:focusOut" title="InteractiveObject.focusOut" text="focusOut Dispatched after a display object loses focus. This happens when a user highlights a different object with a pointing device or keyboard navigation. The object that loses focus is called the target object of this event, while the corresponding InteractiveObject instance that receives focus is called the related object. A reference to the related object is stored in the target object's relatedObject property. The shiftKey property is not used. This event precedes the dispatch of the focusIn event by the related object."/>
<page href="flash/display/InteractiveObject.html#event:keyDown" title="InteractiveObject.keyDown" text="keyDown Dispatched when the user presses a key. Mappings between keys and specific characters vary by device and operating system. This event type is generated after such a mapping occurs but before the processing of an input method editor (IME). IMEs are used to enter characters, such as Chinese ideographs, that the standard QWERTY keyboard is ill-equipped to produce. This event occurs before the keyUp event."/>
<page href="flash/display/InteractiveObject.html#event:keyFocusChange" title="InteractiveObject.keyFocusChange" text="keyFocusChange Dispatched when the user attempts to change focus by using keyboard navigation. The default behavior of this event is to change the focus and dispatch the corresponding focusIn and focusOut events. This event is dispatched to the object that currently has focus. The related object for this event is the InteractiveObject instance that receives focus if you do not prevent the default behavior. You can prevent the change in focus by calling the preventDefault() method in an event listener that is properly registered with the target object. Flash Player changes the focus and dispatches focusIn and focusOut events as the default behavior."/>
<page href="flash/display/InteractiveObject.html#event:keyUp" title="InteractiveObject.keyUp" text="keyUp Dispatched when the user releases a key. Mappings between keys and specific characters vary by device and operating system. This event type is generated after such a mapping occurs but before the processing of an input method editor (IME). IMEs are used to enter characters, such as Chinese ideographs, that the standard QWERTY keyboard is ill-equipped to produce. This event occurs after a keyDown event and has the following characteristics:"/>
<page href="flash/display/InteractiveObject.html#event:mouseDown" title="InteractiveObject.mouseDown" text="mouseDown Dispatched when a user presses the pointing device button over an InteractiveObject instance in the Flash Player window. If the target is a SimpleButton instance, the SimpleButton instance displays the downState display object as the default behavior. If the target is a selectable text field, the text field begins selection as the default behavior."/>
<page href="flash/display/InteractiveObject.html#event:mouseFocusChange" title="InteractiveObject.mouseFocusChange" text="mouseFocusChange Dispatched when the user attempts to change focus by using a pointer device. The default behavior of this event is to change the focus and dispatch the corresponding focusIn and focusOut events. This event is dispatched to the object that currently has focus. The related object for this event is the InteractiveObject instance that receives focus if you do not prevent the default behavior. You can prevent the change in focus by calling preventDefault() in an event listener that is properly registered with the target object. The shiftKey property is not used. Flash Player changes the focus and dispatches focusIn and focusOut events as the default behavior."/>
<page href="flash/display/InteractiveObject.html#event:mouseMove" title="InteractiveObject.mouseMove" text="mouseMove Dispatched when a user moves the pointing device while it is over an InteractiveObject. If the target is a text field that the user is selecting, the selection is updated as the default behavior."/>
<page href="flash/display/InteractiveObject.html#event:mouseOut" title="InteractiveObject.mouseOut" text="mouseOut Dispatched when the user moves a pointing device away from an InteractiveObject instance. The event target is the object previously under the pointing device. The relatedObject is the object the pointing device has moved to. If the target is a SimpleButton instance, the button displays the upState display object as the default behavior. The mouseOut event is dispatched each time the mouse leaves the area of any child object of the display object container, even if the mouse remains over another child object of the display object container. This is different behavior than the purpose of the rollOut event, which is to simplify the coding of rollover behaviors for display object containers with children. When the mouse leaves the area of a display object or the area of any of its children to go to an object that is not one of its children, the display object dispatches the rollOut event.The rollOut events are dispatched consecutively up the parent chain of the object, starting with the object and ending with the highest parent that is neither the root nor an ancestor of the relatedObject."/>
<page href="flash/display/InteractiveObject.html#event:mouseOver" title="InteractiveObject.mouseOver" text="mouseOver Dispatched when the user moves a pointing device over an InteractiveObject instance in the Flash Player window. The relatedObject is the object that was previously under the pointing device. If the target is a SimpleButton instance, the object displays the overState or upState display object, depending on whether the mouse button is down, as the default behavior. The mouseOver event is dispatched each time the mouse enters the area of any child object of the display object container, even if the mouse was already over another child object of the display object container. This is different behavior than the purpose of the rollOver event, which is to simplify the coding of rollout behaviors for display object containers with children. When the mouse enters the area of a display object or the area of any of its children from an object that is not one of its children, the display object dispatches the rollOver event. The rollOver events are dispatched consecutively down the parent chain of the object, starting with the highest parent that is neither the root nor an ancestor of the relatedObject and ending with the object."/>
<page href="flash/display/InteractiveObject.html#event:mouseUp" title="InteractiveObject.mouseUp" text="mouseUp Dispatched when a user releases the pointing device button over an InteractiveObject instance in the Flash Player window. If the target is a SimpleButton instance, the object displays the upState display object. If the target is a selectable text field, the text field ends selection as the default behavior."/>
<page href="flash/display/InteractiveObject.html#event:mouseWheel" title="InteractiveObject.mouseWheel" text="mouseWheel Dispatched when a mouse wheel is spun over an InteractiveObject instance in the Flash Player window. If the target is a text field, the text scrolls as the default behavior."/>
<page href="flash/display/InteractiveObject.html#event:rollOut" title="InteractiveObject.rollOut" text="rollOut Dispatched when the user moves a pointing device away from an InteractiveObject instance. The event target is the object previously under the pointing device or a parent of that object. The relatedObject is the object that the pointing device has moved to. The rollOut events are dispatched consecutively up the parent chain of the object, starting with the object and ending with the highest parent that is neither the root nor an ancestor of the relatedObject. The purpose of the rollOut event is to simplify the coding of rollover behaviors for display object containers with children. When the mouse leaves the area of a display object or the area of any of its children to go to an object that is not one of its children, the display object dispatches the rollOut event. This is different behavior than that of the mouseOut event, which is dispatched each time the mouse leaves the area of any child object of the display object container, even if the mouse remains over another child object of the display object container."/>
<page href="flash/display/InteractiveObject.html#event:rollOver" title="InteractiveObject.rollOver" text="rollOver Dispatched when the user moves a pointing device over an InteractiveObject instance. The event target is the object under the pointing device or a parent of that object. The relatedObject is the object that was previously under the pointing device. The rollOver events are dispatched consecutively down the parent chain of the object, starting with the highest parent that is neither the root nor an ancestor of the relatedObject and ending with the object. The purpose of the rollOver event is to simplify the coding of rollout behaviors for display object containers with children. When the mouse enters the area of a display object or the area of any of its children from an object that is not one of its children, the display object dispatches the rollOver event. This is different behavior than that of the mouseOver event, which is dispatched each time the mouse enters the area of any child object of the display object container, even if the mouse was already over another child object of the display object container."/>
<page href="flash/display/InteractiveObject.html#event:tabChildrenChange" title="InteractiveObject.tabChildrenChange" text="tabChildrenChange Dispatched when the value of the object's tabChildren flag changes."/>
<page href="flash/display/InteractiveObject.html#event:tabEnabledChange" title="InteractiveObject.tabEnabledChange" text="tabEnabledChange Dispatched when the object's tabEnabled flag changes."/>
<page href="flash/display/InteractiveObject.html#event:tabIndexChange" title="InteractiveObject.tabIndexChange" text="tabIndexChange Dispatched when the value of the object's tabIndex property changes."/>
<page href="flash/display/BitmapDataChannel.html" title="BitmapDataChannel class" text="BitmapDataChannel The BitmapDataChannel class is an enumeration of constant values that indicate which channel to use: red, blue, green, or alpha transparency. When you call some methods, you can use the bitwise OR operator (|) to combine BitmapDataChannel constants to indicate multiple color channels. The BitmapDataChannel constants are provided for use as values in the following: The sourceChannel and destChannel parameters of the flash.display.BitmapData.copyChannel() method The channelOptions parameter of the flash.display.BitmapData.noise() method The flash.filters.DisplacementMapFilter.componentX and flash.filters.DisplacementMapFilter.componentY properties"/>
<page href="flash/display/BitmapDataChannel.html#ALPHA" title="BitmapDataChannel.ALPHA" text="ALPHA The alpha channel."/>
<page href="flash/display/BitmapDataChannel.html#BLUE" title="BitmapDataChannel.BLUE" text="BLUE The blue channel."/>
<page href="flash/display/BitmapDataChannel.html#GREEN" title="BitmapDataChannel.GREEN" text="GREEN The green channel."/>
<page href="flash/display/BitmapDataChannel.html#RED" title="BitmapDataChannel.RED" text="RED The red channel."/>
<page href="flash/display/DisplayObject.html" title="DisplayObject class" text="DisplayObject The DisplayObject class is the base class for all objects that can be placed on the display list. The display list manages all objects displayed in Flash Player. Use the DisplayObjectContainer class to arrange the display objects in the display list. DisplayObjectContainer objects can have child display objects, while other display objects, such as Shape and TextField objects, are &quot;leaf&quot; nodes that have only parents and siblings, no children. The DisplayObject class supports basic functionality like the x and y position of an object, as well as more advanced properties of the object such as its transformation matrix. DisplayObject is an abstract base class; therefore, you cannot call DisplayObject directly. Invoking new DisplayObject() throws an ArgumentError exception. All display objects inherit from the DisplayObject class. The DisplayObject class itself does not include any APIs for rendering content onscreen. For that reason, if you want create a custom subclass of the DisplayObject class, you will want to extend one of its subclasses that do have APIs for rendering content onscreen, such as the Shape, Sprite, Bitmap, SimpleButton, TextField, or MovieClip class. Some properties previously used in the ActionScript 1.0 and 2.0 MovieClip, TextField, and Button classes (such as _alpha, _height, _name, _width, _x, _y, and others) have equivalents in the ActionScript 3.0 DisplayObject class that are renamed so that they no longer begin with the underscore (_) character. For more information, see the &quot;Display Programming&quot; chapter of the Programming ActionScript 3.0 book."/>
<page href="flash/display/DisplayObject.html#getBounds()" title="DisplayObject.getBounds()" text="getBounds Returns a rectangle that defines the area of the display object relative to the coordinate system of the targetCoordinateSpace object. Consider the following code, which shows how the rectangle returned can vary depending on the targetCoordinateSpace parameter that you pass to the method: var container:Sprite = new Sprite(); container.x = 100; container.y = 100; this.addChild(container); var contents:Shape = new Shape(); contents.graphics.drawCircle(0,0,100); container.addChild(contents); trace(contents.getBounds(container)); // (x=-100, y=-100, w=200, h=200) trace(contents.getBounds(this)); // (x=0, y=0, w=200, h=200) Note: Use the localToGlobal() and globalToLocal() methods to convert the display object's local coordinates to display coordinates, or display coordinates to local coordinates, respectively. The getBounds() method is similar to the getRect() method; however, the Rectangle returned by the getBounds() method includes any strokes on shapes, whereas the Rectangle returned by the getRect() method does not. For an example, see the description of the getRect() method. targetCoordinateSpace The display object that defines the coordinate system to use."/>
<page href="flash/display/DisplayObject.html#getRect()" title="DisplayObject.getRect()" text="getRect Returns a rectangle that defines the boundary of the display object, based on the coordinate system defined by the targetCoordinateSpace parameter, excluding any strokes on shapes. The values that the getRect() method returns are the same or smaller than those returned by the getBounds() method. Note: Use localToGlobal() and globalToLocal() methods to convert the display object's local coordinates to Stage coordinates, or Stage coordinates to local coordinates, respectively. targetCoordinateSpace The display object that defines the coordinate system to use. The following example shows how the getBounds() method can return a larger rectangle than the getRect() method does, because of the additional area taken up by strokes. In this case, the triangle sprite includes extra strokes because of the values passed as the width and jointStyle parameters of the lineStyle() method. The trace() output (in the last two lines) shows the differences between the getRect() and getBounds() rectangles: import flash.display.CapsStyle; import flash.display.JointStyle; import flash.display.LineScaleMode; import flash.display.Sprite; import flash.geom.Rectangle; var triangle:Sprite = new Sprite(); var color:uint = 0xFF0044; var lineWidth:Number = 20; var lineAlpha:Number = 1.0; var pixelHinting:Boolean = true; var scaleMode:String = LineScaleMode.NORMAL; var caps:String = CapsStyle.SQUARE; var joints:String = JointStyle.MITER; triangle.graphics.lineStyle(lineWidth, color, lineAlpha, pixelHinting, scaleMode, caps, joints); var triangleSide:Number = 100; triangle.graphics.moveTo(0, 0); triangle.graphics.lineTo(0, triangleSide); triangle.graphics.lineTo(triangleSide, triangleSide); triangle.graphics.lineTo(0, 0); addChild(triangle); trace(triangle.getBounds(this)); // (x=-10, y=-24.1, w=134.1, h=134.1) trace(triangle.getRect(this)); // (x=0, y=0, w=100, h=100)"/>
<page href="flash/display/DisplayObject.html#globalToLocal()" title="DisplayObject.globalToLocal()" text="globalToLocal Converts the point object from the Stage (global) coordinates to the display object's (local) coordinates. To use this method, first create an instance of the Point class. The x and y values that you assign represent global coordinates because they relate to the origin (0,0) of the main display area. Then pass the Point instance as the parameter to the globalToLocal() method. The method returns a new Point object with x and y values that relate to the origin of the display object instead of the origin of the Stage. point An object created with the Point class. The Point object specifies the x and y coordinates as properties. The following code creates a Shape object and shows the result of calling the hitTestPoint() method, using different points as parameters. The globalToLocal() method converts the point from Stage coordinates to the coordinate space of the shape: import flash.display.Shape; import flash.geom.Point; var circle:Shape = new Shape(); circle.graphics.beginFill(0x0000FF); circle.graphics.drawCircle(40, 40, 40); circle.x = 10; addChild(circle); var point1:Point = new Point(0, 0); trace(circle.hitTestPoint(point1.x, point1.y, true)); // false trace(circle.hitTestPoint(point1.x, point1.y, false)); // false trace(circle.globalToLocal(point1)); // [x=-10, y=0] var point2:Point = new Point(10, 1); trace(circle.hitTestPoint(point2.x, point2.y, true)); // false trace(circle.hitTestPoint(point2.x, point2.y, false)); // true trace(circle.globalToLocal(point2)); // [x=0, y=1] var point3:Point = new Point(30, 20); trace(circle.hitTestPoint(point3.x, point3.y, true)); // true trace(circle.hitTestPoint(point3.x, point3.y, false)); // true trace(circle.globalToLocal(point3)); // [x=20, y=20]"/>
<page href="flash/display/DisplayObject.html#hitTestObject()" title="DisplayObject.hitTestObject()" text="hitTestObject Evaluates the display object to see if it overlaps or intersects with the obj display object. obj The display object to test against. The following code creates three Shape objects and shows the result of calling the hitTestObject() method: import flash.display.Shape; var circle1:Shape = new Shape(); circle1.graphics.beginFill(0x0000FF); circle1.graphics.drawCircle(40, 40, 40); addChild(circle1); var circle2:Shape = new Shape(); circle2.graphics.beginFill(0x00FF00); circle2.graphics.drawCircle(40, 40, 40); circle2.x = 50; addChild(circle2); var circle3:Shape = new Shape(); circle3.graphics.beginFill(0xFF0000); circle3.graphics.drawCircle(40, 40, 40); circle3.x = 100; circle3.y = 67; addChild(circle3); trace(circle1.hitTestObject(circle2)); // true trace(circle1.hitTestObject(circle3)); // false trace(circle2.hitTestObject(circle3)); // true"/>
<page href="flash/display/DisplayObject.html#hitTestPoint()" title="DisplayObject.hitTestPoint()" text="hitTestPoint Evaluates the display object to see if it overlaps or intersects with the point specified by the x and y parameters. The x and y parameters specify a point in the coordinate space of the Stage, not the display object container that contains the display object (unless that display object container is the Stage). x y shapeFlag The x coordinate to test against this object. The y coordinate to test against this object. Whether to check against the actual pixels of the object (true) or the bounding box (false). The following code creates a Shape object and shows the result of calling the hitTestPoint() method, using different points as parameters. The globalToLocal() method converts the point from Stage coordinates to the coordinate space of the shape: import flash.display.Shape; import flash.geom.Point; var circle:Shape = new Shape(); circle.graphics.beginFill(0x0000FF); circle.graphics.drawCircle(40, 40, 40); circle.x = 10; addChild(circle); var point1:Point = new Point(0, 0); trace(circle.hitTestPoint(point1.x, point1.y, true)); // false trace(circle.hitTestPoint(point1.x, point1.y, false)); // false trace(circle.globalToLocal(point1)); // [x=-10, y=0] var point2:Point = new Point(10, 1); trace(circle.hitTestPoint(point2.x, point2.y, true)); // false trace(circle.hitTestPoint(point2.x, point2.y, false)); // true trace(circle.globalToLocal(point2)); // [x=0, y=1] var point3:Point = new Point(30, 20); trace(circle.hitTestPoint(point3.x, point3.y, true)); // true trace(circle.hitTestPoint(point3.x, point3.y, false)); // true trace(circle.globalToLocal(point3)); // [x=20, y=20]"/>
<page href="flash/display/DisplayObject.html#localToGlobal()" title="DisplayObject.localToGlobal()" text="localToGlobal Converts the point object from the display object's (local) coordinates to the Stage (global) coordinates. This method allows you to convert any given x and y coordinates from values that are relative to the origin (0,0) of a specific display object (local coordinates) to values that are relative to the origin of the Stage (global coordinates). To use this method, first create an instance of the Point class. The x and y values that you assign represent local coordinates because they relate to the origin of the display object. You then pass the Point instance that you created as the parameter to the localToGlobal() method. The method returns a new Point object with x and y values that relate to the origin of the Stage instead of the origin of the display object. point The name or identifier of a point created with the Point class, specifying the x and y coordinates as properties. The following code creates a Sprite object. The mouseX and mouseY properties of the sprite are in the coordinate space of the display object. This code uses the localToGlobal() method to translate these properties to the global (Stage) coordinates: import flash.display.Sprite; import flash.events.MouseEvent; import flash.geom.Point; var square:Sprite = new Sprite(); square.graphics.beginFill(0xFFCC00); square.graphics.drawRect(0, 0, 100, 100); square.x = 100; square.y = 200; addChild(square); square.addEventListener(MouseEvent.CLICK, traceCoordinates) function traceCoordinates(event:MouseEvent):void { var clickPoint:Point = new Point(square.mouseX, square.mouseY); trace(&quot;display object coordinates:&quot;, clickPoint); trace(&quot;stage coordinates:&quot;, square.localToGlobal(clickPoint)); }"/>
<page href="flash/display/DisplayObject.html#accessibilityProperties" title="DisplayObject.accessibilityProperties" text="accessibilityProperties The current accessibility options for this display object. If you modify the accessibilityProperties property or any of the fields within accessibilityProperties, you must call the Accessibility.updateProperties() method to make your changes take effect. Note: For an object created in the Flash authoring environment, the value of accessibilityProperties is prepopulated with any information you entered in the Accessibility panel for that object. The following example shows how the to attach a simple AccessibilityProperties object to a TextField instance: import flash.text.TextField; import flash.accessibility.AccessibilityProperties; import flash.accessibility.Accessibility; import flash.system.Capabilities; var tf:TextField = new TextField(); tf.text = &quot;hello&quot;; var accessProps:AccessibilityProperties = new AccessibilityProperties(); accessProps.name = &quot;Greeting&quot;; tf.accessibilityProperties = accessProps; if (Capabilities.hasAccessibility) { Accessibility.updateProperties(); } trace(tf.accessibilityProperties.name); // Greeting"/>
<page href="flash/display/DisplayObject.html#alpha" title="DisplayObject.alpha" text="alpha Indicates the alpha transparency value of the object specified. Valid values are 0 (fully transparent) to 1 (fully opaque). The default value is 1. Display objects with alpha set to 0 are active, even though they are invisible. The following code sets the alpha property of a sprite to 50% when the mouse rolls over the sprite: import flash.display.Sprite; import flash.events.MouseEvent; var circle:Sprite = new Sprite(); circle.graphics.beginFill(0xFF0000); circle.graphics.drawCircle(40, 40, 40); addChild(circle); circle.addEventListener(MouseEvent.MOUSE_OVER, dimObject); circle.addEventListener(MouseEvent.MOUSE_OUT, restoreObject); function dimObject(event:MouseEvent):void { event.target.alpha = 0.5; } function restoreObject(event:MouseEvent):void { event.target.alpha = 1.0; }"/>
<page href="flash/display/DisplayObject.html#blendMode" title="DisplayObject.blendMode" text="blendMode A value from the BlendMode class that specifies which blend mode to use. A bitmap can be drawn internally in two ways. If you have a blend mode enabled or an external clipping mask, the bitmap is drawn by adding a bitmap-filled square shape to the vector render. If you attempt to set this property to an invalid value, Flash Player sets the value to BlendMode.NORMAL. Flash Player applies the blendMode property on each pixel of the display object. Each pixel is composed of three constituent colors (red, green, and blue), and each constituent color has a value between 0x00 and 0xFF. Flash Player compares each constituent color of one pixel in the movie clip with the corresponding color of the pixel in the background. For example, if blendMode is set to BlendMode.LIGHTEN, Flash Player compares the red value of the display object with the red value of the background, and uses the lighter of the two as the value for the red component of the displayed color. The following table describes the blendMode settings. The BlendMode class defines string values you can use. The illustrations in the table show blendMode values applied to a circular display object (2) superimposed on another display object (1). BlendMode Constant Illustration Description BlendMode.NORMAL The display object appears in front of the background. Pixel values of the display object override those of the background. Where the display object is transparent, the background is visible. BlendMode.LAYER Forces the creation of a transparency group for the display object. This means that the display object is pre-composed in a temporary buffer before it is processed further. This is done automatically if the display object is pre-cached using bitmap caching or if the display object is a display object container with at least one child object with a blendMode setting other than BlendMode.NORMAL. BlendMode.MULTIPLY Multiplies the values of the display object constituent colors by the colors of the background color, and then normalizes by dividing by 0xFF, resulting in darker colors. This setting is commonly used for shadows and depth effects. For example, if a constituent color (such as red) of one pixel in the display object and the corresponding color of the pixel in the background both have the value 0x88, the multiplied result is 0x4840. Dividing by 0xFF yields a value of 0x48 for that constituent color, which is a darker shade than the color of the display object or the color of the background. BlendMode.SCREEN Multiplies the complement (inverse) of the display object color by the complement of the background color, resulting in a bleaching effect. This setting is commonly used for highlights or to remove black areas of the display object. BlendMode.LIGHTEN Selects the lighter of the constituent colors of the display object and the color of the background (the colors with the larger values). This setting is commonly used for superimposing type. For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0xFFF833 (because 0xFF &gt; 0xDD, 0xCC &lt; 0xF8, and 0x33 &gt; 0x00 = 33). BlendMode.DARKEN Selects the darker of the constituent colors of the display object and the colors of the background (the colors with the smaller values). This setting is commonly used for superimposing type. For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0xDDCC00 (because 0xFF &gt; 0xDD, 0xCC &lt; 0xF8, and 0x33 &gt; 0x00 = 33). BlendMode.DIFFERENCE Compares the constituent colors of the display object with the colors of its background, and subtracts the darker of the values of the two constituent colors from the lighter value. This setting is commonly used for more vibrant colors. For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0x222C33 (because 0xFF - 0xDD = 0x22, 0xF8 - 0xCC = 0x2C, and 0x33 - 0x00 = 0x33). BlendMode.ADD Adds the values of the constituent colors of the display object to the colors of its background, applying a ceiling of 0xFF. This setting is commonly used for animating a lightening dissolve between two objects. For example, if the display object has a pixel with an RGB value of 0xAAA633, and the background pixel has an RGB value of 0xDD2200, the resulting RGB value for the displayed pixel is 0xFFC833 (because 0xAA + 0xDD &gt; 0xFF, 0xA6 + 0x22 = 0xC8, and 0x33 + 0x00 = 0x33). BlendMode.SUBTRACT Subtracts the values of the constituent colors in the display object from the values of the background color, applying a floor of 0. This setting is commonly used for animating a darkening dissolve between two objects. For example, if the display object has a pixel with an RGB value of 0xAA2233, and the background pixel has an RGB value of 0xDDA600, the resulting RGB value for the displayed pixel is 0x338400 (because 0xDD - 0xAA = 0x33, 0xA6 - 0x22 = 0x84, and 0x00 - 0x33 &lt; 0x00). BlendMode.INVERT Inverts the background. BlendMode.ALPHA Applies the alpha value of each pixel of the display object to the background. This requires the blendMode setting of the parent display object to be set to BlendMode.LAYER. For example, in the illustration, the parent display object, which is a white background, has blendMode = BlendMode.LAYER. BlendMode.ERASE Erases the background based on the alpha value of the display object. This requires the blendMode of the parent display object to be set to BlendMode.LAYER. For example, in the illustration, the parent display object, which is a white background, has blendMode = BlendMode.LAYER. BlendMode.OVERLAY Adjusts the color of each pixel based on the darkness of the background. If the background is lighter than 50% gray, the display object and background colors are screened, which results in a lighter color. If the background is darker than 50% gray, the colors are multiplied, which results in a darker color. This setting is commonly used for shading effects. BlendMode.HARDLIGHT Adjusts the color of each pixel based on the darkness of the display object. If the display object is lighter than 50% gray, the display object and background colors are screened, which results in a lighter color. If the display object is darker than 50% gray, the colors are multiplied, which results in a darker color. This setting is commonly used for shading effects. The following code creates two sprite objects, a square and a circle, and sets the blend mode of the circle (in the foreground) to BlendMode.SUBTRACT when the pointer rolls over the circle: import flash.display.Sprite; import flash.display.BlendMode; import flash.events.MouseEvent; var square:Sprite = new Sprite(); square.graphics.beginFill(0xFF88CC); square.graphics.drawRect(0, 0, 80, 80); addChild(square); var circle:Sprite = new Sprite(); circle.graphics.beginFill(0xAA0022); circle.graphics.drawCircle(40, 40, 40); addChild(circle); circle.addEventListener(MouseEvent.MOUSE_OVER, dimObject); circle.addEventListener(MouseEvent.MOUSE_OUT, restoreObject); function dimObject(event:MouseEvent):void { event.target.blendMode = BlendMode.SUBTRACT; } function restoreObject(event:MouseEvent):void { event.target.blendMode = BlendMode.NORMAL; }"/>
<page href="flash/display/DisplayObject.html#cacheAsBitmap" title="DisplayObject.cacheAsBitmap" text="cacheAsBitmap If set to true, Flash Player caches an internal bitmap representation of the display object. This caching can increase performance for display objects that contain complex vector content. All vector data for a display object that has a cached bitmap is drawn to the bitmap instead of the main display. The bitmap is then copied to the main display as unstretched, unrotated pixels snapped to the nearest pixel boundaries. Pixels are mapped 1 to 1 with the parent object. If the bounds of the bitmap change, the bitmap is recreated instead of being stretched. No internal bitmap is created unless the cacheAsBitmap property is set to true. After you set the cacheAsBitmap property to true, the rendering does not change, however the display object performs pixel snapping automatically. The animation speed can be significantly faster depending on the complexity of the vector content. The cacheAsBitmap property is automatically set to true whenever you apply a filter to a display object (when its filter array is not empty), and if a display object has a filter applied to it, cacheAsBitmap is reported as true for that display object, even if you set the property to false. If you clear all filters for a display object, the cacheAsBitmap setting changes to what it was last set to. A display object does not use a bitmap even if the cacheAsBitmap property is set to true and instead renders from vector data in the following cases: The bitmap is too large: greater than 2880 pixels in either direction. The bitmap fails to allocate (out of memory error). The cacheAsBitmap property is best used with movie clips that have mostly static content and that do not scale and rotate frequently. With such movie clips, cacheAsBitmap can lead to performance increases when the movie clip is translated (when its x and y position is changed). The following example applies a drop shadow to a Shape instance. It then traces the value of the cacheAsBitmap property, which is set to true when the filter is applied: import flash.display.Sprite; import flash.filters.DropShadowFilter var circle:Sprite = new Sprite(); circle.graphics.beginFill(0xAA0022); circle.graphics.drawCircle(40, 40, 40); addChild(circle); trace(circle.cacheAsBitmap); // false var filter:DropShadowFilter = new DropShadowFilter(); circle.filters = [filter]; trace(circle.cacheAsBitmap); // true"/>
<page href="flash/display/DisplayObject.html#filters" title="DisplayObject.filters" text="filters An indexed array that contains each filter object currently associated with the display object. The flash.filters package contains several classes that define specific filters you can use. Filters can be applied in the Flash authoring tool at design-time, or at runtime by using ActionScript code. To apply a filter by using ActionScript, you must make a temporary copy of the entire filters array, modify the temporary array, then assign the value of the temporary array back to the filters array. You cannot directly add a new filter object to the filters array. To add a filter by using ActionScript, perform the following steps (assume that the target display object is named myDisplayObject): Create a new filter object by using the constructor method of your chosen filter class. Assign the value of the myDisplayObject.filters array to a temporary array, such as one named myFilters. Add the new filter object to the myFilters temporary array. Assign the value of the temporary array to the myDisplayObject.filters array. If the filters array is undefined, you do not need to use a temporary array. Instead, you can directly assign an array literal that contains one or more filter objects that you create. The first example in the Examples section adds a drop shadow filter by using code that handles both defined and undefined filters arrays. To modify an existing filter object, you must use the technique of modifying a copy of the filters array: Assign the value of the filters array to a temporary array, such as one named myFilters. Modify the property by using the temporary array, myFilters. For example, to set the quality property of the first filter in the array, you could use the following code: myFilters[0].quality = 1; Assign the value of the temporary array to the filters array. At load time, if a display object has an associated filter, it is marked to cache itself as a transparent bitmap. From this point forward, as long as the display object has a valid filter list, the player caches the display object as a bitmap. This source bitmap is used as a source image for the filter effects. Each display object usually has two bitmaps: one with the original unfiltered source display object and another for the final image after filtering. The final image is used when rendering. As long as the display object does not change, the final image does not need updating. The flash.filters package includes classes for filters. For example, to create a DropShadow filter, you would write: import flash.filters.DropShadowFilter var myFilter:DropShadowFilter = new DropShadowFilter (distance, angle, color, alpha, blurX, blurY, quality, inner, knockout) You can use the is operator to determine the type of filter assigned to each index position in the filter array. For example, the following code shows how to determine the position of the first filter in the filters array that is a DropShadowFilter: import flash.text.TextField; import flash.filters.~~; var tf:TextField = new TextField(); var filter1:DropShadowFilter = new DropShadowFilter(); var filter2:GradientGlowFilter = new GradientGlowFilter(); tf.filters = [filter1, filter2]; tf.text = &quot;DropShadow index: &quot; + filterPosition(tf, DropShadowFilter).toString(); // 0 addChild(tf) function filterPosition(displayObject:DisplayObject, filterClass:Class):int { for (var i:uint = 0; i &lt; displayObject.filters.length; i++) { if (displayObject.filters[i] is filterClass) { return i; } } return -1; } Note: Since you cannot directly add a new filter object to the DisplayObject.filters array, the following code has no effect on the target display object, named myDisplayObject: myDisplayObject.filters.push(myDropShadow);"/>
<page href="flash/display/DisplayObject.html#height" title="DisplayObject.height" text="height Indicates the height of the display object, in pixels. The height is calculated based on the bounds of the content of the display object. When you set the height property, the scaleY property is adjusted accordingly, as shown in the following code: var rect:Shape = new Shape(); rect.graphics.beginFill(0xFF0000); rect.graphics.drawRect(0, 0, 100, 100); trace(rect.scaleY) // 1; rect.height = 200; trace(rect.scaleY) // 2; Except for TextField and Video objects, a display object with no content (such as an empty sprite) has a height of 0, even if you try to set height to a different value. The following code creates two TextField objects and adjusts the height property of each based on the textHeight property of each; it also positions the second text field by setting its y property: import flash.text.TextField; var tf1:TextField = new TextField(); tf1.text = &quot;Text Field 1&quot;; tf1.border = true; tf1.wordWrap = true; tf1.width = 40; tf1.height = tf1.textHeight + 5; addChild(tf1); var tf2:TextField = new TextField(); tf2.text = &quot;Text Field 2&quot;; tf2.border = true; tf2.wordWrap = true; tf2.width = 40; tf2.height = tf2.textHeight + 5; tf2.y = tf1.y + tf1.height + 5; addChild(tf2);"/>
<page href="flash/display/DisplayObject.html#loaderInfo" title="DisplayObject.loaderInfo" text="loaderInfo Returns a LoaderInfo object containing information about loading the file to which this display object belongs. The loaderInfo property is defined only for the root display object of a SWF file or for a loaded Bitmap (not for a Bitmap that is drawn with ActionScript). To find the loaderInfo object associated with the SWF file that contains a display object named myDisplayObject, use myDisplayObject.root.loaderInfo. A large SWF file can monitor its download by calling this.root.loaderInfo.addEventListener(Event.COMPLETE, func). The following code assumes that this refers to a display object. The code outputs the URL of the root SWF file for the display object: trace(this.loaderInfo.url);"/>
<page href="flash/display/DisplayObject.html#mask" title="DisplayObject.mask" text="mask The calling display object is masked by the specified mask object. To ensure that masking works when the Stage is scaled, the mask display object must be in an active part of the display list. The mask object itself is not drawn. Set mask to null to remove the mask. To be able to scale a mask object, it must be on the display list. To be able to drag a mask Sprite object (by calling its startDrag() method), it must be on the display list. To call the startDrag() method for a mask sprite based on a mouseDown event being dispatched by the sprite, set the sprite's buttonMode property to true. The following code creates a TextField object as well as a Sprite object that is set as a mask for the TextField object. When the user clicks the text field, the drag() event listener function calls the startDrag() method of the mask Sprite object: import flash.text.TextField; import flash.display.Sprite; import flash.events.MouseEvent; var tf:TextField = new TextField(); tf.text = &quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit, &quot; + &quot;sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. &quot; tf.selectable = false; tf.wordWrap = true; tf.width = 150; addChild(tf); var square:Sprite = new Sprite(); square.graphics.beginFill(0xFF0000); square.graphics.drawRect(0, 0, 40, 40); addChild(square); tf.mask = square; tf.addEventListener(MouseEvent.MOUSE_DOWN, drag); tf.addEventListener(MouseEvent.MOUSE_UP, noDrag); function drag(event:MouseEvent):void { square.startDrag(); } function noDrag(event:MouseEvent):void { square.stopDrag(); }"/>
<page href="flash/display/DisplayObject.html#mouseX" title="DisplayObject.mouseX" text="mouseX Indicates the x coordinate of the mouse position, in pixels. The following code creates a Sprite object and traces the mouseX and mouseY positions when the user clicks the sprite: import flash.display.Sprite; import flash.events.MouseEvent; var square:Sprite = new Sprite(); square.graphics.beginFill(0xFF0000); square.graphics.drawRect(0, 0, 200, 200); addChild(square); square.addEventListener(MouseEvent.CLICK, traceCoordinates); function traceCoordinates(event:MouseEvent):void { trace(square.mouseX, square.mouseY); }"/>
<page href="flash/display/DisplayObject.html#mouseY" title="DisplayObject.mouseY" text="mouseY Indicates the y coordinate of the mouse position, in pixels. The following code creates a Sprite object and traces the mouseX and mouseY positions when the user clicks the sprite: import flash.display.Sprite; import flash.events.MouseEvent; var square:Sprite = new Sprite(); square.graphics.beginFill(0xFF0000); square.graphics.drawRect(0, 0, 200, 200); addChild(square); square.addEventListener(MouseEvent.CLICK, traceCoordinates); function traceCoordinates(event:MouseEvent):void { trace(square.mouseX, square.mouseY); }"/>
<page href="flash/display/DisplayObject.html#name" title="DisplayObject.name" text="name Indicates the instance name of the DisplayObject. The object can be identified in the child list of its parent display object container by calling the getChildByName() method of the display object container. The following code creates two Sprite object and traces the associated name property when the user clicks either of the objects: import flash.display.Sprite; import flash.events.MouseEvent; var circle1:Sprite = new Sprite(); circle1.graphics.beginFill(0xFF0000); circle1.graphics.drawCircle(40, 40, 40); circle1.name = &quot;circle1&quot;; addChild(circle1); circle1.addEventListener(MouseEvent.CLICK, traceName); var circle2:Sprite = new Sprite(); circle2.graphics.beginFill(0x0000FF); circle2.graphics.drawCircle(140, 40, 40); circle2.name = &quot;circle2&quot;; addChild(circle2); circle2.addEventListener(MouseEvent.CLICK, traceName); function traceName(event:MouseEvent):void { trace(event.target.name); } If you are attempting to set this property on an object that was placed on the timeline in the Flash authoring tool."/>
<page href="flash/display/DisplayObject.html#opaqueBackground" title="DisplayObject.opaqueBackground" text="opaqueBackground Specifies whether the display object is opaque with a certain background color. A transparent bitmap contains alpha channel data and is drawn transparently. An opaque bitmap has no alpha channel (and renders faster than a transparent bitmap). If the bitmap is opaque, you specify its own background color to use. If set to a number value, the surface is opaque (not transparent) with the RGB background color that the number specifies. If set to null (the default value), the display object has a transparent background. The opaqueBackground property is intended mainly for use with the cacheAsBitmap property, for rendering optimization. For display objects in which the cacheAsBitmap property is set to true, setting opaqueBackground can improve rendering performance. The opaque background region is not matched when calling the hitTestPoint() method with the shapeFlag parameter set to true. The opaque background region does not respond to mouse events. The following code creates a Shape object with a blue circle and sets its opaqueBackground property to red (0xFF0000): import flash.display.Shape; var circle:Shape = new Shape(); circle.graphics.beginFill(0x0000FF); circle.graphics.drawCircle(40, 40, 40); circle.opaqueBackground = 0xFF0000; addChild(circle);"/>
<page href="flash/display/DisplayObject.html#parent" title="DisplayObject.parent" text="parent Indicates the DisplayObjectContainer object that contains this display object. Use the parent property to specify a relative path to display objects that are above the current display object in the display list hierarchy. You can use parent to move up multiple levels in the display list as in the following: this.parent.parent.alpha = 20; The following code creates three Sprite objects and shows how the parent property reflects the display list hierarchy: import flash.display.Sprite; var sprite1:Sprite = new Sprite(); sprite1.name = &quot;sprite1&quot;; var sprite2:Sprite = new Sprite(); sprite2.name = &quot;sprite2&quot;; var sprite3:Sprite = new Sprite(); sprite3.name = &quot;sprite3&quot;; sprite1.addChild(sprite2); sprite2.addChild(sprite3); trace(sprite2.parent.name); // sprite1 trace(sprite3.parent.name); // sprite2 trace(sprite3.parent.parent.name); // sprite1 The parent display object belongs to a security sandbox to which you do not have access. You can avoid this situation by having the parent movie call the Security.allowDomain() method."/>
<page href="flash/display/DisplayObject.html#root" title="DisplayObject.root" text="root For a display object in a loaded SWF file, the root property is the top-most display object in the portion of the display list's tree structure represented by that SWF file. For a Bitmap object representing a loaded image file, the root property is the Bitmap object itself. For the instance of the main class of the first SWF file loaded, the root property is the display object itself. The root property of the Stage object is the Stage object itself. The root property is set to null for any display object that has not been added to the display list, unless it has been added to a display object container that is off the display list but that is a child of the top-most display object in a loaded SWF file. For example, if you create a new Sprite object by calling the Sprite() constructor method, its root property is null until you add it to the display list (or to a display object container that is off the display list but that is a child of the top-most display object in a SWF file). For a loaded SWF file, even though the Loader object used to load the file may not be on the display list, the top-most display object in the SWF file has its root property set to itself. The Loader object does not have its root property set until it is added as a child of a display object for which the root property is set. The following code shows the difference between the root property for the Stage object, for a display object (a Loader object) that is not loaded (both before and after it has been added to the display list), and for a loaded object (a loaded Bitmap object): import flash.display.Loader; import flash.net.URLRequest; import flash.events.Event; trace(stage.root); // [object Stage] var ldr:Loader = new Loader(); trace(ldr.root); // null addChild(ldr); trace(ldr.root); // [object ...] var urlReq:URLRequest = new URLRequest(&quot;example.jpg&quot;); ldr.load(urlReq); ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded); function loaded(event:Event):void { trace(ldr.content.root); // [object Bitmap] }"/>
<page href="flash/display/DisplayObject.html#rotation" title="DisplayObject.rotation" text="rotation Indicates the rotation of the DisplayObject instance, 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_video.rotation = 450 is the same as my_video.rotation = 90. The following code creates a Sprite object and rotates the object when the user clicks it: import flash.display.Sprite; import flash.events.MouseEvent; var square:Sprite = new Sprite(); square.graphics.beginFill(0xFFCC00); square.graphics.drawRect(-50, -50, 100, 100); square.x = 150; square.y = 150; addChild(square); square.addEventListener(MouseEvent.CLICK, rotate); function rotate(event:MouseEvent):void { square.rotation += 15; }"/>
<page href="flash/display/DisplayObject.html#scale9Grid" title="DisplayObject.scale9Grid" text="scale9Grid The current scaling grid that is in effect. If set to null, the entire display object is scaled normally when any scale transformation is applied. When you define the scale9Grid property, the display object is divided into a grid with nine regions based on the scale9Grid rectangle, which defines the center region of the grid. The eight other regions of the grid are the following areas: The upper-left corner outside of the rectangle The area above the rectangle The upper-right corner outside of the rectangle The area to the left of the rectangle The area to the right of the rectangle The lower-left corner outside of the rectangle The area below the rectangle The lower-right corner outside of the rectangle You can think of the eight regions outside of the center (defined by the rectangle) as being like a picture frame that has special rules applied to it when scaled. When the scale9Grid property is set and a display object is scaled, all text and gradients are scaled normally; however, for other types of objects the following rules apply: Content in the center region is scaled normally. Content in the corners is not scaled. Content in the top and bottom regions is scaled horizontally only. Content in the left and right regions is scaled vertically only. All fills (including bitmaps, video, and gradients) are stretched to fit their shapes. If a display object is rotated, all subsequent scaling is normal (and the scale9Grid property is ignored). For example, consider the following display object and a rectangle that is applied as the display object's scale9Grid: The display object. The red rectangle shows the scale9Grid. When the display object is scaled or stretched, the objects within the rectangle scale normally, but the objects outside of the rectangle scale according to the scale9Grid rules: Scaled to 75%: Scaled to 50%: Scaled to 25%: Stretched horizontally 150%: A common use for setting scale9Grid is to set up a display object to be used as a component, in which edge regions retain the same width when the component is scaled. The following code creates a Shape object with a rectangle drawn in its graphics property. The rectangle has a 20-pixel-thick line as the border and it is filled with a gradient. The timer event calls the scale() function, which scales the Shape object by adjusting the scaleX and scaleY properties. The scale9Grid applied to the Shape object prevents the rectangle's border line from scaling — only the gradient fill scales: import flash.display.Shape; import flash.display.GradientType; import flash.display.SpreadMethod; import flash.display.InterpolationMethod; import flash.geom.Matrix; import flash.geom.Rectangle; import flash.utils.Timer; import flash.events.TimerEvent; var square:Shape = new Shape(); square.graphics.lineStyle(20, 0xFFCC00); var gradientMatrix:Matrix = new Matrix(); gradientMatrix.createGradientBox(15, 15, Math.PI, 10, 10); square.graphics.beginGradientFill(GradientType.RADIAL, [0xffff00, 0x0000ff], [100, 100], [0, 0xFF], gradientMatrix, SpreadMethod.REFLECT, InterpolationMethod.RGB, 0.9); square.graphics.drawRect(0, 0, 100, 100); var grid:Rectangle = new Rectangle(20, 20, 60, 60); square.scale9Grid = grid ; addChild(square); var tim:Timer = new Timer(100); tim.start(); tim.addEventListener(TimerEvent.TIMER, scale); var scaleFactor:Number = 1.01; function scale(event:TimerEvent):void { square.scaleX *= scaleFactor; square.scaleY *= scaleFactor; if (square.scaleX &gt; 2.0) { scaleFactor = 0.99; } if (square.scaleX &lt; 1.0) { scaleFactor = 1.01; } } If you pass an invalid argument to the method."/>
<page href="flash/display/DisplayObject.html#scaleX" title="DisplayObject.scaleX" text="scaleX Indicates the horizontal scale (percentage) of the object as applied from the registration point. The default registration point is (0,0). 1.0 equals 100% scale. Scaling the local coordinate system affects the x and y property settings, which are defined in whole pixels. The following code creates a Sprite object with a rectangle drawn in its graphics property. When the user clicks the sprite, it scales by 10%: import flash.display.Sprite; import flash.events.MouseEvent; var square:Sprite = new Sprite(); square.graphics.beginFill(0xFFCC00); square.graphics.drawRect(0, 0, 100, 100); addChild(square); square.addEventListener(MouseEvent.CLICK, scale); function scale(event:MouseEvent):void { square.scaleX *= 1.10; square.scaleY *= 1.10; }"/>
<page href="flash/display/DisplayObject.html#scaleY" title="DisplayObject.scaleY" text="scaleY Indicates the vertical scale (percentage) of an object as applied from the registration point of the object. The default registration point is (0,0). 1.0 is 100% scale. Scaling the local coordinate system affects the x and y property settings, which are defined in whole pixels. The following code creates a Sprite object with a rectangle drawn in its graphics property. When the user clicks the sprite, it scales by 10%: import flash.display.Sprite; import flash.events.MouseEvent; var square:Sprite = new Sprite(); square.graphics.beginFill(0xFFCC00); square.graphics.drawRect(0, 0, 100, 100); addChild(square); square.addEventListener(MouseEvent.CLICK, scale); function scale(event:MouseEvent):void { square.scaleX *= 1.10; square.scaleY *= 1.10; }"/>
<page href="flash/display/DisplayObject.html#scrollRect" title="DisplayObject.scrollRect" text="scrollRect The scroll rectangle bounds of the display object. The display object is cropped to the size defined by the rectangle, and it scrolls within the rectangle when you change the x and y properties of the scrollRect object. The properties of the scrollRect Rectangle object use the display object's coordinate space and are scaled just like the overall display object. The corner bounds of the cropped window on the scrolling display object are the origin of the display object (0,0) and the point defined by the width and height of the rectangle. They are not centered around the origin, but use the origin to define the upper-left corner of the area. A scrolled display object always scrolls in whole pixel increments. You can scroll an object left and right by setting the x property of the scrollRect Rectangle object. You can scroll an object up and down by setting the y property of the scrollRect Rectangle object. If the display object is rotated 90° and you scroll it left and right, the display object actually scrolls up and down. The following example shows how the scrollRect property defines the scrolling area for a display object, circle. When you click the circle object, the clicked() event handler method adjusts the y property of the scrollRect property of the circle object, causing the object to scroll down: import flash.display.Sprite; import flash.geom.Rectangle; import flash.events.MouseEvent; var circle:Sprite = new Sprite(); circle.graphics.beginFill(0xFFCC00); circle.graphics.drawCircle(200, 200, 200); circle.scrollRect = new Rectangle(0, 0, 200, 200); addChild(circle); circle.addEventListener(MouseEvent.CLICK, clicked); function clicked(event:MouseEvent):void { var rect:Rectangle = event.target.scrollRect; rect.y -= 5; event.target.scrollRect = rect; }"/>
<page href="flash/display/DisplayObject.html#stage" title="DisplayObject.stage" text="stage The Stage of the display object. A Flash application has only one Stage object. For example, you can create and load multiple display objects into the display list, and the stage property of each display object refers to the same Stage object (even if the display object belongs to a loaded SWF file). If a display object is not added to the display list, its stage property is set to null. The following code creates two TextField objects and uses the width property of the Stage object to position the text fields: import flash.text.TextField; var tf1:TextField = new TextField(); tf1.text = &quot;Text Field 1&quot;; tf1.border = true; tf1.x = 10; addChild(tf1); tf1.width = tf1.stage.stageWidth / 2 - 10; var tf2:TextField = new TextField(); tf2.text = &quot;Text Field 2&quot;; tf2.border = true; tf2.x = tf1.x + tf1.width + 5; addChild(tf2); tf2.width = tf2.stage.stageWidth / 2 - 10; trace(stage.stageWidth);"/>
<page href="flash/display/DisplayObject.html#transform" title="DisplayObject.transform" text="transform An object with properties pertaining to a display object's matrix, color transform, and pixel bounds. The specific properties — matrix, colorTransform, and three read-only properties (concatenatedMatrix, concatenatedColorTransform, and pixelBounds) — are described in the entry for the Transform class. Each of the transform object's properties is itself an object. This concept is important because the only way to set new values for the matrix or colorTransform objects is to create a new object and copy that object into the transform.matrix or transform.colorTransform property. For example, to increase the tx value of a display object's matrix, you must make a copy of the entire matrix object, then copy the new object into the matrix property of the transform object: var myMatrix:Object = myDisplayObject.transform.matrix; myMatrix.tx += 10; myDisplayObject.transform.matrix = myMatrix; You cannot directly set the tx property. The following code has no effect on myDisplayObject: myDisplayObject.transform.matrix.tx += 10; You can also copy an entire transform object and assign it to another display object's transform property. For example, the following code copies the entire transform object from myOldDisplayObj to myNewDisplayObj: myNewDisplayObj.transform = myOldDisplayObj.transform; The resulting display object, myNewDisplayObj, now has the same values for its matrix, color transform, and pixel bounds as the old display object, myOldDisplayObj. The following code sets up a square Sprite object. When the user clicks the sprite, the transformer() method adjusts the colorTransform and matrix properties of the transform property of the sprite: import flash.display.Sprite; import flash.geom.ColorTransform; import flash.geom.Matrix; import flash.geom.Transform; import flash.events.MouseEvent; var square:Sprite = new Sprite(); square.graphics.lineStyle(20, 0xFF2200); square.graphics.beginFill(0x0000DD); square.graphics.drawRect(0, 0, 100, 100); addChild(square); var resultColorTransform:ColorTransform = new ColorTransform(); resultColorTransform.alphaMultiplier = 0.5; resultColorTransform.redOffset = 155; resultColorTransform.greenMultiplier = 0.5; var skewMatrix:Matrix = new Matrix(1, 1, 0, 1); square.addEventListener(MouseEvent.CLICK, transformer); function transformer(event:MouseEvent):void { var transformation:Transform = square.transform; var tempMatrix:Matrix = square.transform.matrix; tempMatrix.concat(skewMatrix); square.transform.colorTransform = resultColorTransform; square.transform.matrix = tempMatrix; }"/>
<page href="flash/display/DisplayObject.html#visible" title="DisplayObject.visible" text="visible Whether or not the display object is visible. Display objects that are not visible are disabled. For example, if visible=false for an InteractiveObject instance, it cannot be clicked. The following code uses a Timer object to call a function that periodically changes the visible property of a display object, resulting in a blinking effect: import flash.text.TextField; import flash.utils.Timer; import flash.events.TimerEvent; var tf:TextField = new TextField(); tf.text = &quot;Hello.&quot;; addChild(tf); var tim:Timer = new Timer(250); tim.start(); tim.addEventListener(TimerEvent.TIMER, blinker); function blinker(event:TimerEvent):void { tf.visible = !tf.visible; }"/>
<page href="flash/display/DisplayObject.html#width" title="DisplayObject.width" text="width Indicates the width of the display object, in pixels. The width is calculated based on the bounds of the content of the display object. When you set the width property, the scaleX property is adjusted accordingly, as shown in the following code: var rect:Shape = new Shape(); rect.graphics.beginFill(0xFF0000); rect.graphics.drawRect(0, 0, 100, 100); trace(rect.scaleX) // 1; rect.width = 200; trace(rect.scaleX) // 2; Except for TextField and Video objects, a display object with no content (such as an empty sprite) has a width of 0, even if you try to set width to a different value. The following code sets up a square Sprite object. When the user clicks the sprite, the widen() method increases the width property of the sprite: import flash.display.Sprite; import flash.events.MouseEvent; var square:Sprite = new Sprite(); square.graphics.beginFill(0xFF0000); square.graphics.drawRect(0, 0, 100, 100); addChild(square); square.addEventListener(MouseEvent.CLICK, widen); function widen(event:MouseEvent):void { square.width += 10; }"/>
<page href="flash/display/DisplayObject.html#x" title="DisplayObject.x" text="x Indicates the x coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer. If the object is inside a DisplayObjectContainer that has transformations, it is in the local coordinate system of the enclosing DisplayObjectContainer. Thus, for a DisplayObjectContainer rotated 90° counterclockwise, the DisplayObjectContainer's children inherit a coordinate system that is rotated 90° counterclockwise. The object's coordinates refer to the registration point position. The following code sets up a circle Sprite object. A Timer object is used to change the x property of the sprite every 50 milliseconds: import flash.display.Sprite; import flash.utils.Timer; import flash.events.TimerEvent; var circle:Sprite = new Sprite(); circle.graphics.beginFill(0xFF0000); circle.graphics.drawCircle(100, 100, 100); addChild(circle); var tim:Timer = new Timer(50); tim.start(); tim.addEventListener(TimerEvent.TIMER, bounce); var xInc:Number = 2; function bounce(event:TimerEvent):void { circle.x += xInc; if (circle.x &gt; circle.width) { xInc = -2; } if (circle.x &lt; 0) { xInc = 2; } }"/>
<page href="flash/display/DisplayObject.html#y" title="DisplayObject.y" text="y Indicates the y coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer. If the object is inside a DisplayObjectContainer that has transformations, it is in the local coordinate system of the enclosing DisplayObjectContainer. Thus, for a DisplayObjectContainer rotated 90° counterclockwise, the DisplayObjectContainer's children inherit a coordinate system that is rotated 90° counterclockwise. The object's coordinates refer to the registration point position. The following code creates two TextField objects and adjusts the height property of each based on the textHeight property of each; it also positions the second text field by setting its y property: import flash.text.TextField; var tf1:TextField = new TextField(); tf1.text = &quot;Text Field 1&quot;; tf1.border = true; tf1.wordWrap = true; tf1.width = 40; tf1.height = tf1.textHeight + 5; addChild(tf1); var tf2:TextField = new TextField(); tf2.text = &quot;Text Field 2&quot;; tf2.border = true; tf2.wordWrap = true; tf2.width = 40; tf2.height = tf2.textHeight + 5; tf2.y = tf1.y + tf1.height + 5; addChild(tf2);"/>
<page href="flash/display/DisplayObject.html#event:added" title="DisplayObject.added" text="added Dispatched when a display object is added to the display list. The following methods trigger this event: DisplayObjectContainer.addChild(), DisplayObjectContainer.addChildAt()."/>
<page href="flash/display/DisplayObject.html#event:addedToStage" title="DisplayObject.addedToStage" text="addedToStage Dispatched when a display object is added to the on stage display list, either directly or through the addition of a sub tree in which the display object is contained. The following methods trigger this event: DisplayObjectContainer.addChild(), DisplayObjectContainer.addChildAt()."/>
<page href="flash/display/DisplayObject.html#event:enterFrame" title="DisplayObject.enterFrame" text="enterFrame Dispatched when the playhead is entering a new frame. If the playhead is not moving, or if there is only one frame, this event is dispatched continuously in conjunction with the frame rate. This event is dispatched simultaneously to all display objects listenting for this event."/>
<page href="flash/display/DisplayObject.html#event:removed" title="DisplayObject.removed" text="removed Dispatched when a display object is about to be removed from the display list. Two methods of the DisplayObjectContainer class generate this event: removeChild() and removeChildAt(). The following methods of a DisplayObjectContainer object also generate this event if an object must be removed to make room for the new object: addChild(), addChildAt(), and setChildIndex()."/>
<page href="flash/display/DisplayObject.html#event:removedFromStage" title="DisplayObject.removedFromStage" text="removedFromStage Dispatched when a display object is about to be removed from the display list, either directly or through the removal of a sub tree in which the display object is contained. Two methods of the DisplayObjectContainer class generate this event: removeChild() and removeChildAt(). The following methods of a DisplayObjectContainer object also generate this event if an object must be removed to make room for the new object: addChild(), addChildAt(), and setChildIndex()."/>
<page href="flash/display/DisplayObject.html#event:render" title="DisplayObject.render" text="render Dispatched when the display list is about to be updated and rendered. This event provides the last opportunity for objects listening for this event to make changes before the display list is rendered. Flash Player renders the display list as the default behavior. You must call the invalidate() method of the Stage object each time you want Flash Player to send a render event. Render events are dispatched to an object only if there is mutual trust between it and the object that called Stage.invalidate(). Note: This event is not dispatched if the Flash Player window is not rendering. This is the case when the Flash Player window is either minimized or obscured."/>
<page href="flash/display/Stage.html" title="Stage class" text="Stage The Stage class represents the main drawing area. The Stage represents the entire area where Flash® content is shown. The Stage object is not globally accessible. You need to access it through the stage property of a DisplayObject instance. The Stage class has several ancestor classes — DisplayObjectContainer, InteractiveObject, DisplayObject, and EventDispatcher — from which it inherits properties and methods. Many of these properties and methods are either inapplicable to Stage objects, or require security checks when called on a Stage object. The properties and methods that require security checks are documented as part of the Stage class. In addition, the following inherited properties are inapplicable to Stage objects. If you try to set them, an IllegalOperationError is thrown. These properties may always be read, but since they cannot be set, they will always contain default values. accessibilityProperties alpha blendMode cacheAsBitmap contextMenu filters focusRect loaderInfo mask mouseEnabled name opaqueBackground rotation scale9Grid scaleX scaleY scrollRect tabEnabled tabIndex transform visible x y"/>
<page href="flash/display/Stage.html#addChild()" title="Stage.addChild()" text="addChild Adds a child DisplayObject instance to this DisplayObjectContainer instance. The child is added to the front (top) of all other children in this DisplayObjectContainer instance. (To add a child to a specific index position, use the addChildAt() method.) If you add a child object that already has a different display object container as a parent, the object is removed from the child list of the other display object container. child The DisplayObject instance to add as a child of this DisplayObjectContainer instance. Calling the addChild() method of a Stage object throws an exception for any caller that is not in the same security sandbox as the Stage owner (the main SWF file). To avoid this, the Stage owner can grant permission to the domain of the caller by calling the Security.allowDomain() method or the Security.allowInsecureDomain() method. For more information, see the &quot;Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/display/Stage.html#addChildAt()" title="Stage.addChildAt()" text="addChildAt Adds a child DisplayObject instance to this DisplayObjectContainer instance. The child is added at the index position specified. An index of 0 represents the back (bottom) of the display list for this DisplayObjectContainer object. For example, the following example shows three display objects, labeled a, b, and c, at index positions 0, 2, and 1, respectively: If you add a child object that already has a different display object container as a parent, the object is removed from the child list of the other display object container. child index The DisplayObject instance to add as a child of this DisplayObjectContainer instance. The index position to which the child is added. If you specify a currently occupied index position, the child object that exists at that position and all higher positions are moved up one position in the child list. Calling the addChildAt() method of a Stage object throws an exception for any caller that is not in the same security sandbox as the Stage owner (the main SWF file). To avoid this, the Stage owner can grant permission to the domain of the caller by calling the Security.allowDomain() method or the Security.allowInsecureDomain() method. For more information, see the &quot;Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/display/Stage.html#addEventListener()" title="Stage.addEventListener()" text="addEventListener Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event. You can register event listeners on all nodes in the display list for a specific type of event, phase, and priority. After you successfully register an event listener, you cannot change its priority through additional calls to addEventListener(). To change a listener's priority, you must first call removeListener(). Then you can register the listener again with the new priority level. Keep in mind that after the listener is registered, subsequent calls to addEventListener() with a different type or useCapture value result in the creation of a separate listener registration. For example, if you first register a listener with useCapture set to true, it listens only during the capture phase. If you call addEventListener() again using the same listener object, but with useCapture set to false, you have two separate listeners: one that listens during the capture phase and another that listens during the target and bubbling phases. You cannot register an event listener for only the target phase or the bubbling phase. Those phases are coupled during registration because bubbling applies only to the ancestors of the target node. If you no longer need an event listener, remove it by calling removeEventListener(), or memory problems could result. Objects with registered event listeners are not automatically removed from memory because the garbage collector does not remove objects that still have references. Copying an EventDispatcher instance does not copy the event listeners attached to it. (If your newly created node needs an event listener, you must attach the listener after creating the node). However, if you move an EventDispatcher instance, the event listeners attached to it move along with it. If the event listener is being registered on a node while an event is being processed on this node, the event listener is not triggered during the current phase but can be triggered during a later phase in the event flow, such as the bubbling phase. If an event listener is removed from a node while an event is being processed on the node, it is still triggered by the current actions. After it is removed, the event listener is never invoked again (unless registered again for future processing). type listener useCapture priority useWeakReference The type of event. The listener function that processes the event. This function must accept an Event object as its only parameter and must return nothing, as this example shows: function(evt:Event):void The function can have any name. Determines whether the listener works in the capture phase or the target and bubbling phases. If useCapture is set to true, the listener processes the event only during the capture phase and not in the target or bubbling phase. If useCapture is false, the listener processes the event only during the target or bubbling phase. To listen for the event in all three phases, call addEventListener twice, once with the useCapture set to true, then again with useCapture set to false. The priority level of the event listener. The priority is designated by a signed 32-bit integer. The higher the number, the higher the priority. All listeners with priority n are processed before listeners of priority n-1. If two or more listeners share the same priority, they are processed in the order in which they were added. The default priority is 0. Determines whether the reference to the listener is strong or weak. A strong reference (the default) prevents your listener from being garbage-collected. A weak reference does not. Class-level member functions are not subject to garbage collection, so you can set useWeakReference to true for class-level member functions without subjecting them to garbage collection. If you set useWeakReference to true for a listener that is a nested inner function, the function will be garbge-collected and no longer persistent. If you create references to the inner function (save it in another variable) then it is not garbage-collected and stays persistent. Calling the addEventListener method of a Stage object throws an exception for any caller that is not in the same security sandbox as the Stage owner (the main SWF file). To avoid this situation, the Stage owner can grant permission to the domain of the caller by calling the Security.allowDomain() method or the Security.allowInsecureDomain() method. For more information, see the &quot;Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/display/Stage.html#dispatchEvent()" title="Stage.dispatchEvent()" text="dispatchEvent Dispatches an event into the event flow. The event target is the EventDispatcher object upon which the dispatchEvent() method is called. event The Event object that is dispatched into the event flow. If the event is being redispatched, a clone of the event is created automatically. After an event is dispatched, its target property cannot be changed, so you must create a new copy of the event for redispatching to work. Calling the dispatchEvent() method of a Stage object throws an exception for any caller that is not in the same security sandbox as the Stage owner (the main SWF file). To avoid this, the Stage owner can grant permission to the domain of the caller by calling the Security.allowDomain() method or the Security.allowInsecureDomain() method. For more information, see the &quot;Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/display/Stage.html#hasEventListener()" title="Stage.hasEventListener()" text="hasEventListener Checks whether the EventDispatcher object has any listeners registered for a specific type of event. This allows you to determine where an EventDispatcher object has altered handling of an event type in the event flow hierarchy. To determine whether a specific event type actually triggers an event listener, use willTrigger(). The difference between hasEventListener() and willTrigger() is that hasEventListener() examines only the object to which it belongs, whereas willTrigger() examines the entire event flow for the event specified by the type parameter. When hasEventListener() is called from a LoaderInfo object, only the listeners that the caller can access are considered. type The type of event. Calling the hasEventListener() method of a Stage object throws an exception for any caller that is not in the same security sandbox as the Stage owner (the main SWF file). To avoid this, the Stage owner can grant permission to the domain of the caller by calling the Security.allowDomain() method or the Security.allowInsecureDomain() method. For more information, see the &quot;Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/display/Stage.html#invalidate()" title="Stage.invalidate()" text="invalidate Calling the invalidate() method signals Flash Player to alert display objects on the next opportunity it has to render the display list (for example, when the playhead advances to a new frame). After you call the invalidate() method, when the display list is next rendered, Flash Player sends a render event to each display object that has registered to listen for the render event. You must call the invalidate() method each time you want Flash Player to send render events. The render event gives you an opportunity to make changes to the display list immediately before it is actually rendered. This lets you defer updates to the display list until the latest opportunity. This can increase performance by eliminating unnecessary screen updates. The render event is dispatched only to display objects that are in the same security domain as the code that calls the stage.invalidate() method, or to display objects from a security domain that has been granted permission via the Security.allowDomain() method."/>
<page href="flash/display/Stage.html#isFocusInaccessible()" title="Stage.isFocusInaccessible()" text="isFocusInaccessible Determines whether the Stage.focus property returns null for security reasons. In other words, isFocusInaccessible returns true if the object that has focus belongs to a security sandbox to which the SWF file does not have access."/>
<page href="flash/display/Stage.html#removeChildAt()" title="Stage.removeChildAt()" text="removeChildAt Removes a child DisplayObject from the specified index position in the child list of the DisplayObjectContainer. The parent property of the removed child is set to null, and the object is garbage collected if no other references to the child exist. The index positions of any display objects above the child in the DisplayObjectContainer are decreased by 1. The garbage collector is the process by which Flash Player reallocates unused memory space. When a variable or object is no longer actively referenced or stored somewhere, the garbage collector sweeps through and wipes out the memory space it used to occupy if no other references to it exist. index The child index of the DisplayObject to remove. Calling the removeChildAt() method of a Stage object throws an exception for any caller that is not in the same security sandbox as the object to be removed. To avoid this, the owner of that object can grant permission to the domain of the caller by calling the Security.allowDomain() method or the Security.allowInsecureDomain() method. For more information, see the &quot;Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/display/Stage.html#setChildIndex()" title="Stage.setChildIndex()" text="setChildIndex Changes the position of an existing child in the display object container. This affects the layering of child objects. For example, the following example shows three display objects, labeled a, b, and c, at index positions 0, 1, and 2, respectively: When you use the setChildIndex() method and specify an index position that is already occupied, the child that occupies that position and all objects higher in the child list move up one position in the list. For example, if the display object container in the previous example is named container, you can swap the position of the display objects labeled a and b by calling the following code: container.setChildIndex(container.getChildAt(1), 0); This code results in the following arrangement of objects: child index The child DisplayObject instance for which you want to change the index number. The resulting index number for the child display object. Calling the setChildIndex() method of a Stage object throws an exception for any caller that is not in the same security sandbox as the Stage owner (the main SWF file). To avoid this, the Stage owner can grant permission to the domain of the caller by calling the Security.allowDomain() method or the Security.allowInsecureDomain() method. For more information, see the &quot;Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/display/Stage.html#swapChildrenAt()" title="Stage.swapChildrenAt()" text="swapChildrenAt Swaps the z-order (front-to-back order) of the child objects at the two specified index positions in the child list. All other child objects in the display object container remain in the same index positions. index1 index2 The index position of the first child object. The index position of the second child object. Calling the swapChildrenAt() method of a Stage object throws an exception for any caller that is not in the same security sandbox as the owner of either of the objects to be swapped. To avoid this, the object owners can grant permission to the domain of the caller by calling the Security.allowDomain() method or the Security.allowInsecureDomain() method. For more information, see the &quot;Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/display/Stage.html#willTrigger()" title="Stage.willTrigger()" text="willTrigger Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type. This method returns true if an event listener is triggered during any phase of the event flow when an event of the specified type is dispatched to this EventDispatcher object or any of its descendants. The difference between the hasEventListener() and the willTrigger() methods is that hasEventListener() examines only the object to which it belongs, whereas the willTrigger() method examines the entire event flow for the event specified by the type parameter. When willTrigger() is called from a LoaderInfo object, only the listeners that the caller can access are considered. type The type of event. Calling the willTrigger() method of a Stage object throws an exception for any caller that is not in the same security sandbox as the Stage owner (the main SWF file). To avoid this, the Stage owner can grant permission to the domain of the caller by calling the Security.allowDomain() method or the Security.allowInsecureDomain() method. For more information, see the &quot;Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/display/Stage.html#align" title="Stage.align" text="align A value from the StageAlign class that specifies the alignment of the stage in Flash Player or the browser. The following are valid values: Value Vertical Alignment Horizontal StageAlign.TOP Top Center StageAlign.BOTTOM Bottom Center StageAlign.LEFT Center Left StageAlign.RIGHT Center Right StageAlign.TOP_LEFT Top Left StageAlign.TOP_RIGHT Top Right StageAlign.BOTTOM_LEFT Bottom Left StageAlign.BOTTOM_RIGHT Bottom Right The align property is only available to an object that is in the same security sandbox as the Stage owner (the main SWF file). To avoid this, the Stage owner can grant permission to the domain of the calling object by calling the Security.allowDomain() method or the Security.alowInsecureDomain() method. For more information, see the &quot;Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/display/Stage.html#displayState" title="Stage.displayState" text="displayState A value from the StageDisplayState class that specifies which display state to use. The following are valid values: StageDisplayState.FULL_SCREEN Sets Flash Player to expand the stage over the user's entire screen. StageDisplayState.NORMAL Sets the player back to the standard stage display mode. The scaling behavior of the movie in full-screen mode is determined by the scaleMode setting (set using the Stage.scaleMode property or the SWF file's embed tag settings in the HTML file). If the scaleMode property is set to noScale while Flash Player transitions to full-screen mode, the Stage width and height properties are updated, and Flash Player dispatches the Stage.resize event. The following restrictions apply to SWF files that play within an HTML page (not those using the stand-alone Flash Player): To enable full-screen mode, add the allowFullScreen parameter to the object and embed tags in the HTML page that includes the SWF file, with allowFullScreen set to &quot;true&quot;, as shown in the following example: &lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot; /&gt; ... &lt;embed src=&quot;example.swf&quot; allowFullScreen=&quot;true&quot; ... &gt; An HTML page may also use a script to generate SWF-embedding tags. You need to alter the script so that it inserts the proper allowFullScreen settings. HTML pages generated by Flash and Flex Builder use the AC_FL_RunContent() function to embed references to SWF files, and you need to add the allowFullScreen parameter settings, as in the following: AC_FL_RunContent( ... &quot;allowFullScreen&quot;, &quot;true&quot;, ... ) Full-screen mode is initiated in response to a mouse click or key press by the user; the movie cannot change Stage.displayState without user input. While Flash Player is in full-screen mode, all keyboard input is disabled (except keyboard shortcuts that take the user out of full-screen mode). A Flash Player dialog box appears over the movie when users enter full-screen mode to inform the users they are in full-screen mode and that they can press the Escape key to end full-screen mode. Starting with Flash Player Update 3 and later, full-screen works the same in windowless mode as it does in window mode. If you set the Window Mode (wmode in the HTML) to Opaque Windowless (opaque) or Transparent Windowless (transparent), full-screen can be initiated, but the full-screen window will always be opaque. The following example creates an interactive demonstration of how to create a fullscreen experience by modifying the displayState property. Note: Fullscreen can only be triggered in certain situations, such as if the user has clicked or pressed a key, due to security restrictions. When run in a browser, the allowFullScreen property must be set to true. package { import flash.display.Sprite; import flash.display.Stage; import flash.events.*; import flash.net.NetConnection; import flash.net.NetStream; import flash.media.Video; public class FullScreenExample extends Sprite { private var videoURL:String = &quot;testVideo.flv&quot;; private var connection:NetConnection; private var stream:NetStream; private var video:Video; public function FullScreenExample() { connection = new NetConnection(); connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); connection.connect(null); loaderInfo.addEventListener(Event.INIT, createMouseListener); } private function createMouseListener(event:Event):void { stage.addEventListener(MouseEvent.CLICK,toggleFullScreen); } private function toggleFullScreen(event:MouseEvent):void { switch(stage.displayState) { case &quot;normal&quot;: stage.displayState = &quot;fullScreen&quot;; break; case &quot;fullScreen&quot;: default: stage.displayState = &quot;normal&quot;; break; } } // Video related: private function netStatusHandler(event:NetStatusEvent):void { switch (event.info.code) { case &quot;NetConnection.Connect.Success&quot;: connectStream(); break; case &quot;NetStream.Play.StreamNotFound&quot;: trace(&quot;Unable to locate video: &quot; + videoURL); break; } } private function connectStream():void { var stream:NetStream = new NetStream(connection); stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler); video = new Video(stage.stageWidth,stage.stageHeight); video.attachNetStream(stream); stream.play(videoURL); addChild(video); } private function securityErrorHandler(event:SecurityErrorEvent):void { trace(&quot;securityErrorHandler: &quot; + event); } private function asyncErrorHandler(event:AsyncErrorEvent):void { // ignore AsyncErrorEvent events. } } } Calling the displayState property of a Stage object throws an exception for any caller that is not in the same security sandbox as the Stage owner (the main SWF file). To avoid this, the Stage owner can grant permission to the domain of the caller by calling the Security.allowDomain() method or the Security.allowInsecureDomain() method. For more information, see the &quot;Security&quot; chapter in Programming ActionScript 3.0. Trying to set the displayState property while the settings dialog is displayed, without a user response, or if the param or embed HTML tag's allowFullScreen attribute is not set to true throws a security error."/>
<page href="flash/display/Stage.html#focus" title="Stage.focus" text="focus The interactive object with keyboard focus; or null if focus is not set or if the focused object belongs to a security sandbox to which the calling object does not have access. Throws an error if focus cannot be set to the target."/>
<page href="flash/display/Stage.html#frameRate" title="Stage.frameRate" text="frameRate Gets and sets the frame rate of the stage. The frame rate is defined as frames per second. By default the rate is set to the frame rate of the first SWF file loaded. Valid range for the frame rate is from 0.01 to 1000 frames per second. Note: Flash Player might not be able to follow high frame rate settings, either because the target platform is not fast enough or the player is synchronized to the vertical blank timing of the display device (usually 60 Hz on LCD devices). In some cases, a target platform might also choose to lower the maximum frame rate if it anticipates high CPU usage. Calling the frameRate property of a Stage object throws an exception for any caller that is not in the same security sandbox as the Stage owner (the main SWF file). To avoid this, the Stage owner can grant permission to the domain of the caller by calling the Security.allowDomain() method or the Security.allowInsecureDomain() method. For more information, see the &quot;Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/display/Stage.html#fullScreenHeight" title="Stage.fullScreenHeight" text="fullScreenHeight Returns the height of the monitor that will be used when going to full screen size, if that state is entered immediately. If the user has multiple monitors, the monitor that's used is the monitor that most of the stage is on at the time. Note: If the user has the opportunity to move the browser from one monitor to another between retrieving the value and going to full screen size, the value could be incorrect. If you retrieve the value in an event handler that sets Stage.displayState to StageDisplayState.FULL_SCREEN, the value will be correct. This is the pixel height of the monitor and is the same as the stage height would be if Stage.align is set to StageAlign.TOP_LEFT and Stage.scaleMode is set to StageScaleMode.NO_SCALE. Player Version: Flash Player 9 Update 3. This example creates a green rectangle the size of the stage and places a red square on it that it activates as a button. Clicking the red square triggers the enterFullScreen() event handler, which sets the fullScreenSourceRect property and enters full screen mode. To set the fullScreenSourceRect property, the event handler starts with the location and dimensions of the red square. It then compares the aspect ratio (width divided by height) of the red square to the aspect ratio of the stage at full screen width and height so that it can expand the rectangle (fullScreenSourceRect) to match the screen's aspect ratio. The result is that the red square occupies the entire height of the monitor with the green background visible on each side. If the aspect ratio was not matched, the stage background color, which is white by default, would show on each side instead of the green background. Note: Test this example in the browser. In the Flash Publish Settings dialog, on the HTML tab, select the template Flash Only - Allow Full Screen. Specify the Flash Player version for Update 3, and make sure the Flash and HTML formats are selected on the Formats tab. Then publish and open the resulting HTML file in the browser. import flash.display.Sprite; import flash.display.Stage; import flash.display.StageDisplayState; import flash.events.MouseEvent; import flash.geom.Rectangle; // cover the stage with a green rectangle var greenRect:Sprite = new Sprite(); greenRect.graphics.beginFill(0x00FF00); greenRect.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight); addChild(greenRect); // create red square on stage, turn it into a button for going to full screen var redSquare:Sprite = new Sprite(); redSquare.graphics.beginFill(0xFF0000); redSquare.graphics.drawRect(0, 0, 300, 300); redSquare.x = 50; redSquare.y = 50; redSquare.addEventListener(MouseEvent.CLICK, enterFullScreen); redSquare.buttonMode = true; addChild(redSquare); function enterFullScreen(e:MouseEvent):void { // we will go to full screen zoomed in on the red square var redSquare:Sprite = e.target as Sprite; var fullScreenRect:Rectangle = new Rectangle(redSquare.x, redSquare.y, redSquare.width, redSquare.height); // calculate aspect ratio of the red square var rectAspectRatio:Number = fullScreenRect.width / fullScreenRect.height; // calculate aspect ratio of the screen var screenAspectRatio:Number = stage.fullScreenWidth / stage.fullScreenHeight; // change the fullScreenRect so that it covers the entire screen, keeping it centered on the redSquare // try commenting out this section to see what happens if you do not fix the aspect ratio. if (rectAspectRatio &gt; screenAspectRatio) { var newHeight:Number = fullScreenRect.width / screenAspectRatio; fullScreenRect.y -= ((newHeight - fullScreenRect.height) / 2); fullScreenRect.height = newHeight; } else if (rectAspectRatio &lt; screenAspectRatio) { var newWidth:Number = fullScreenRect.height * screenAspectRatio; fullScreenRect.x -= ((newWidth - fullScreenRect.width) / 2); fullScreenRect.width = newWidth; } // go to full screen stage.fullScreenSourceRect = fullScreenRect; stage.displayState = StageDisplayState.FULL_SCREEN; }"/>
<page href="flash/display/Stage.html#fullScreenSourceRect" title="Stage.fullScreenSourceRect" text="fullScreenSourceRect Sets Flash Player to scale a specific region of the stage to full-screen mode. If available, Flash Player scales in hardware, which uses the graphics and video card on a user's computer, and generally displays content more quickly than software scaling. When this property is set to a valid rectangle and the displayState property is set to full-screen mode, Flash Player scales the specified area. The actual Stage size in pixels within ActionScript does not change. Flash Player enforces a minimum limit for the size of the rectangle to accommodate the standard &quot;Press Esc to exit full-screen mode&quot; message. This limit is usually around 260 by 30 pixels but can vary on platform and Flash Player version. This property can only be set when Flash Player is not in full-screen mode. To use this property correctly, set this property first, then set the displayState property to full-screen mode, as shown in the code examples. To enable scaling, set the fullScreenSourceRect property to a rectangle object: // valid, will enable hardware scaling stage.fullScreenSourceRect = new Rectangle(0,0,320,240); To disable scaling, set the fullScreenSourceRect=null in ActionScript 3.0, and undefined in ActionScript 2.0. stage.fullScreenSourceRect = null; The end user also can select within Flash Player Display Settings to turn off hardware scaling, which is enabled by default. For more information, see www.adobe.com/go/display_settings. Player Version: Flash Player 9 Update 3. To take advantage of hardware scaling, you set the whole stage or part of the stage to full-screen mode. The following ActionScript 3.0 code sets the whole stage to full-screen mode: import flash.geom.*; { stage.fullScreenSourceRect = new Rectangle(0,0,320,240); stage.displayState = StageDisplayState.FULL_SCREEN; }"/>
<page href="flash/display/Stage.html#fullScreenWidth" title="Stage.fullScreenWidth" text="fullScreenWidth Returns the width of the monitor that will be used when going to full screen size, if that state is entered immediately. If the user has multiple monitors, the monitor that's used is the monitor that most of the stage is on at the time. Note: If the user has the opportunity to move the browser from one monitor to another between retrieving the value and going to full screen size, the value could be incorrect. If you retrieve the value in an event handler that sets Stage.displayState to StageDisplayState.FULL_SCREEN, the value will be correct. This is the pixel width of the monitor and is the same as the stage width would be if Stage.align is set to StageAlign.TOP_LEFT and Stage.scaleMode is set to StageScaleMode.NO_SCALE. Player Version: Flash Player 9 Update 3. This example creates a green rectangle the size of the stage and places a red square on it that it activates as a button. Clicking the red square triggers the enterFullScreen() event handler, which sets the fullScreenSourceRect property and enters full screen mode. To set the fullScreenSourceRect property, the event handler starts with the location and dimensions of the red square. It then compares the aspect ratio (width divided by height) of the red square to the aspect ratio of the stage at full screen width and height so that it can expand the rectangle (fullScreenSourceRect) to match the screen's aspect ratio. The result is that the red square occupies the entire height of the monitor with the green background visible on each side. If the aspect ratio was not matched, the stage background color, which is white by default, would show on each side instead of the green background. Note: Test this example in the browser. In the Flash Publish Settings dialog, on the HTML tab, select the template Flash Only - Allow Full Screen. Specify the Flash Player version for Update 3, and make sure the Flash and HTML formats are selected on the Formats tab. Then publish and open the resulting HTML file in the browser. import flash.display.Sprite; import flash.display.Stage; import flash.display.StageDisplayState; import flash.events.MouseEvent; import flash.geom.Rectangle; // cover the stage with a green rectangle var greenRect:Sprite = new Sprite(); greenRect.graphics.beginFill(0x00FF00); greenRect.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight); addChild(greenRect); // create red square on stage, turn it into a button for going to full screen var redSquare:Sprite = new Sprite(); redSquare.graphics.beginFill(0xFF0000); redSquare.graphics.drawRect(0, 0, 300, 300); redSquare.x = 50; redSquare.y = 50; redSquare.addEventListener(MouseEvent.CLICK, enterFullScreen); redSquare.buttonMode = true; addChild(redSquare); function enterFullScreen(e:MouseEvent):void { // we will go to full screen zoomed in on the red square var redSquare:Sprite = e.target as Sprite; var fullScreenRect:Rectangle = new Rectangle(redSquare.x, redSquare.y, redSquare.width, redSquare.height); // calculate aspect ratio of the red square var rectAspectRatio:Number = fullScreenRect.width / fullScreenRect.height; // calculate aspect ratio of the screen var screenAspectRatio:Number = stage.fullScreenWidth / stage.fullScreenHeight; // change the fullScreenRect so that it covers the entire screen, keeping it centered on the redSquare // try commenting out this section to see what happens if you do not fix the aspect ratio. if (rectAspectRatio &gt; screenAspectRatio) { var newHeight:Number = fullScreenRect.width / screenAspectRatio; fullScreenRect.y -= ((newHeight - fullScreenRect.height) / 2); fullScreenRect.height = newHeight; } else if (rectAspectRatio &lt; screenAspectRatio) { var newWidth:Number = fullScreenRect.height * screenAspectRatio; fullScreenRect.x -= ((newWidth - fullScreenRect.width) / 2); fullScreenRect.width = newWidth; } // go to full screen stage.fullScreenSourceRect = fullScreenRect; stage.displayState = StageDisplayState.FULL_SCREEN; }"/>
<page href="flash/display/Stage.html#height" title="Stage.height" text="height Indicates the height of the display object, in pixels. The height is calculated based on the bounds of the content of the display object. When you set the height property, the scaleY property is adjusted accordingly, as shown in the following code: var rect:Shape = new Shape(); rect.graphics.beginFill(0xFF0000); rect.graphics.drawRect(0, 0, 100, 100); trace(rect.scaleY) // 1; rect.height = 200; trace(rect.scaleY) // 2; Except for TextField and Video objects, a display object with no content (such as an empty sprite) has a height of 0, even if you try to set height to a different value. Referencing the height property of a Stage object throws an exception for any caller that is not in the same security sandbox as the Stage owner (the main SWF file). To avoid this, the Stage owner can grant permission to the domain of the caller by calling the Security.allowDomain() method or the Security.allowInsecureDomain() method. For more information, see the &quot;Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/display/Stage.html#mouseChildren" title="Stage.mouseChildren" text="mouseChildren Determines whether or not the children of the object are mouse enabled. If an object is mouse enabled, a user can interact with it by using a mouse. The default is true. This property is useful when you create a button with an instance of the Sprite class (instead of using the SimpleButton class). When you use a Sprite instance to create a button, you can choose to decorate the button by using the addChild() method to add additional Sprite instances. This process can cause unexpected behavior with mouse events because the Sprite instances you add as children can become the target object of a mouse event when you expect the parent instance to be the target object. To ensure that the parent instance serves as the target objects for mouse events, you can set the mouseChildren property of the parent instance to false. No event is dispatched by setting this property. You must use the addEventListener() method to create interactive functionality. Referencing the mouseChildren property of a Stage object throws an exception for any caller that is not in the same security sandbox as the Stage owner (the main SWF file). To avoid this, the Stage owner can grant permission to the domain of the caller by calling the Security.allowDomain() method or the Security.allowInsecureDomain() method. For more information, see the &quot;Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/display/Stage.html#numChildren" title="Stage.numChildren" text="numChildren Returns the number of children of this object. Referencing the numChildren property of a Stage object throws an exception for any caller that is not in the same security sandbox as the Stage owner (the main SWF file). To avoid this, the Stage owner can grant permission to the domain of the caller by calling the Security.allowDomain() method or the Security.allowInsecureDomain() method. For more information, see the &quot;Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/display/Stage.html#quality" title="Stage.quality" text="quality A value from the StageQuality class that specifies which rendering quality Flash Player uses. The following are valid values: StageQuality.LOW—Low rendering quality. Graphics are not anti-aliased, and bitmaps are not smoothed. StageQuality.MEDIUM—Medium rendering quality. Graphics are anti-aliased using a 2 x 2 pixel grid, but bitmaps are not smoothed. This setting is suitable for movies that do not contain text. StageQuality.HIGH—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 that Flash Player uses. StageQuality.BEST—Very high rendering quality. Graphics are anti-aliased using a 4 x 4 pixel grid and bitmaps are always smoothed. Note: The operating system draws the device fonts, which are therefore unaffected by the quality property. Calling the quality property of a Stage object throws an exception for any caller that is not in the same security sandbox as the Stage owner (the main SWF file). To avoid this, the Stage owner can grant permission to the domain of the caller by calling the Security.allowDomain() method or the Security.allowInsecureDomain() method. For more information, see the &quot;Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/display/Stage.html#scaleMode" title="Stage.scaleMode" text="scaleMode A value from the StageScaleMode class that specifies which scale mode to use. The following are valid values: StageScaleMode.EXACT_FIT—The entire Flash application is visible in the specified area without distortion while maintaining the original aspect ratio of the application. Borders can appear on two sides of the application. StageScaleMode.SHOW_ALL—The entire Flash application is visible in the specified area without trying to preserve the original aspect ratio. Distortion can occur. StageScaleMode.NO_BORDER—The entire Flash application fills the specified area, without distortion but possibly with some cropping, while maintaining the original aspect ratio of the application. StageScaleMode.NO_SCALE—The entire Flash application is fixed, so that it remains unchanged even as the size of the player window changes. Cropping might occur if the player window is smaller than the content. Calling the scaleMode property of a Stage object throws an exception for any caller that is not in the same security sandbox as the Stage owner (the main SWF file). To avoid this, the Stage owner can grant permission to the domain of the caller by calling the Security.allowDomain() method or the Security.allowInsecureDomain() method. For more information, see the &quot;Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/display/Stage.html#showDefaultContextMenu" title="Stage.showDefaultContextMenu" text="showDefaultContextMenu Specifies whether to show or hide the default items in the Flash Player context menu. If the showDefaultContextMenu property is set to true (the default), all context menu items appear. If the showDefaultContextMenu property is set to false, only the Settings and About Adobe Flash Player menu items appear. Calling the showDefaultContextMenu property of a Stage object throws an exception for any caller that is not in the same security sandbox as the Stage owner (the main SWF file). To avoid this, the Stage owner can grant permission to the domain of the caller by calling the Security.allowDomain() method or the Security.allowInsecureDomain() method. For more information, see the &quot;Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/display/Stage.html#stageFocusRect" title="Stage.stageFocusRect" text="stageFocusRect Specifies whether or not objects display a glowing border when they have focus. Calling the stageFocusRect property of a Stage object throws an exception for any caller that is not in the same security sandbox as the Stage owner (the main SWF file). To avoid this, the Stage owner can grant permission to the domain of the caller by calling the Security.allowDomain() method or the Security.allowInsecureDomain() method. For more information, see the &quot;Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/display/Stage.html#stageHeight" title="Stage.stageHeight" text="stageHeight The current height, in pixels, of the Stage. When the value of the Stage.scaleMode property is set to StageScaleMode.NO_SCALE, the stageHeight property represents the height of the Flash Player window. When the value of Stage.scaleMode is not set to StageScaleMode.NO_SCALE, stageHeight represents the height of the SWF file. This property cannot be set. Calling the stageHeight property of a Stage object throws an exception for any caller that is not in the same security sandbox as the Stage owner (the main SWF file). To avoid this, the Stage owner can grant permission to the domain of the caller by calling the Security.allowDomain() method or the Security.allowInsecureDomain() method. For more information, see the &quot;Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/display/Stage.html#stageWidth" title="Stage.stageWidth" text="stageWidth Specifies the current width, in pixels, of the Stage. When the value of the scaleMode property is set to StageScaleMode.NO_SCALE, the stageWidth property represents the width of Flash Player. This means that the stageWidth property varies as you resize the Flash Player window. When the value of the scaleMode property is not set to StageScaleMode.NO_SCALE, the stageWidth property represents the width of the SWF file as set during authoring in the Document Properties dialog box. This means that the value of the stageWidth property stays constant as you resize the Flash Player window. This property cannot be set. Calling the stageWidth property of a Stage object throws an exception for any caller that is not in the same security sandbox as the Stage owner (the main SWF file). To avoid this, the Stage owner can grant permission to the domain of the caller by calling the Security.allowDomain() method or the Security.allowInsecureDomain() method. For more information, see the &quot;Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/display/Stage.html#tabChildren" title="Stage.tabChildren" text="tabChildren Determines whether the children of the object are tab enabled. Enables or disables tabbing for the children of the object. The default is true. Referencing the tabChildren property of a Stage object throws an exception for any caller that is not in the same security sandbox as the Stage owner (the main SWF file). To avoid this, the Stage owner can grant permission to the domain of the caller by calling the Security.allowDomain() method or the Security.allowInsecureDomain() method. For more information, see the &quot;Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/display/Stage.html#textSnapshot" title="Stage.textSnapshot" text="textSnapshot Returns a TextSnapshot object for this DisplayObjectContainer instance. Referencing the textSnapshot property of a Stage object throws an exception because the Stage class does not implement this property. To avoid this, call the textSnapshot property of a display object container other than the Stage object."/>
<page href="flash/display/Stage.html#width" title="Stage.width" text="width Indicates the width of the display object, in pixels. The width is calculated based on the bounds of the content of the display object. When you set the width property, the scaleX property is adjusted accordingly, as shown in the following code: var rect:Shape = new Shape(); rect.graphics.beginFill(0xFF0000); rect.graphics.drawRect(0, 0, 100, 100); trace(rect.scaleX) // 1; rect.width = 200; trace(rect.scaleX) // 2; Except for TextField and Video objects, a display object with no content (such as an empty sprite) has a width of 0, even if you try to set width to a different value. Referencing the width property of a Stage object throws an exception for any caller that is not in the same security sandbox as the Stage owner (the main SWF file). To avoid this, the Stage owner can grant permission to the domain of the caller by calling the Security.allowDomain() method or the Security.allowInsecureDomain() method. For more information, see the &quot;Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/display/Stage.html#event:fullScreen" title="Stage.fullScreen" text="fullScreen Dispatched by Flash Player when the Stage object enters, or leaves, full-screen mode. A change in full-screen mode can be initiated through ActionScript, or the user invoking a keyboard shortcut, or if the current focus leaves the full-screen window."/>
<page href="flash/display/Stage.html#event:mouseLeave" title="Stage.mouseLeave" text="mouseLeave Dispatched by the Stage object when the mouse pointer moves out of the Flash Player window area."/>
<page href="flash/display/Stage.html#event:resize" title="Stage.resize" text="resize Dispatched when the scaleMode property of the Stage object is set to StageScaleMode.NO_SCALE and the SWF file is resized."/>
<page href="flash/display/GradientType.html" title="GradientType class" text="GradientType The GradientType class provides values for the type parameter in the beginGradientFill() and lineGradientStyle() methods of the flash.display.Graphics class."/>
<page href="flash/display/GradientType.html#LINEAR" title="GradientType.LINEAR" text="LINEAR Value used to specify a linear gradient fill."/>
<page href="flash/display/GradientType.html#RADIAL" title="GradientType.RADIAL" text="RADIAL Value used to specify a radial gradient fill."/>
<page href="flash/display/SWFVersion.html" title="SWFVersion class" text="SWFVersion The SWFVersion class is an enumeration of constant values that indicate the file format version of a loaded SWF file. The SWFVersion constants are provided for use in checking the swfVersion property of a flash.display.LoaderInfo object."/>
<page href="flash/display/SWFVersion.html#FLASH1" title="SWFVersion.FLASH1" text="FLASH1 SWF file format version 1.0."/>
<page href="flash/display/SWFVersion.html#FLASH2" title="SWFVersion.FLASH2" text="FLASH2 SWF file format version 2.0."/>
<page href="flash/display/SWFVersion.html#FLASH3" title="SWFVersion.FLASH3" text="FLASH3 SWF file format version 3.0."/>
<page href="flash/display/SWFVersion.html#FLASH4" title="SWFVersion.FLASH4" text="FLASH4 SWF file format version 4.0."/>
<page href="flash/display/SWFVersion.html#FLASH5" title="SWFVersion.FLASH5" text="FLASH5 SWF file format version 5.0."/>
<page href="flash/display/SWFVersion.html#FLASH6" title="SWFVersion.FLASH6" text="FLASH6 SWF file format version 6.0."/>
<page href="flash/display/SWFVersion.html#FLASH7" title="SWFVersion.FLASH7" text="FLASH7 SWF file format version 7.0."/>
<page href="flash/display/SWFVersion.html#FLASH8" title="SWFVersion.FLASH8" text="FLASH8 SWF file format version 8.0."/>
<page href="flash/display/SWFVersion.html#FLASH9" title="SWFVersion.FLASH9" text="FLASH9 SWF file format version 9.0."/>
<page href="flash/display/LoaderInfo.html" title="LoaderInfo class" text="LoaderInfo The LoaderInfo class provides information about a loaded SWF file or a loaded image file (JPEG, GIF, or PNG). LoaderInfo objects are available for any display object. The information provided includes load progress, the URLs of the loader and loaded content, the number of bytes total for the media, and the nominal height and width of the media. You can access LoaderInfo objects in two ways: The contentLoaderInfo property of a flash.display.Loader object— The contentLoaderInfo property is always available for any Loader object. For a Loader object that has not called the load() or loadBytes() method, or that has not sufficiently loaded, attempting to access many of the properties of the contentLoaderInfo property throws an error. The loaderInfo property of a display object. The contentLoaderInfo property of a Loader object provides information about the content that the Loader object is loading, whereas the loaderInfo property of a DisplayObject provides information about the root SWF file for that display object. The loaderInfo property of an object loaded with a Loader object (a SWF file or a bitmap) refers to the same LoaderInfo object as the contentLoaderInfo property of the Loader object. In other words, a LoaderInfo object is shared between a loaded object file and the Loader object that loaded it. Because the instance of the main class of the SWF file has no Loader object, the loaderInfo property is the only way to access the LoaderInfo for the instance of the main class of the SWF file. The following diagram shows the different uses of the LoaderInfo object—for the instance of the main class of the SWF file, for the contentLoaderInfo property of a Loader object, and for the loaderInfo property of a loaded object: When a loading operation is not complete, some properties of the contentLoaderInfo property of a Loader object are not available. You can obtain some properties, such as bytesLoaded, bytesTotal, url, loaderURL, and applicationDomain. When the loaderInfo object dispatches the init event, you can access all properties of the loaderInfo object and the loaded image or SWF file. Note: All properties of LoaderInfo objects are read-only. The EventDispatcher.dispatchEvent() method is not applicable to LoaderInfo objects. If you call dispatchEvent() on a LoaderInfo object, an IllegalOperationError exception is thrown."/>
<page href="flash/display/LoaderInfo.html#getLoaderInfoByDefinition()" title="LoaderInfo.getLoaderInfoByDefinition()" text="getLoaderInfoByDefinition Returns the LoaderInfo object associated with a SWF file defined as an object. Player Version: Flash Player 9 Update 3. object A SWF file object."/>
<page href="flash/display/LoaderInfo.html#actionScriptVersion" title="LoaderInfo.actionScriptVersion" text="actionScriptVersion The ActionScript version of the loaded SWF file. The language version is specified by using the enumerations in the ActionScriptVersion class, such as ActionScriptVersion.ACTIONSCRIPT2 and ActionScriptVersion.ACTIONSCRIPT3. Note: This property always has a value of either ActionScriptVersion.ACTIONSCRIPT2 or ActionScriptVersion.ACTIONSCRIPT3. ActionScript 1.0 and 2.0 are both reported as ActionScriptVersion.ACTIONSCRIPT2 (version 2.0). This property only distinguishes ActionScript 1.0 and 2.0 from ActionScript 3.0. If the file is not downloaded sufficiently to retrieve the requested information."/>
<page href="flash/display/LoaderInfo.html#applicationDomain" title="LoaderInfo.applicationDomain" text="applicationDomain When an external SWF file is loaded, all ActionScript 3.0 definitions contained in the loaded class are stored in the applicationDomain property. All code in a SWF file is defined to exist in an application domain. The current application domain is where your main application runs. The system domain contains all application domains, including the current domain, which means that it contains all Flash Player classes. All application domains, except the system domain, have an associated parent domain. The parent domain of your main application's applicationDomain is the system domain. Loaded classes are defined only when their parent doesn't already define them. You cannot override a loaded class definition with a newer definition. For usage examples of application domains, see the &quot;Client System Environment&quot; chapter in Programming ActionScript 3.0. This security sandbox of the caller is not allowed to access this ApplicationDomain."/>
<page href="flash/display/LoaderInfo.html#bytes" title="LoaderInfo.bytes" text="bytes The bytes associated with a LoaderInfo object. If the object accessing this API is prevented from accessing the loaded object due to security restrictions. This situation can occur, for instance, when a Loader object attempts to access the contentLoaderInfo.content property and it is not granted security permission to access the loaded content. For more information, see the &quot;Flash Player Security&quot; chapter in Programming ActionScript 3.0. Player Version: Flash Player 9 Update 3."/>
<page href="flash/display/LoaderInfo.html#bytesLoaded" title="LoaderInfo.bytesLoaded" text="bytesLoaded The number of bytes that are loaded for the media. When this number equals the value of bytesTotal, all of the bytes are loaded."/>
<page href="flash/display/LoaderInfo.html#bytesTotal" title="LoaderInfo.bytesTotal" text="bytesTotal The number of compressed bytes in the entire media file. Before the first progress event is dispatched by this LoaderInfo object's corresponding Loader object, bytesTotal is 0. After the first progress event from the Loader object, bytesTotal reflects the actual number of bytes to be downloaded."/>
<page href="flash/display/LoaderInfo.html#childAllowsParent" title="LoaderInfo.childAllowsParent" text="childAllowsParent Expresses the trust relationship from content (child) to the Loader (parent). If the child has allowed the parent access, true; otherwise, false. This property is set to true if the child object has called the allowDomain() method to grant permission to the parent domain or if a cross-domain policy is loaded at the child domain that grants permission to the parent domain. If child and parent are in the same domain, this property is set to true. For more information, see the &quot;Flash Player Security&quot; chapter in Programming ActionScript 3.0. Thrown if the file is not downloaded sufficiently to retrieve the requested information."/>
<page href="flash/display/LoaderInfo.html#content" title="LoaderInfo.content" text="content The loaded object associated with this LoaderInfo object. If the object accessing this API is prevented from accessing the loaded object due to security restrictions. This situation can occur, for instance, when a Loader object attempts to access the contentLoaderInfo.content property and it is not granted security permission to access the loaded content. For more information, see the &quot;Flash Player Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/display/LoaderInfo.html#contentType" title="LoaderInfo.contentType" text="contentType The MIME type of the loaded file. The value is null if not enough of the file has loaded for Flash Player to determine the type. The following list gives the possible values: &quot;application/x-shockwave-flash&quot; &quot;image/jpeg&quot; &quot;image/gif&quot; &quot;image/png&quot;"/>
<page href="flash/display/LoaderInfo.html#frameRate" title="LoaderInfo.frameRate" text="frameRate The nominal frame rate, in frames per second, of the loaded SWF file. This number is often an integer, but need not be. This value may differ from the actual frame rate in use. Flash Player only uses a single frame rate for all loaded SWF files at any one time, and this frame rate is determined by the nominal frame rate of the main SWF file. Also, Flash Player might not be able to achieve the main frame rate, depending on hardware, sound synchronization, and other factors. If the file is not downloaded sufficiently to retrieve the requested information."/>
<page href="flash/display/LoaderInfo.html#height" title="LoaderInfo.height" text="height The nominal height of the loaded file. This value might differ from the actual height at which the content is displayed, since the loaded content or its parent display objects might be scaled. If the file is not downloaded sufficiently to retrieve the requested information."/>
<page href="flash/display/LoaderInfo.html#loader" title="LoaderInfo.loader" text="loader The Loader object associated with this LoaderInfo object. If this LoaderInfo object is the loaderInfo property of the instance of the main class of the SWF file, no Loader object is associated. If the object accessing this API is prevented from accessing the Loader object because of security restrictions. This can occur, for instance, when a loaded SWF file attempts to access its loaderInfo.loader property and it is not granted security permission to access the loading SWF file. For more information, see the &quot;Flash Player Security&quot; chapter in Programming ActionScript 3.0."/>
<page href="flash/display/LoaderInfo.html#loaderURL" title="LoaderInfo.loaderURL" text="loaderURL The URL of the SWF file that initiated the loading of the media described by this LoaderInfo object. For the instance of the main class of the SWF file, this URL is the same as the SWF file's own URL."/>
<page href="flash/display/LoaderInfo.html#parameters" title="LoaderInfo.parameters" text="parameters An object that contains name-value pairs that represent the parameters provided to the loaded SWF file. You can use a for-in loop to extract all the names and values from the parameters object. The two sources of parameters are: the query string in the URL of the main SWF file, and the value of the FlashVars HTML parameter (this affects only the main SWF file). The parameters property replaces the ActionScript 1.0 and 2.0 technique of providing SWF file parameters as properties of the main timeline. The value of the parameters property is null for Loader objects that contain SWF files that use ActionScript 1.0 or 2.0. It is only non-null for Loader objects that contain SWF files that use ActionScript 3.0."/>
<page href="flash/display/LoaderInfo.html#parentAllowsChild" title="LoaderInfo.parentAllowsChild" text="parentAllowsChild Expresses the trust relationship from Loader (parent) to the content (child). If the parent has allowed the child access, true; otherwise, false. This property is set to true if the parent object called the allowDomain() method to grant permission to the child domain or if a cross-domain policy file is loaded at the parent domain granting permission to the child domain. If child and parent are in the same domain, this property is set to true. For more information, see the &quot;Flash Player Security&quot; chapter in Programming ActionScript 3.0. Thrown if the file is not downloaded sufficiently to retrieve the requested information."/>
<page href="flash/display/LoaderInfo.html#sameDomain" title="LoaderInfo.sameDomain" text="sameDomain Expresses the domain relationship between the loader and the content: true if they have the same origin domain; false otherwise. Thrown if the file is not downloaded sufficiently to retrieve the requested information."/>
<page href="flash/display/LoaderInfo.html#sharedEvents" title="LoaderInfo.sharedEvents" text="sharedEvents An EventDispatcher instance that can be used to exchange events across security boundaries. Even when the loader and the loadee do not trust one another, both can access sharedEvents."/>
<page href="flash/display/LoaderInfo.html#swfVersion" title="LoaderInfo.swfVersion" text="swfVersion The file format version of the loaded SWF file. The file format is specified using the enumerations in the SWFVersion class, such as SWFVersion.FLASH7 and SWFVersion.FLASH9. If the file is not downloaded sufficiently to retrieve the requested information."/>
<page href="flash/display/LoaderInfo.html#url" title="LoaderInfo.url" text="url The URL of the media being loaded. Before the first progress event is dispatched by this LoaderInfo object's corresponding Loader object, the value of the url property might reflect only the initial URL specified in the call to the load() method of the Loader object. After the first progress event, the url property reflects the media's final URL, after any redirects and relative URLs are resolved."/>
<page href="flash/display/LoaderInfo.html#width" title="LoaderInfo.width" text="width The nominal width of the loaded content. This value might differ from the actual width at which the content is displayed, since the loaded content or its parent display objects might be scaled. If the file is not downloaded sufficiently to retrieve the requested information."/>
<page href="flash/display/LoaderInfo.html#event:complete" title="LoaderInfo.complete" text="complete Dispatched when data has loaded successfully. The complete event is always dispatched after the init event."/>
<page href="flash/display/LoaderInfo.html#event:httpStatus" title="LoaderInfo.httpStatus" text="httpStatus Dispatched when a network request is made over HTTP and Flash Player can detect the HTTP status code."/>
<page href="flash/display/LoaderInfo.html#event:init" title="LoaderInfo.init" text="init Dispatched when the properties and methods of a loaded SWF file are accessible. A LoaderInfo object dispatches the init event when the following two conditions exist: All properties and methods associated with the loaded object and those associated with the LoaderInfo object are accessible. The constructors for all child objects have completed. The init event always precedes the complete event."/>
<page href="flash/display/LoaderInfo.html#event:ioError" title="LoaderInfo.ioError" text="ioError Dispatched when an input or output error occurs that causes a load operation to fail."/>
<page href="flash/display/LoaderInfo.html#event:open" title="LoaderInfo.open" text="open Dispatched when a load operation starts."/>
<page href="flash/display/LoaderInfo.html#event:progress" title="LoaderInfo.progress" text="progress Dispatched when data is received as the download operation progresses."/>
<page href="flash/display/LoaderInfo.html#event:unload" title="LoaderInfo.unload" text="unload Dispatched by a LoaderInfo object whenever a loaded object is removed by using the unload() method of the Loader object, or when a second load is performed by the same Loader object and the original content is removed prior to the load beginning."/>
<page href="flash/display/IBitmapDrawable.html" title="IBitmapDrawable interface" text="IBitmapDrawable The IBitmapDrawable interface is implemented by objects that can be passed as the source parameter of the draw() method of the BitmapData class. These objects are of type BitmapData or DisplayObject."/>
<page href="flash/display/SimpleButton.html" title="SimpleButton class" text="SimpleButton The SimpleButton class lets you control all instances of button symbols in a SWF file. After you create an instance of a button in the authoring tool, you can use the methods and properties of the SimpleButton class to manipulate buttons with ActionScript. You can give a button an instance name in the Property inspector. SimpleButton instance names are displayed in the Movie Explorer and in the Insert Target Path dialog box in the Actions panel. In ActionScript 3.0, you use the new SimpleButton() constructor to create a SimpleButton instance. The SimpleButton class inherits from the InteractiveObject class."/>
<page href="flash/display/SimpleButton.html#SimpleButton()" title="SimpleButton.SimpleButton()" text="SimpleButton Creates a new SimpleButton instance. Any or all of the display objects that represent the various button states can be set as parameters in the constructor. upState overState downState hitTestState The initial value for the SimpleButton up state. The initial value for the SimpleButton over state. The initial value for the SimpleButton down state. The initial value for the SimpleButton hitTest state."/>
<page href="flash/display/SimpleButton.html#downState" title="SimpleButton.downState" text="downState Specifies a display object that is used as the visual object for the button &quot;Down&quot; state —the state that the button is in when the user clicks the hitTestState object."/>
<page href="flash/display/SimpleButton.html#enabled" title="SimpleButton.enabled" text="enabled A 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 might want to disable a button in the currently displayed page so that it can't be clicked and the page cannot be reloaded."/>
<page href="flash/display/SimpleButton.html#hitTestState" title="SimpleButton.hitTestState" text="hitTestState Specifies a display object that is used as the hit testing object for the button. For a basic button, set the hitTestState property to the same display object as the overState property. If you do not set the hitTestState property, the SimpleButton is inactive — it does not respond to mouse and keyboard events."/>
<page href="flash/display/SimpleButton.html#overState" title="SimpleButton.overState" text="overState Specifies a display object that is used as the visual object for the button over state — the state that the button is in when the mouse is positioned over the button."/>
<page href="flash/display/SimpleButton.html#soundTransform" title="SimpleButton.soundTransform" text="soundTransform The SoundTransform object assigned to this button. A SoundTransform object includes properties for setting volume, panning, left speaker assignment, and right speaker assignment. This SoundTransform object applies to all states of the button. This SoundTransform object affects only embedded sounds."/>
<page href="flash/display/SimpleButton.html#trackAsMenu" title="SimpleButton.trackAsMenu" text="trackAsMenu Indicates whether other display objects that are SimpleButton or MovieClip objects can receive mouse release events. The trackAsMenu property lets you create menus. You can set the trackAsMenu property on any SimpleButton or MovieClip object. If the trackAsMenu property does not exist, the default behavior is false. You can change the trackAsMenu property at any time; the modified button immediately takes on the new behavior."/>
<page href="flash/display/SimpleButton.html#upState" title="SimpleButton.upState" text="upState Specifies a display object that is used as the visual object for the button up state — the state that the button is in when the mouse is not positioned over the button."/>
<page href="flash/display/SimpleButton.html#useHandCursor" title="SimpleButton.useHandCursor" text="useHandCursor A Boolean value that, when set to true, indicates whether Flash Player displays the hand cursor when the mouse rolls over a button. If this property is set to false, the arrow pointer cursor is displayed instead. The default is true. You can change the useHandCursor property at any time; the modified button immediately uses the new cursor behavior."/>
<page href="flash/display/CapsStyle.html" title="CapsStyle class" text="CapsStyle The CapsStyle class is an enumeration of constant values that specify the caps style to use in drawing lines. The constants are provided for use as values in the caps parameter of the flash.display.Graphics.lineStyle() method. You can specify the following three types of caps:"/>
<page href="flash/display/CapsStyle.html#NONE" title="CapsStyle.NONE" text="NONE Used to specify no caps in the caps parameter of the flash.display.Graphics.lineStyle() method."/>
<page href="flash/display/CapsStyle.html#ROUND" title="CapsStyle.ROUND" text="ROUND Used to specify round caps in the caps parameter of the flash.display.Graphics.lineStyle() method."/>
<page href="flash/display/CapsStyle.html#SQUARE" title="CapsStyle.SQUARE" text="SQUARE Used to specify square caps in the caps parameter of the flash.display.Graphics.lineStyle() method."/>
<page href="flash/display/Scene.html" title="Scene class" text="Scene The Scene class includes properties for identifying the name, labels, and number of frames in a scene. The MovieClip class includes a currentScene property, which is a Scene object that identifies the scene in which the playhead is located in the timeline of the MovieClip instance. The scenes property of the MovieClip class is an array of Scene objects. Also, the gotoAndPlay() and gotoAndStop() methods of the MovieClip class use Scene objects as parameters."/>
<page href="flash/display/Scene.html#labels" title="Scene.labels" text="labels An array of FrameLabel objects for the scene. Each FrameLabel object contains a frame property, which specifies the frame number corresponding to the label, and a name property."/>
<page href="flash/display/Scene.html#name" title="Scene.name" text="name The name of the scene."/>
<page href="flash/display/Scene.html#numFrames" title="Scene.numFrames" text="numFrames The number of frames in the scene."/>
<page href="flash/display/PixelSnapping.html" title="PixelSnapping class" text="PixelSnapping The PixelSnapping class is an enumeration of constant values for setting the pixel snapping options by using the pixelSnapping property of a Bitmap object."/>
<page href="flash/display/PixelSnapping.html#ALWAYS" title="PixelSnapping.ALWAYS" text="ALWAYS A constant value used in the pixelSnapping property of a Bitmap object to specify that the bitmap image is always snapped to the nearest pixel, independent of any transformation."/>
<page href="flash/display/PixelSnapping.html#AUTO" title="PixelSnapping.AUTO" text="AUTO A constant value used in the pixelSnapping property of a Bitmap object to specify that the bitmap image is snapped to the nearest pixel if it is drawn with no rotation or skew and it is drawn at a scale factor of 99.9% to 100.1%. If these conditions are satisfied, the image is drawn at 100% scale, snapped to the nearest pixel. Internally, this setting allows the image to be drawn as fast as possible by using the vector renderer."/>
<page href="flash/display/PixelSnapping.html#NEVER" title="PixelSnapping.NEVER" text="NEVER A constant value used in the pixelSnapping property of a Bitmap object to specify that no pixel snapping occurs."/>
<page href="flash/display/BitmapData.html" title="BitmapData class" text="BitmapData The BitmapData class lets you work with the data (pixels) of a Bitmap object. You can use the methods of the BitmapData class to create arbitrarily sized transparent or opaque bitmap images and manipulate them in various ways at runtime. You can also access the BitmapData for a bitmap image that you load with the flash.display.Loader class. This class lets you separate bitmap rendering operations from the internal display updating routines of Flash Player. By manipulating a BitmapData object directly, you can create complex images without incurring the per-frame overhead of constantly redrawing the content from vector data. The methods of the BitmapData class support effects that are not available through the filters available to non-bitmap display objects. A BitmapData object contains an array of pixel data. This data can represent either a fully opaque bitmap or a transparent bitmap that contains alpha channel data. Either type of BitmapData object is stored as a buffer of 32-bit integers. Each 32-bit integer determines the properties of a single pixel in the bitmap. Each 32-bit integer is a combination of four 8-bit channel values (from 0 to 255) that describe the alpha transparency and the red, green, and blue (ARGB) values of the pixel. (For ARGB values, the most significant byte represents the alpha channel value, followed by red, green, and blue.) The four channels (alpha, red, green, and blue) are represented as numbers when you use them with the BitmapData.copyChannel() method or the DisplacementMapFilter.componentX and DisplacementMapFilter.componentY properties, and these numbers are represented by the following constants in the BitmapDataChannel class: BitmapDataChannel.ALPHA BitmapDataChannel.RED BitmapDataChannel.GREEN BitmapDataChannel.BLUE You can attach BitmapData objects to a Bitmap object by using the bitmapData property of the Bitmap object. You can use a BitmapData object to fill a Graphics object by using the Graphics.beginBitmapFill() method. The maximum width and maximum height of a BitmapData object is 2880 pixels. Calls to any method or property of a BitmapData object throw an ArgumentError error if the BitmapData object is invalid (for example, if it has height == 0 and width == 0) or it has been disposed of via dispose()."/>
<page href="flash/display/BitmapData.html#BitmapData()" title="BitmapData.BitmapData()" text="BitmapData Creates a BitmapData object with a specified width and height. If you specify a value for the fillColor parameter, every pixel in the bitmap is set to that color. By default, the bitmap is created as transparent, unless you pass the value false for the transparent parameter. After you create an opaque bitmap, you cannot change it to a transparent bitmap. Every pixel in an opaque bitmap uses only 24 bits of color channel information. If you define the bitmap as transparent, every pixel uses 32 bits of color channel information, including an alpha transparency channel. The maximum width and maximum height of a BitmapData object is 2880 pixels. If you specify a width or height value that is greater than 2880, a new instance is not created. width height transparent fillColor The width of the bitmap image in pixels. The height of the bitmap image in pixels. Specifies whether the bitmap image supports per-pixel transparency. The default value is true (transparent). To create a fully transparent bitmap, set the value of the transparent parameter to true and the value of the fillColor parameter to 0x00000000 (or to 0). Setting the transparent property to false can result in minor improvements in rendering performance. A 32-bit ARGB color value that you use to fill the bitmap image area. The default value is 0xFFFFFFFF (solid white). width and/or height are invalid (less than or equal to zero, greater than 2880)"/>
<page href="flash/display/BitmapData.html#applyFilter()" title="BitmapData.applyFilter()" text="applyFilter Takes a source image and a filter object and generates the filtered image. This method relies on the behavior of built-in filter objects, which determine the destination rectangle that is affected by an input source rectangle. After a filter is applied, the resulting image can be larger than the input image. For example, if you use a BlurFilter class to blur a source rectangle of (50,50,100,100) and a destination point of (10,10), the area that changes in the destination image is larger than (10,10,60,60) because of the blurring. This happens internally during the applyFilter() call. If the sourceRect parameter of the sourceBitmapData parameter is an interior region, such as (50,50,100,100) in a 200 x 200 image, the filter uses the source pixels outside the sourceRect parameter to generate the destination rectangle. If the BitmapData object and the object specified as the sourceBitmapData parameter are the same object, Flash Player uses a temporary copy of the object to perform the filter. For best performance, avoid this situation. sourceBitmapData sourceRect destPoint filter The input bitmap image to use. The source image can be a different BitmapData object or it can refer to the current BitmapData instance. A rectangle that defines the area of the source image to use as input. The point within the destination image (the current BitmapData instance) that corresponds to the upper-left corner of the source rectangle. The filter object that you use to perform the filtering operation. Each type of filter has certain requirements, as follows: BlurFilter — This filter can use source and destination images that are either opaque or transparent. If the formats of the images do not match, the copy of the source image that is made during the filtering matches the format of the destination image. BevelFilter, DropShadowFilter, GlowFilter, ChromeFilter — The destination image of these filters must be a transparent image. Calling DropShadowFilter or GlowFilter creates an image that contains the alpha channel data of the drop shadow or glow. It does not create the drop shadow onto the destination image. If you use any of these filters with an opaque destination image, an exception is thrown (ActionScript 3.0). ConvolutionFilter — This filter can use source and destination images that are either opaque or transparent. ColorMatrixFilter — This filter can use source and destination images that are either opaque or transparent. DisplacementMapFilter — This filter can use source and destination images that are either opaque or transparent, but the source and destination image formats must be the same. The following example shows how to apply a blur filter to a BitmapData instance: import flash.display.Bitmap; import flash.display.BitmapData; import flash.geom.Point; import flash.geom.Rectangle; import flash.filters.BlurFilter; var bmd:BitmapData = new BitmapData(80, 30, false, 0xFFCC00); var rect:Rectangle = new Rectangle(10, 10, 40, 10); bmd.fillRect(rect, 0xFF0000); var pt:Point = new Point(10, 10); var filter:BlurFilter = new BlurFilter(); bmd.applyFilter(bmd, rect, pt, filter); var bm:Bitmap = new Bitmap(bmd); addChild(bm); The sourceBitmapData, sourceRect, destPoint or filter are null."/>
<page href="flash/display/BitmapData.html#clone()" title="BitmapData.clone()" text="clone Returns a new BitmapData object that is a clone of the original instance with an exact copy of the contained bitmap. The following example shows how to clone a BitmapData instance, and it shows that when you modify the cloned BitmapData instance, the original remains unmodified: import flash.display.Bitmap; import flash.display.BitmapData; var bmd1:BitmapData = new BitmapData(100, 80, false, 0x00000000); var bmd2:BitmapData = bmd1.clone(); bmd1.setPixel32(1, 1, 0xFFFFFFFF); trace(bmd1.getPixel32(1, 1).toString(16)); // ffffffff trace(bmd2.getPixel32(1, 1).toString(16)); // ff000000 var bm1:Bitmap = new Bitmap(bmd1); this.addChild(bm1); var bm2:Bitmap = new Bitmap(bmd2); bm2.x = 110; this.addChild(bm2);"/>
<page href="flash/display/BitmapData.html#colorTransform()" title="BitmapData.colorTransform()" text="colorTransform Adjusts the color values in a specified area of a bitmap image by using a ColorTransform object. If the rectangle matches the boundaries of the bitmap image, this method transforms the color values of the entire image. rect colorTransform A Rectangle object that defines the area of the image in which the ColorTransform object is applied. A ColorTransform object that describes the color transformation values to apply. The following example shows how to apply a color transform to the left half (rectangle) of a BitmapData object: import flash.display.Bitmap; import flash.display.BitmapData; import flash.geom.Rectangle; import flash.geom.ColorTransform; var bmd:BitmapData = new BitmapData(80, 30, false, 0xFF0000); var cTransform:ColorTransform = new ColorTransform(); cTransform.alphaMultiplier = 0.5 var rect:Rectangle = new Rectangle(0, 0, 40, 30); bmd.colorTransform(rect, cTransform); var bm:Bitmap = new Bitmap(bmd); addChild(bm); The rect or colorTransform are null."/>
<page href="flash/display/BitmapData.html#compare()" title="BitmapData.compare()" text="compare Compares two BitmapData objects. If the two BitmapData objects have the same dimensions (width and height), the method returns a new BitmapData object, in which each pixel is the &quot;difference&quot; between the pixels in the two source objects: If two pixels are equal, the difference pixel is 0x00000000. If two pixels have different RGB values (ignoring the alpha value), the difference pixel is 0xRRGGBB where RR/GG/BB are the individual difference values between red, green, and blue channels (the pixel value in the source object minus the pixel value in the otherBitmapData object). Alpha channel differences are ignored in this case. If only the alpha channel value is different, the pixel value is 0xZZFFFFFF, where ZZ is the difference in the alpha values (the alpha value in the source object minus the alpha value in the otherBitmapData object). For example, consider the following two BitmapData objects: var bmd1:BitmapData = new BitmapData(50, 50, true, 0xFFFF8800); var bmd2:BitmapData = new BitmapData(50, 50, true, 0xCCCC6600); var diffBmpData:BitmapData = bmd1.compare(bmd2) as BitmapData; trace (&quot;0x&quot; + diffBmpData.getPixel(0,0).toString(16); // 0x332200 Note: The colors used to fill the two BitmapData objects have slightly different RGB values (0xFF8800 and 0xCC6600). The result of the compare() method is a new BitmapData object with each pixel showing the difference in the RGB values between the two bitmaps. Consider the following two BitmapData objects, in which the RGB colors are the same, but the alpha values are different: var bmd1:BitmapData = new BitmapData(50, 50, true, 0xFFFFAA00); var bmd2:BitmapData = new BitmapData(50, 50, true, 0xCCFFAA00); var diffBmpData:BitmapData = bmd1.compare(bmd2) as BitmapData; trace (&quot;0x&quot; + diffBmpData.getPixel32(0,0).toString(16); // 0x33ffffff The result of the compare() method is a new BitmapData object with each pixel showing the difference in the alpha values between the two bitmaps. If the BitmapData objects are equivalent (with the same width, height, and identical pixel values), the method returns the number 0. If the widths of the BitmapData objects are not equal, the method returns the number -3. If the heights of the BitmapData objects are not equal, but the widths are the same, the method returns the number -4. The following example compares two Bitmap objects with different widths (50 and 60): var bmd1:BitmapData = new BitmapData(100, 50, false, 0xFFFF0000); var bmd2:BitmapData = new BitmapData(100, 60, false, 0xFFFFAA00); trace(bmd1.compare(bmd2)); // -4 otherBitmapData The BitmapData object to compare with the source BitmapData object. The following example shows the value of a pixel in the BitmapData object that results from comparing two BitmapData objects of the same dimensions: import flash.display.Bitmap; import flash.display.BitmapData; var bmd1:BitmapData = new BitmapData(50, 50, true, 0xFFFFAA00); var bmd2:BitmapData = new BitmapData(50, 50, true, 0xCCFFAA00); var diffBmpData:BitmapData = BitmapData(bmd1.compare(bmd2)); var diffValue:String = diffBmpData.getPixel32(1, 1).toString(16); trace(diffValue); // 33ffffff var bm1:Bitmap = new Bitmap(bmd1); addChild(bm1); var bm2:Bitmap = new Bitmap(bmd2); addChild(bm2); bm2.x = 60; The otherBitmapData is null."/>
<page href="flash/display/BitmapData.html#copyChannel()" title="BitmapData.copyChannel()" text="copyChannel Transfers data from one channel of another BitmapData object or the current BitmapData object into a channel of the current BitmapData object. All of the data in the other channels in the destination BitmapData object are preserved. The source channel value and destination channel value can be one of following values: BitmapDataChannel.RED BitmapDataChannel.GREEN BitmapDataChannel.BLUE BitmapDataChannel.ALPHA sourceBitmapData sourceRect destPoint sourceChannel destChannel The input bitmap image to use. The source image can be a different BitmapData object or it can refer to the current BitmapData object. The source Rectangle object. To copy only channel data from a smaller area within the bitmap, specify a source rectangle that is smaller than the overall size of the BitmapData object. The destination Point object that represents the upper-left corner of the rectangular area where the new channel data is placed. To copy only channel data from one area to a different area in the destination image, specify a point other than (0,0). The source channel. Use a value from the BitmapDataChannel class (BitmapDataChannel.RED, BitmapDataChannel.BLUE, BitmapDataChannel.GREEN, BitmapDataChannel.ALPHA). The destination channel. Use a value from the BitmapDataChannel class (BitmapDataChannel.RED, BitmapDataChannel.BLUE, BitmapDataChannel.GREEN, BitmapDataChannel.ALPHA). The following example shows how to copy the red channel in a BitmapData object to its own blue channel in a 20 x 20 pixel region: import flash.display.Bitmap; import flash.display.BitmapData; import flash.geom.Rectangle; import flash.geom.Point; var bmd:BitmapData = new BitmapData(100, 80, false, 0x00FF0000); var rect:Rectangle = new Rectangle(0, 0, 20, 20); var pt:Point = new Point(10, 10); bmd.copyChannel(bmd, rect, pt, BitmapDataChannel.RED, BitmapDataChannel.BLUE); var bm:Bitmap = new Bitmap(bmd); this.addChild(bm); The sourceBitmapData, sourceRect or destPoint are null."/>
<page href="flash/display/BitmapData.html#copyPixels()" title="BitmapData.copyPixels()" text="copyPixels Provides a fast routine to perform pixel manipulation between images with no stretching, rotation, or color effects. This method copies a rectangular area of a source image to a rectangular area of the same size at the destination point of the destination BitmapData object. If you include the alphaBitmap and alphaPoint parameters, you can use a secondary image as an alpha source for the source image. If the source image has alpha data, both sets of alpha data are used to composite pixels from the source image to the destination image. The alphaPoint parameter is the point in the alpha image that corresponds to the upper-left corner of the source rectangle. Any pixels outside the intersection of the source image and alpha image are not copied to the destination image. The mergeAlpha property controls whether or not the alpha channel is used when a transparent image is copied onto another transparent image. To copy pixels with the alpha channel data, set the mergeAlpha property to true. By default, the mergeAlpha property is false. sourceBitmapData sourceRect destPoint alphaBitmapData alphaPoint mergeAlpha The input bitmap image from which to copy pixels. The source image can be a different BitmapData instance, or it can refer to the current BitmapData instance. A rectangle that defines the area of the source image to use as input. The destination point that represents the upper-left corner of the rectangular area where the new pixels are placed. A secondary, alpha BitmapData object source. The point in the alpha BitmapData object source that corresponds to the upper-left corner of the sourceRect parameter. To use the alpha channel, set the value to true. To copy pixels with no alpha channel, set the value to false. The following example shows how to copy pixels from a 20 x 20 pixel region in one BitmapData object to another BitmapData object: import flash.display.Bitmap; import flash.display.BitmapData; import flash.geom.Rectangle; import flash.geom.Point; var bmd1:BitmapData = new BitmapData(40, 40, false, 0x000000FF); var bmd2:BitmapData = new BitmapData(80, 40, false, 0x0000CC44); var rect:Rectangle = new Rectangle(0, 0, 20, 20); var pt:Point = new Point(10, 10); bmd2.copyPixels(bmd1, rect, pt); var bm1:Bitmap = new Bitmap(bmd1); this.addChild(bm1); var bm2:Bitmap = new Bitmap(bmd2); this.addChild(bm2); bm2.x = 50; The sourceBitmapData, sourceRect, destPoint are null."/>
<page href="flash/display/BitmapData.html#dispose()" title="BitmapData.dispose()" text="dispose Frees memory that is used to store the BitmapData object. When the dispose() method is called on an image, the width and height of the image are set to 0. All subsequent calls to methods or properties of this BitmapData instance fail, and an exception is thrown. The following example shows the effect of calling a method of a BitmapData object after a call to the dispose() method (an exception is thrown): import flash.display.BitmapData; var myBitmapData:BitmapData = new BitmapData(100, 80, false, 0x000000FF); trace(myBitmapData.getPixel(1, 1)); // 255 == 0xFF myBitmapData.dispose(); try { trace(myBitmapData.getPixel(1, 1)); } catch (error:Error) { trace(error); // ArgumentError }"/>
<page href="flash/display/BitmapData.html#draw()" title="BitmapData.draw()" text="draw Draws the source display object onto the bitmap image, using the Flash Player vector renderer. You can specify matrix, colorTransform, blendMode, and a destination clipRect parameter to control how the rendering performs. Optionally, you can specify whether the bitmap should be smoothed when scaled (this works only if the source object is a BitmapData object). This method directly corresponds to how objects are drawn with the standard vector renderer for objects in the authoring tool interface. The source display object does not use any of its applied transformations for this call. It is treated as it exists in the library or file, with no matrix transform, no color transform, and no blend mode. To draw a display object (such as a movie clip) by using its own transform properties, you can copy its transform property object to the transform property of the Bitmap object that uses the BitmapData object. Note: The source object and (in the case of a Sprite or MovieClip object) all of its child objects must come from the same domain as the caller, or must be in a SWF file that is accessible to the caller by having called the Security.allowDomain() method. If these conditions are not met, the draw() method does not draw anything. This method is supported over RTMP in Flash Player Update 3 and later. You can control access to streams on Flash Media Server in a server-side script. For more information, see the Client.audioSampleAccess and Client.videoSampleAccess properties in Server-Side ActionScript Language Reference for Adobe Flash Media Server. source matrix colorTransform blendMode clipRect smoothing The display object or BitmapData object to draw to the BitmapData object. (The DisplayObject and BitmapData classes implement the IBitmapDrawable interface.) A Matrix object used to scale, rotate, or translate the coordinates of the bitmap. If you do not want to apply a matrix transformation to the image, set this parameter to an identity matrix, created with the default new Matrix() constructor, or pass a null value. A ColorTransform object that you use to adjust the color values of the bitmap. If no object is supplied, the bitmap image's colors are not transformed. If you must pass this parameter but you do not want to transform the image, set this parameter to a ColorTransform object created with the default new ColorTransform() constructor. A string value, from the flash.display.BlendMode class, specifying the blend mode to be applied to the resulting bitmap. A Rectangle object that defines the area of the source object to draw. If you do not supply this value, no clipping occurs and the entire source object is drawn. A Boolean value that determines whether a BitmapData object is smoothed when scaled or rotated, due to a scaling or rotation in the matrix parameter. The smoothing parameter only applies if the source parameter is a BitmapData object. With smoothing set to false, the rotated or scaled BitmapData image can appear pixelated or jagged. For example, the following two images use the same BitmapData object for the source parameter, but the smoothing parameter is set to true on the left and false on the right: Drawing a bitmap with smoothing set to true takes longer than doing so with smoothing set to false. The following example shows how to draw a TextField object to a BitmapData object: import flash.display.Bitmap; import flash.display.BitmapData; import flash.text.TextField; var tf:TextField = new TextField(); tf.text = &quot;bitmap text&quot;; var myBitmapData:BitmapData = new BitmapData(80, 20); myBitmapData.draw(tf); var bmp:Bitmap = new Bitmap(myBitmapData); this.addChild(bmp); The source parameter is not a BitmapData or DisplayObject object."/>
<page href="flash/display/BitmapData.html#fillRect()" title="BitmapData.fillRect()" text="fillRect Fills a rectangular area of pixels with a specified ARGB color. rect color The rectangular area to fill. The ARGB color value that fills the area. ARGB colors are often specified in hexadecimal format; for example, 0xFF336699. The following example shows how to fill a rectangular region of a BitmapData object with blue: import flash.display.Bitmap; import flash.display.BitmapData; import flash.geom.Rectangle; var myBitmapData:BitmapData = new BitmapData(40, 40, false, 0x0000FF00); var rect:Rectangle = new Rectangle(0, 0, 20, 20); myBitmapData.fillRect(rect, 0x0000FF); var bm:Bitmap = new Bitmap(myBitmapData); addChild(bm); The rect is null."/>
<page href="flash/display/BitmapData.html#floodFill()" title="BitmapData.floodFill()" text="floodFill Performs a flood fill operation on an image starting at an (x, y) coordinate and filling with a certain color. The floodFill() method is similar to the paint bucket tool in various paint programs. The color is an ARGB color that contains alpha information and color information. x y color The x coordinate of the image. The y coordinate of the image. The ARGB color to use as a fill. The following example shows how to fill a region of a BitmapData object — that is, the region surrounding the pixel defined by the point (10, 10) iin which all colors march the color at that point — with red import flash.display.Bitmap; import flash.display.BitmapData; import flash.geom.Rectangle; var myBitmapData:BitmapData = new BitmapData(40, 40, false, 0x0000FF00); var rect:Rectangle = new Rectangle(0, 0, 20, 20); myBitmapData.fillRect(rect, 0x000000FF); rect = new Rectangle(15, 15, 25, 25); myBitmapData.fillRect(rect, 0x000000FF); myBitmapData.floodFill(10, 10, 0x00FF0000); var bm:Bitmap = new Bitmap(myBitmapData); addChild(bm);"/>
<page href="flash/display/BitmapData.html#generateFilterRect()" title="BitmapData.generateFilterRect()" text="generateFilterRect Determines the destination rectangle that the applyFilter() method call affects, given a BitmapData object, a source rectangle, and a filter object. For example, a blur filter normally affects an area larger than the size of the original image. A 100 x 200 pixel image that is being filtered by a default BlurFilter instance, where blurX = blurY = 4 generates a destination rectangle of (-2,-2,104,204). The generateFilterRect() method lets you find out the size of this destination rectangle in advance so that you can size the destination image appropriately before you perform a filter operation. Some filters clip their destination rectangle based on the source image size. For example, an inner DropShadow does not generate a larger result than its source image. In this API, the BitmapData object is used as the source bounds and not the source rect parameter. sourceRect filter A rectangle defining the area of the source image to use as input. A filter object that you use to calculate the destination rectangle. The following example shows how you can use the generateFilterRect() method to determine the rectangular area that the result of a blur filter will occupy. The results of the generateFilterRect() method are output by the trace() function: import flash.display.Bitmap; import flash.display.BitmapData; import flash.geom.Point; import flash.geom.Rectangle; import flash.filters.BlurFilter; var bmd:BitmapData = new BitmapData(80, 30, false, 0xFFCC00); var rect:Rectangle = new Rectangle(10, 10, 40, 10); bmd.fillRect(rect, 0xFF0000); var pt:Point = new Point(10, 10); var filter:BlurFilter = new BlurFilter(); trace(bmd.generateFilterRect(rect, filter)); // (x=8, y=8, w=44, h=14) bmd.applyFilter(bmd, rect, pt, filter); var bm:Bitmap = new Bitmap(bmd); addChild(bm); Note that the generateFilterRect() method does not apply the filter. Call the applyFilter() method to apply the filter. The sourceRect or filter are null."/>
<page href="flash/display/BitmapData.html#getColorBoundsRect()" title="BitmapData.getColorBoundsRect()" text="getColorBoundsRect Determines a rectangular region that either fully encloses all pixels of a specified color within the bitmap image (if the findColor parameter is set to true) or fully encloses all pixels that do not include the specified color (if the findColor parameter is set to false). For example, if you have a source image and you want to determine the rectangle of the image that contains a nonzero alpha channel, pass {mask: 0xFF000000, color: 0x00000000} as parameters. If the findColor parameter is set to true, the entire image is searched for the bounds of pixels for which (value &amp; mask) == color (where value is the color value of the pixel). If the findColor parameter is set to false, the entire image is searched for the bounds of pixels for which (value &amp; mask) != color (where value is the color value of the pixel). To determine white space around an image, pass {mask: 0xFFFFFFFF, color: 0xFFFFFFFF} to find the bounds of nonwhite pixels. mask color findColor A hexadecimal value, specifying the bits of the ARGB color to consider. The color value is combined with this hexadecimal value, by using the &amp; (bitwise AND) operator. A hexadecimal value, specifying the ARGB color to match (if findColor is set to true) or not to match (if findColor is set to false). If the value is set to true, returns the bounds of a color value in an image. If the value is set to false, returns the bounds of where this color doesn't exist in an image. The following example creates a BitmapData object with red in the top half of its pixels. It then calls the getColorBoundsRect() method to determine the rectangle in which pixels are red (0xFF0000), and then it calls the same method to determine the rectangle in which pixels are not red (by setting the findColor parameter to false: import flash.display.Bitmap; import flash.display.BitmapData; import flash.geom.Rectangle; var bmd:BitmapData = new BitmapData(80, 40, false, 0xFFFFFF); var rect:Rectangle = new Rectangle(0, 0, 80, 20); bmd.fillRect(rect, 0xFF0000); var maskColor:uint = 0xFFFFFF; var color:uint = 0xFF0000; var redBounds:Rectangle = bmd.getColorBoundsRect(maskColor, color, true); trace(redBounds); // (x=0, y=0, w=80, h=20) var notRedBounds:Rectangle = bmd.getColorBoundsRect(maskColor, color, false); trace(notRedBounds); // (x=0, y=20, w=80, h=20) var bm:Bitmap = new Bitmap(bmd); addChild(bm);"/>
<page href="flash/display/BitmapData.html#getPixel()" title="BitmapData.getPixel()" text="getPixel Returns an integer that represents an RGB pixel value from a BitmapData object at a specific point (x, y). The getPixel() method returns an unmultiplied pixel value. No alpha information is returned. All pixels in a BitmapData object are stored as premultiplied color values. A premultiplied image pixel has the red, green, and blue color channel values already multiplied by the alpha data. For example, if the alpha value is 0, the values for the RGB channels are also 0, independent of their unmultiplied values. This loss of data can cause some problems when you perform operations. All BitmapData methods take and return unmultiplied values. The internal pixel representation is converted from premultiplied to unmultiplied before it is returned as a value. During a set operation, the pixel value is premultiplied before the raw image pixel is set. x y The x position of the pixel. The y position of the pixel. The following example creates a BitmapData object filled with red, then uses the getPixel() method to determine the color value in the upper-left pixel: import flash.display.BitmapData; var bmd:BitmapData = new BitmapData(80, 40, false, 0xFF0000); var pixelValue:uint = bmd.getPixel(1, 1); trace(pixelValue.toString(16)); // ff0000;"/>
<page href="flash/display/BitmapData.html#getPixel32()" title="BitmapData.getPixel32()" text="getPixel32 Returns an ARGB color value that contains alpha channel data and RGB data. This method is similar to the getPixel() method, which returns an RGB color without alpha channel data. All pixels in a BitmapData object are stored as premultiplied color values. A premultiplied image pixel has the red, green, and blue color channel values already multiplied by the alpha data. For example, if the alpha value is 0, the values for the RGB channels are also 0, independent of their unmultiplied values. This loss of data can cause some problems when you perform operations. All BitmapData methods take and return unmultiplied values. The internal pixel representation is converted from premultiplied to unmultiplied before it is returned as a value. During a set operation, the pixel value is premultiplied before the raw image pixel is set. x y The x position of the pixel. The y position of the pixel. The following example creates a BitmapData object filled with a color, then uses the getPixel32() method to determine the color value in the upper-left pixel, and then determines the hexadecimal values for each color component (alpha, red, green, and blue): import flash.display.BitmapData; var bmd:BitmapData = new BitmapData(80, 40, true, 0xFF44AACC); var pixelValue:uint = bmd.getPixel32(1, 1); var alphaValue:uint = pixelValue &gt;&gt; 24 &amp; 0xFF; var red:uint = pixelValue &gt;&gt; 16 &amp; 0xFF; var green:uint = pixelValue &gt;&gt; 8 &amp; 0xFF; var blue:uint = pixelValue &amp; 0xFF; trace(alphaValue.toString(16)); // ff trace(red.toString(16)); // 44 trace(green.toString(16)); // aa trace(blue.toString(16)); // cc"/>
<page href="flash/display/BitmapData.html#getPixels()" title="BitmapData.getPixels()" text="getPixels Generates a byte array from a rectangular region of pixel data. Writes an unsigned integer (a 32-bit unmultiplied pixel value) for each pixel into the byte array. rect A rectangular area in the current BitmapData object. The following example creates a BitmapData object filled with random noise pixels, then uses the getPixels() method to fill a ByteArray object with the pixel values of the BitmapData object import flash.display.BitmapData; import flash.geom.Rectangle; import flash.utils.ByteArray; var bmd:BitmapData = new BitmapData(80, 40, true); var seed:int = int(Math.random() * int.MAX_VALUE); bmd.noise(seed); var bounds:Rectangle = new Rectangle(0, 0, bmd.width, bmd.height); var pixels:ByteArray = bmd.getPixels(bounds); The rect is null."/>
<page href="flash/display/BitmapData.html#hitTest()" title="BitmapData.hitTest()" text="hitTest Performs pixel-level hit detection between one bitmap image and a point, rectangle, or other bitmap image. No stretching, rotation, or other transformation of either object is considered when the hit test is performed. If an image is an opaque image, it is considered a fully opaque rectangle for this method. Both images must be transparent images to perform pixel-level hit testing that considers transparency. When you are testing two transparent images, the alpha threshold parameters control what alpha channel values, from 0 to 255, are considered opaque. firstPoint firstAlphaThreshold secondObject secondBitmapDataPoint secondAlphaThreshold A position of the upper-left corner of the BitmapData image in an arbitrary coordinate space. The same coordinate space is used in defining the secondBitmapPoint parameter. The highest alpha channel value that is considered opaque for this hit test. A Rectangle, Point, Bitmap, or BitmapData object. A point that defines a pixel location in the second BitmapData object. Use this parameter only when the value of secondObject is a BitmapData object. The highest alpha channel value that is considered opaque in the second BitmapData object. Use this parameter only when the value of secondObject is a BitmapData object and both BitmapData objects are transparent. The following example creates a BitmapData object that is only opaque in a rectangular region (20, 20, 40, 40) and calls the hitTest() method with a Point object as the secondObject. In the first call, the Point object defines the upper-left corner of the BitmapData object, which is not opaque, and in the second call, the Point object defines the center of the BitmapData object, which is opaque. import flash.display.BitmapData; import flash.geom.Rectangle; import flash.geom.Point; var bmd1:BitmapData = new BitmapData(80, 80, true, 0x00000000); var rect:Rectangle = new Rectangle(20, 20, 40, 40); bmd1.fillRect(rect, 0xFF0000FF); var pt1:Point = new Point(1, 1); trace(bmd1.hitTest(pt1, 0xFF, pt1)); // false var pt2:Point = new Point(40, 40); trace(bmd1.hitTest(pt1, 0xFF, pt2)); // true The secondObject parameter is not a Point, Rectangle, Bitmap, or BitmapData object."/>
<page href="flash/display/BitmapData.html#lock()" title="BitmapData.lock()" text="lock Locks an image so that any objects that reference the BitmapData object, such as Bitmap objects, are not updated when this BitmapData object changes. To improve performance, use this method along with the unlock() method before and after numerous calls to the setPixel() or setPixel32() method. The following example creates a BitmapData object based on the bitmapData property of a Bitmap object, picture. It then calls the lock() method before calling a complicated custom function, complexTransformation(), that modifies the BitmapData object. (The picture object and the complexTransformation() function are not defined in this example.) Even if the complexTransformation() function updates the bitmapData property of the picture object, changes are not reflected until the code calls the unlock() method on the bitmapData object: import flash.display.BitmapData; var bitmapData:BitmapData = picture.bitmapData; bitmapData.lock(); bitmapData = complexTransformation(bitmapData); bitmapData.unlock(); picture.bitmapData = bitmapData;"/>
<page href="flash/display/BitmapData.html#merge()" title="BitmapData.merge()" text="merge Performs per-channel blending from a source image to a destination image. For each channel and each pixel, a new value is computed based on the channel values of the source and destination pixels. For example, in the red channel, the new value is computed as follows (where redSrc is the red channel value for a pixel in the source image and redDest is the red channel value at the corresponding pixel of the destination image): new redDest = [(redSrc * redMultiplier) + (redDest * (256 - redMultiplier))] / 256; The redMultiplier, greenMultiplier, blueMultiplier, and alphaMultiplier values are the multipliers used for each color channel. Use a hexadecimal value ranging from 0 to 0x100 (256) where 0 specifies the full value from the destination is used in the result, 0x100 specifies the full value from the source is used, and numbers in between specify a blend is used (such as 0x80 for 50%). sourceBitmapData sourceRect destPoint redMultiplier greenMultiplier blueMultiplier alphaMultiplier The input bitmap image to use. The source image can be a different BitmapData object, or it can refer to the current BitmapData object. A rectangle that defines the area of the source image to use as input. The point within the destination image (the current BitmapData instance) that corresponds to the upper-left corner of the source rectangle. A hexadecimal uint value by which to multiply the red channel value. A hexadecimal uint value by which to multiply the green channel value. A hexadecimal uint value by which to multiply the blue channel value. A hexadecimal uint value by which to multiply the alpha transparency value. The following example creates two BitmapData objects. Both are 100 x 80 pixels in size. The first is filled with green and the second is filled with red. The code calls the merge() method, merging the second BitmapData pixels into the first BitmapData object, but only on a specified rectangular area: import flash.display.Bitmap; import flash.display.BitmapData; import flash.geom.Rectangle; import flash.geom.Point; var bmd1:BitmapData = new BitmapData(100, 80, true, 0xFF00FF00); var bmd2:BitmapData = new BitmapData(100, 80, true, 0xFFFF0000); var rect:Rectangle = new Rectangle(0, 0, 20, 20); var pt:Point = new Point(20, 20); var mult:uint = 0x80; // 50% bmd1.merge(bmd2, rect, pt, mult, mult, mult, mult); var bm1:Bitmap = new Bitmap(bmd1); addChild(bm1); var bm2:Bitmap = new Bitmap(bmd2); addChild(bm2); bm2.x = 110; The sourceBitmapData, sourceRect or destPoint are null."/>
<page href="flash/display/BitmapData.html#noise()" title="BitmapData.noise()" text="noise Fills an image with pixels representing random noise. randomSeed low high channelOptions grayScale The random seed number to use. If you keep all other parameters the same, you can generate different pseudo-random results by varying the random seed value. The noise function is a mapping function, not a true random-number generation function, so it creates the same results each time from the same random seed. The lowest value to generate for each channel (0 to 255). The highest value to generate for each channel (0 to 255). A number that can be a combination of any of the four color channel values (BitmapDataChannel.RED, BitmapDataChannel.BLUE, BitmapDataChannel.GREEN, and BitmapDataChannel.ALPHA). You can use the logical OR operator (|) to combine channel values. A Boolean value. If the value is true, a grayscale image is created by setting all of the color channels to the same value. The alpha channel selection is not affected by setting this parameter to true. The following example creates two BitmapData objects and calls the noise() method on both. However, the grayscale parameter is set to false for the call to the noise() method of the first object, and it is set to true for the call to the noise() method of the second object: import flash.display.Bitmap; import flash.display.BitmapData; import flash.display.BitmapDataChannel; var bmd1:BitmapData = new BitmapData(80, 80); var bmd2:BitmapData = new BitmapData(80, 80); var seed:int = int(Math.random() * int.MAX_VALUE); bmd1.noise(seed, 0, 0xFF, BitmapDataChannel.RED, false); bmd2.noise(seed, 0, 0xFF, BitmapDataChannel.RED, true); var bm1:Bitmap = new Bitmap(bmd1); this.addChild(bm1); var bm2:Bitmap = new Bitmap(bmd2); this.addChild(bm2); bm2.x = 90;"/>
<page href="flash/display/BitmapData.html#paletteMap()" title="BitmapData.paletteMap()" text="paletteMap Remaps the color channel values in an image that has up to four arrays of color palette data, one for each channel. Flash Player uses the following steps to generate the resulting image: After the red, green, blue, and alpha values are computed, they are added together using standard 32-bit-integer arithmetic. The red, green, blue, and alpha channel values of each pixel are extracted into separate 0 to 255 values. These values are used to look up new color values in the appropriate array: redArray, greenArray, blueArray, and alphaArray. Each of these four arrays should contain 256 values. After all four of the new channel values are retrieved, they are combined into a standard ARGB value that is applied to the pixel. Cross-channel effects can be supported with this method. Each input array can contain full 32-bit values, and no shifting occurs when the values are added together. This routine does not support per-channel clamping. If no array is specified for a channel, the color channel is copied from the source image to the destination image. You can use this method for a variety of effects such as general palette mapping (taking one channel and converting it to a false color image). You can also use this method for a variety of advanced color manipulation algorithms, such as gamma, curves, levels, and quantizing. sourceBitmapData sourceRect destPoint redArray greenArray blueArray alphaArray The input bitmap image to use. The source image can be a different BitmapData object, or it can refer to the current BitmapData instance. A rectangle that defines the area of the source image to use as input. The point within the destination image (the current BitmapData object) that corresponds to the upper-left corner of the source rectangle. If redArray is not null, red = redArray[source red value] else red = source rect value. If greenArray is not null, green = greenArray[source green value] else green = source green value. If blueArray is not null, blue = blueArray[source blue value] else blue = source blue value. If alphaArray is not null, alpha = alphaArray[source alpha value] else alpha = source alpha value. The following example creates a green BitmapData object with a red center square, and then uses the paletteMap() method to swap red with green in the bottom rectangular half of the BitmapData object: import flash.display.Bitmap; import flash.display.BitmapData; import flash.geom.Rectangle; import flash.geom.Point; var myBitmapData:BitmapData = new BitmapData(80, 80, false, 0x00FF0000); myBitmapData.fillRect(new Rectangle(20, 20, 40, 40), 0x0000FF00); var redArray:Array = new Array(256); var greenArray:Array = new Array(256); for(var i:uint = 0; i &lt; 255; i++) { redArray[i] = 0x00000000; greenArray[i] = 0x00000000; } redArray[0xFF] = 0x0000FF00; greenArray[0xFF] = 0x00FF0000; var bottomHalf:Rectangle = new Rectangle(0, 0, 100, 40); var pt:Point = new Point(0, 0); myBitmapData.paletteMap(myBitmapData, bottomHalf, pt, redArray, greenArray); var bm1:Bitmap = new Bitmap(myBitmapData); addChild(bm1); The sourceBitmapData, sourceRect or destPoint are null."/>
<page href="flash/display/BitmapData.html#perlinNoise()" title="BitmapData.perlinNoise()" text="perlinNoise Generates a Perlin noise image. The Perlin noise generation algorithm interpolates and combines individual random noise functions (called octaves) into a single function that generates more natural-seeming random noise. Like musical octaves, each octave function is twice the frequency of the one before it. Perlin noise has been described as a &quot;fractal sum of noise&quot; because it combines multiple sets of noise data with different levels of detail. You can use Perlin noise functions to simulate natural phenomena and landscapes, such as wood grain, clouds, and mountain ranges. In most cases, the output of a Perlin noise function is not displayed directly but is used to enhance other images and give them pseudo-random variations. Simple digital random noise functions often produce images with harsh, contrasting points. This kind of harsh contrast is not often found in nature. The Perlin noise algorithm blends multiple noise functions that operate at different levels of detail. This algorithm results in smaller variations among neighboring pixel values. Note: The Perlin noise algorithm is named for Ken Perlin, who developed it after generating computer graphics for the 1982 film Tron. Perlin received an Academy Award for Technical Achievement for the Perlin noise function in 1997. baseX baseY numOctaves randomSeed stitch fractalNoise channelOptions grayScale offsets Frequency to use in the x direction. For example, to generate a noise that is sized for a 64 x 128 image, pass 64 for the baseX value. Frequency to use in the y direction. For example, to generate a noise that is sized for a 64 x 128 image, pass 128 for the baseY value. Number of octaves or individual noise functions to combine to create this noise. Larger numbers of octaves create images with greater detail. Larger numbers of octaves also require more processing time. The random seed number to use. If you keep all other parameters the same, you can generate different pseudo-random results by varying the random seed value. The Perlin noise function is a mapping function, not a true random-number generation function, so it creates the same results each time from the same random seed. A Boolean value. If the value is true, the method attempts to smooth the transition edges of the image to create seamless textures for tiling as a bitmap fill. A Boolean value. If the value is true, the method generates fractal noise; otherwise, it generates turbulence. An image with turbulence has visible discontinuities in the gradient that can make it better approximate sharper visual effects like flames and ocean waves. A number that can be a combination of any of the four color channel values (BitmapDataChannel.RED, BitmapDataChannel.BLUE, BitmapDataChannel.GREEN, and BitmapDataChannel.ALPHA). You can use the logical OR operator (|) to combine channel values. A Boolean value. If the value is true, a grayscale image is created by setting each of the red, green, and blue color channels to identical values. The alpha channel value is not affected if this value is set to true. An array of points that correspond to x and y offsets for each octave. By manipulating the offset values you can smoothly scroll the layers of a perlinNoise image. Each point in the offset array affects a specific octave noise function. The following example creates a 200 x 200 pixel BitmapData object that calls the perlinNoise() method to generate a red and blue watercolor effect: import flash.display.Bitmap; import flash.display.BitmapData; var bmd:BitmapData = new BitmapData(200, 200, false, 0x00CCCCCC); var seed:Number = Math.floor(Math.random() * 10); var channels:uint = BitmapDataChannel.RED | BitmapDataChannel.BLUE; bmd.perlinNoise(100, 80, 6, seed, false, true, channels, false, null); var bm:Bitmap = new Bitmap(bmd); addChild(bm);"/>
<page href="flash/display/BitmapData.html#pixelDissolve()" title="BitmapData.pixelDissolve()" text="pixelDissolve Performs a pixel dissolve either from a source image to a destination image or by using the same image. Flash Player uses a randomSeed value to generate a random pixel dissolve. The return value of the function must be passed in on subsequent calls to continue the pixel dissolve until it is finished. If the source image does not equal the destination image, pixels are copied from the source to the destination by using all of the properties. This process allows dissolving from a blank image into a fully populated image. If the source and destination images are equal, pixels are filled with the color parameter. This process allows dissolving away from a fully populated image. In this mode, the destination point parameter is ignored. sourceBitmapData sourceRect destPoint randomSeed numPixels fillColor The input bitmap image to use. The source image can be a different BitmapData object, or it can refer to the current BitmapData instance. A rectangle that defines the area of the source image to use as input. The point within the destination image (the current BitmapData instance) that corresponds to the upper-left corner of the source rectangle. The random seed to use to start the pixel dissolve. The default is 1/30 of the source area (width x height). An ARGB color value that you use to fill pixels whose source value equals its destination value. The following example uses the pixelDissolve() method to convert a grey BitmapData object to a red one by dissolving 40 pixels at a time until all pixels have changed colors: import flash.display.BitmapData; import flash.display.Bitmap; import flash.geom.Point; import flash.geom.Rectangle; import flash.utils.Timer; import flash.events.TimerEvent; var bmd:BitmapData = new BitmapData(100, 80, false, 0x00CCCCCC); var bitmap:Bitmap = new Bitmap(bmd); addChild(bitmap); var tim:Timer = new Timer(20); tim.start(); tim.addEventListener(TimerEvent.TIMER, timerHandler); function timerHandler(event:TimerEvent):void { var randomNum:Number = Math.floor(Math.random() * int.MAX_VALUE); dissolve(randomNum); } function dissolve(randomNum:Number):void { var rect:Rectangle = bmd.rect; var pt:Point = new Point(0, 0); var numberOfPixels:uint = 100; var red:uint = 0x00FF0000; bmd.pixelDissolve(bmd, rect, pt, randomNum, numberOfPixels, red); var grayRegion:Rectangle = bmd.getColorBoundsRect(0xFFFFFFFF, 0x00CCCCCC, true); if(grayRegion.width == 0 &amp;&amp; grayRegion.height == 0 ) { tim.stop(); } } The sourceBitmapData, sourceRect or destPoint are null."/>
<page href="flash/display/BitmapData.html#scroll()" title="BitmapData.scroll()" text="scroll Scrolls an image by a certain (x, y) pixel amount. Edge regions outside the scrolling area are left unchanged. x y The amount by which to scroll horizontally. The amount by which to scroll vertically. The following example shows the effect of scrolling a Bitmap data object 40 pixels to the right: import flash.display.Bitmap; import flash.display.BitmapData; import flash.geom.Rectangle; var bmd:BitmapData = new BitmapData(80, 80, true, 0xFFCCCCCC); var rect:Rectangle = new Rectangle(0, 0, 40, 40); bmd.fillRect(rect, 0xFFFF0000); var bm:Bitmap = new Bitmap(bmd); addChild(bm); trace(bmd.getPixel32(50, 20).toString(16)); // ffcccccccc bmd.scroll(30, 0); trace(bmd.getPixel32(50, 20).toString(16)); // ffff0000"/>
<page href="flash/display/BitmapData.html#setPixel()" title="BitmapData.setPixel()" text="setPixel Sets a single pixel of a BitmapData object. The current alpha channel value of the image pixel is preserved during this operation. The value of the RGB color parameter is treated as an unmultiplied color value. Note: To increase performance, when you use the setPixel() or setPixel32() method repeatedly, call the lock() method before you call the setPixel() or setPixel32() method, and then call the unlock() method when you have made all pixel changes. This process prevents objects that reference this BitmapData instance from updating until you finish making the pixel changes. x y color The x position of the pixel whose value changes. The y position of the pixel whose value changes. The resulting RGB color for the pixel. The following example uses the setPixel() method to draw a red line in a BitmapData object: import flash.display.Bitmap; import flash.display.BitmapData; var bmd:BitmapData = new BitmapData(80, 80, false, 0xCCCCCC); for (var i:uint = 0; i &lt; 80; i++) { var red:uint = 0xFF0000; bmd.setPixel(i, 40, red); } var bm:Bitmap = new Bitmap(bmd); addChild(bm);"/>
<page href="flash/display/BitmapData.html#setPixel32()" title="BitmapData.setPixel32()" text="setPixel32 Sets the color and alpha transparency values of a single pixel of a BitmapData object. This method is similar to the setPixel() method; the main difference is that the setPixel32() method takes an ARGB color value that contains alpha channel information. All pixels in a BitmapData object are stored as premultiplied color values. A premultiplied image pixel has the red, green, and blue color channel values already multiplied by the alpha data. For example, if the alpha value is 0, the values for the RGB channels are also 0, independent of their unmultiplied values. This loss of data can cause some problems when you perform operations. All BitmapData methods take and return unmultiplied values. The internal pixel representation is converted from premultiplied to unmultiplied before it is returned as a value. During a set operation, the pixel value is premultiplied before the raw image pixel is set. Note: To increase performance, when you use the setPixel() or setPixel32() method repeatedly, call the lock() method before you call the setPixel() or setPixel32() method, and then call the unlock() method when you have made all pixel changes. This process prevents objects that reference this BitmapData instance from updating until you finish making the pixel changes. x y color The x position of the pixel whose value changes. The y position of the pixel whose value changes. The resulting ARGB color for the pixel. If the bitmap is opaque (not transparent), the alpha transparency portion of this color value is ignored. The following example uses the setPixel32() method to draw a transparent (alpha == 0x60) red line in a BitmapData object: import flash.display.Bitmap; import flash.display.BitmapData; var bmd:BitmapData = new BitmapData(80, 80, true, 0xFFCCCCCC); for (var i:uint = 0; i &lt; 80; i++) { var red:uint = 0x60FF0000; bmd.setPixel32(i, 40, red); } var bm:Bitmap = new Bitmap(bmd); addChild(bm);"/>
<page href="flash/display/BitmapData.html#setPixels()" title="BitmapData.setPixels()" text="setPixels Converts a byte array into a rectangular region of pixel data. For each pixel, the ByteArray.readUnsignedInt() method is called and the return value is written into the pixel. If the byte array ends before the full rectangle is written, the function returns. The data in the byte array is expected to be 32-bit ARGB pixel values. No seeking is performed on the byte array before or after the pixels are read. rect inputByteArray Specifies the rectangular region of the BitmapData object. A ByteArray object that consists of 32-bit unmultiplied pixel values to be used in the rectangular region. The following example uses the getPixels() and setPixels() methods to copy pixels from one BitmapData object to another: import flash.display.Bitmap; import flash.display.BitmapData; import flash.utils.ByteArray; import flash.geom.Rectangle; var bmd1:BitmapData = new BitmapData(100, 100, true, 0xFFCCCCCC); var bmd2:BitmapData = new BitmapData(100, 100, true, 0xFFFF0000); var rect:Rectangle = new Rectangle(0, 0, 100, 100); var bytes:ByteArray = bmd1.getPixels(rect); bytes.position = 0; bmd2.setPixels(rect, bytes); var bm1:Bitmap = new Bitmap(bmd1); addChild(bm1); var bm2:Bitmap = new Bitmap(bmd2); addChild(bm2); bm2.x = 110; The inputByteArray object does not include enough data to fill the area of the rect rectangle. The method fills as many pixels as possible before throwing the exception."/>
<page href="flash/display/BitmapData.html#threshold()" title="BitmapData.threshold()" text="threshold Tests pixel values in an image against a specified threshold and sets pixels that pass the test to new color values. Using the threshold() method, you can isolate and replace color ranges in an image and perform other logical operations on image pixels. The threshold() method's test logic is as follows: If ((pixelValue &amp; mask) operation (threshold &amp; mask)), then set the pixel to color; Otherwise, if copySource == true, then set the pixel to corresponding pixel value from sourceBitmap. The operation parameter specifies the comparison operator to use for the threshold test. For example, by using &quot;==&quot; as the operation parameter, you can isolate a specific color value in an image. Or by using {operation: &quot;&lt;&quot;, mask: 0xFF000000, threshold: 0x7F000000, color: 0x00000000}, you can set all destination pixels to be fully transparent when the source image pixel's alpha is less than 0x7F. You can use this technique for animated transitions and other effects. sourceBitmapData sourceRect destPoint operation threshold color mask copySource The input bitmap image to use. The source image can be a different BitmapData object or it can refer to the current BitmapData instance. A rectangle that defines the area of the source image to use as input. The point within the destination image (the current BitmapData instance) that corresponds to the upper-left corner of the source rectangle. One of the following comparison operators, passed as a String: &quot;&lt;&quot;, &quot;&lt;=&quot;, &quot;&gt;&quot;, &quot;&gt;=&quot;, &quot;==&quot;, &quot;!=&quot; The value that each pixel is tested against to see if it meets or exceeds the threshhold. The color value that a pixel is set to if the threshold test succeeds. The default value is 0x00000000. The mask to use to isolate a color component. If the value is true, pixel values from the source image are copied to the destination when the threshold test fails. If the value is false, the source image is not copied when the threshold test fails. The following example uses the perlinNoise() method to add a blue and red pattern to one BitmapData object, and then uses the threshold() method to copy those pixels from the first BitmapData object to a second one, replacing those pixels in which the red value is greater than 0x80 (50%) with a pixel set to transparent red (0x20FF0000): import flash.display.Bitmap; import flash.display.BitmapData; import flash.display.BitmapDataChannel; import flash.geom.Point; import flash.geom.Rectangle; var bmd1:BitmapData = new BitmapData(200, 200, true, 0xFFCCCCCC); var seed:int = int(Math.random() * int.MAX_VALUE); var channels:uint = BitmapDataChannel.RED | BitmapDataChannel.BLUE; bmd1.perlinNoise(100, 80, 12, seed, false, true, channels, false, null); var bitmap1:Bitmap = new Bitmap(bmd1); addChild(bitmap1); var bmd2:BitmapData = new BitmapData(200, 200, true, 0xFFCCCCCC); var pt:Point = new Point(0, 0); var rect:Rectangle = new Rectangle(0, 0, 200, 200); var threshold:uint = 0x00800000; var color:uint = 0x20FF0000; var maskColor:uint = 0x00FF0000; bmd2.threshold(bmd1, rect, pt, &quot;&gt;&quot;, threshold, color, maskColor, true); var bitmap2:Bitmap = new Bitmap(bmd2); bitmap2.x = bitmap1.x + bitmap1.width + 10; addChild(bitmap2); The sourceBitmapData, sourceRect destPoint or operation are null."/>
<page href="flash/display/BitmapData.html#unlock()" title="BitmapData.unlock()" text="unlock Unlocks an image so that any objects that reference the BitmapData object, such as Bitmap objects, are updated when this BitmapData object changes. To improve performance, use this method along with the lock() method before and after numerous calls to the setPixel() or setPixel32() method. changeRect The area of the BitmapData object that has changed. If you do not specify a value for this parameter, the entire area of the BitmapData object is considered changed. The following example creates a BitmapData object based on the bitmapData property of a Bitmap object, picture. It then calls the lock() method before calling a complicated custom function, complexTransformation(), that modifies the BitmapData object. (The picture object and the complexTransformation() function are not defined in this example.) Even if the complexTransformation() function updates the bitmapData property of the picture object, changes are not reflected until the code calls the unlock() method on the bitmapData object: import flash.display.BitmapData; var bitmapData:BitmapData = picture.bitmapData; bitmapData.lock(); bitmapData = complexTransformation(bitmapData); bitmapData.unlock(); picture.bitmapData = bitmapData;"/>
<page href="flash/display/BitmapData.html#height" title="BitmapData.height" text="height The height of the bitmap image in pixels."/>
<page href="flash/display/BitmapData.html#rect" title="BitmapData.rect" text="rect The rectangle that defines the size and location of the bitmap image. The top and left of the rectangle are 0; the width and height are equal to the width and height in pixels of the BitmapData object."/>
<page href="flash/display/BitmapData.html#transparent" title="BitmapData.transparent" text="transparent Defines whether the bitmap image supports per-pixel transparency. You can set this value only when you construct a BitmapData object by passing in true for the transparent parameter of the constructor. Then, after you create a BitmapData object, you can check whether it supports per-pixel transparency by determining if the value of the transparent property is true."/>
<page href="flash/display/BitmapData.html#width" title="BitmapData.width" text="width The width of the bitmap image in pixels."/>
<page href="flash/display/SpreadMethod.html" title="SpreadMethod class" text="SpreadMethod The SpreadMethod class provides values for the spreadMethod parameter in the beginGradientFill() and lineGradientStyle() methods of the Graphics class. The following example shows the same gradient fill using various spread methods: SpreadMethod.PAD SpreadMethod.REFLECT SpreadMethod.REPEAT"/>
<page href="flash/display/SpreadMethod.html#PAD" title="SpreadMethod.PAD" text="PAD Specifies that the gradient use the pad spread method."/>
<page href="flash/display/SpreadMethod.html#REFLECT" title="SpreadMethod.REFLECT" text="REFLECT Specifies that the gradient use the reflect spread method."/>
<page href="flash/display/SpreadMethod.html#REPEAT" title="SpreadMethod.REPEAT" text="REPEAT Specifies that the gradient use the repeat spread method."/>
<page href="flash/display/StageDisplayState.html" title="StageDisplayState class" text="StageDisplayState The StageDisplayState class provides values for the Stage.displayState property."/>
<page href="flash/display/StageDisplayState.html#FULL_SCREEN" title="StageDisplayState.FULL_SCREEN" text="FULL_SCREEN Specifies that the Stage is in full-screen mode."/>
<page href="flash/display/StageDisplayState.html#NORMAL" title="StageDisplayState.NORMAL" text="NORMAL Specifies that the Stage is in normal mode."/>
<page href="flash/display/Shape.html" title="Shape class" text="Shape The Shape class is used to create lightweight shapes by using the ActionScript drawing application program interface (API). The Shape class includes a graphics property, which lets you access methods from the Graphics class. The Sprite class also includes a graphicsproperty, and it includes other features not available to the Shape class. For example, a Sprite object is a display object container, whereas a Shape object is not (and cannot contain child display objects). For this reason, Shape objects consume less memory than Sprite objects that contain the same graphics. However, a Sprite object supports mouse click events, while a Shape object does not."/>
<page href="flash/display/Shape.html#Shape()" title="Shape.Shape()" text="Shape Creates a new Shape object."/>
<page href="flash/display/Shape.html#graphics" title="Shape.graphics" text="graphics Specifies the Graphics object belonging to this Shape object, where vector drawing commands can occur."/>
<page href="flash/display/BlendMode.html" title="BlendMode class" text="BlendMode A class that provides constant values for visual blend mode effects. These constants are used in the following: The blendMode property of the flash.display.DisplayObject class. The blendMode parameter of the draw() method of the flash.display.BitmapData class"/>
<page href="flash/display/BlendMode.html#ADD" title="BlendMode.ADD" text="ADD Adds the values of the constituent colors of the display object to the colors of its background, applying a ceiling of 0xFF. This setting is commonly used for animating a lightening dissolve between two objects. For example, if the display object has a pixel with an RGB value of 0xAAA633, and the background pixel has an RGB value of 0xDD2200, the resulting RGB value for the displayed pixel is 0xFFC833 (because 0xAA + 0xDD &gt; 0xFF, 0xA6 + 0x22 = 0xC8, and 0x33 + 0x00 = 0x33)."/>
<page href="flash/display/BlendMode.html#ALPHA" title="BlendMode.ALPHA" text="ALPHA Applies the alpha value of each pixel of the display object to the background. This requires the blendMode property of the parent display object be set to flash.display.BlendMode.LAYER."/>
<page href="flash/display/BlendMode.html#DARKEN" title="BlendMode.DARKEN" text="DARKEN Selects the darker of the constituent colors of the display object and the colors of the background (the colors with the smaller values). This setting is commonly used for superimposing type. For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0xDDCC00 (because 0xFF &gt; 0xDD, 0xCC &lt; 0xF8, and 0x33 &gt; 0x00 = 33)."/>
<page href="flash/display/BlendMode.html#DIFFERENCE" title="BlendMode.DIFFERENCE" text="DIFFERENCE Compares the constituent colors of the display object with the colors of its background, and subtracts the darker of the values of the two constituent colors from the lighter value. This setting is commonly used for more vibrant colors. For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0x222C33 (because 0xFF - 0xDD = 0x22, 0xF8 - 0xCC = 0x2C, and 0x33 - 0x00 = 0x33)."/>
<page href="flash/display/BlendMode.html#ERASE" title="BlendMode.ERASE" text="ERASE Erases the background based on the alpha value of the display object. This process requires that the blendMode property of the parent display object be set to flash.display.BlendMode.LAYER."/>
<page href="flash/display/BlendMode.html#HARDLIGHT" title="BlendMode.HARDLIGHT" text="HARDLIGHT Adjusts the color of each pixel based on the darkness of the display object. If the display object is lighter than 50% gray, the display object and background colors are screened, which results in a lighter color. If the display object is darker than 50% gray, the colors are multiplied, which results in a darker color. This setting is commonly used for shading effects."/>
<page href="flash/display/BlendMode.html#INVERT" title="BlendMode.INVERT" text="INVERT Inverts the background."/>
<page href="flash/display/BlendMode.html#LAYER" title="BlendMode.LAYER" text="LAYER Forces the creation of a transparency group for the display object. This means that the display object is precomposed in a temporary buffer before it is processed further. The precomposition is done automatically if the display object is precached by means of bitmap caching or if the display object is a display object container that has at least one child object with a blendMode setting other than &quot;normal&quot;."/>
<page href="flash/display/BlendMode.html#LIGHTEN" title="BlendMode.LIGHTEN" text="LIGHTEN Selects the lighter of the constituent colors of the display object and the colors of the background (the colors with the larger values). This setting is commonly used for superimposing type. For example, if the display object has a pixel with an RGB value of 0xFFCC33, and the background pixel has an RGB value of 0xDDF800, the resulting RGB value for the displayed pixel is 0xFFF833 (because 0xFF &gt; 0xDD, 0xCC &lt; 0xF8, and 0x33 &gt; 0x00 = 33)."/>
<page href="flash/display/BlendMode.html#MULTIPLY" title="BlendMode.MULTIPLY" text="MULTIPLY Multiplies the values of the display object constituent colors by the constituent colors of the background color, and normalizes by dividing by 0xFF, resulting in darker colors. This setting is commonly used for shadows and depth effects. For example, if a constituent color (such as red) of one pixel in the display object and the corresponding color of the pixel in the background both have the value 0x88, the multiplied result is 0x4840. Dividing by 0xFF yields a value of 0x48 for that constituent color, which is a darker shade than the color of the display object or the color of the background."/>
<page href="flash/display/BlendMode.html#NORMAL" title="BlendMode.NORMAL" text="NORMAL The display object appears in front of the background. Pixel values of the display object override the pixel values of the background. Where the display object is transparent, the background is visible."/>
<page href="flash/display/BlendMode.html#OVERLAY" title="BlendMode.OVERLAY" text="OVERLAY Adjusts the color of each pixel based on the darkness of the background. If the background is lighter than 50% gray, the display object and background colors are screened, which results in a lighter color. If the background is darker than 50% gray, the colors are multiplied, which results in a darker color. This setting is commonly used for shading effects."/>
<page href="flash/display/BlendMode.html#SCREEN" title="BlendMode.SCREEN" text="SCREEN Multiplies the complement (inverse) of the display object color by the complement of the background color, resulting in a bleaching effect. This setting is commonly used for highlights or to remove black areas of the display object."/>
<page href="flash/display/BlendMode.html#SUBTRACT" title="BlendMode.SUBTRACT" text="SUBTRACT Subtracts the values of the constituent colors in the display object from the values of the background color, applying a floor of 0. This setting is commonly used for animating a darkening dissolve between two objects. For example, if the display object has a pixel with an RGB value of 0xAA2233, and the background pixel has an RGB value of 0xDDA600, the resulting RGB value for the displayed pixel is 0x338400 (because 0xDD - 0xAA = 0x33, 0xA6 - 0x22 = 0x84, and 0x00 - 0x33 &lt; 0x00)."/>
<page href="flash/display/AVM1Movie.html" title="AVM1Movie class" text="AVM1Movie AVM1Movie is a simple class that represents AVM1 movie clips, which use ActionScript 1.0 or 2.0. (AVM1 is the ActionScript virtual machine used to run ActionScript 1.0 and 2.0. AVM2 is the ActionScript virtual machine used to run ActionScript 3.0.) When a Flash Player 8, or older, SWF file is loaded by a Loader object, an AVM1Movie object is created. The AVM1Movie object can use methods and properties inherited from the DisplayObject class (such as x, y, width, and so on). However, no interoperability (such as calling methods or using parameters) between the AVM1Movie object and AVM2 objects is allowed. There are several restrictions on an AVM1 SWF file loaded by an AVM2 SWF file: The loaded AVM1Movie object operates as a psuedo-root object for the AVM1 SWF file and all AVM1 SWF files loaded by it (as if the ActionScript 1.0 lockroot property were set to true). The AVM1 movie is always the top of any ActionScript 1.0 or 2.0 code execution in any children. The _root property for loaded children is always this AVM1 SWF file, unless the lockroot property is set in a loaded AVM1 SWF file. The AVM1 content cannot load files into levels. For example, it cannot load files by calling loadMovieNum(&quot;url&quot;, levelNum). The AVM1 SWF file that is loaded by an AVM2 SWF file cannot load another SWF file into this. That is, it cannot load another SWF file over itself. However, child Sprite objects, MovieClip objects, or other AVM1 SWF files loaded by this SWF file can load into this."/>
<page href="flash/display/Sprite.html" title="Sprite class" text="Sprite The Sprite class is a basic display list building block: a display list node that can display graphics and can also contain children. A Sprite object is similar to a movie clip, but does not have a timeline. Sprite is an appropriate base class for objects that do not require timelines. For example, Sprite would be a logical base class for user interface (UI) components that typically do not use the timeline. The Sprite class is new in ActionScript 3.0. It provides an alternative to the functionality of the MovieClip class, which retains all the functionality of previous ActionScript releases to provide backward compatibility."/>
<page href="flash/display/Sprite.html#Sprite()" title="Sprite.Sprite()" text="Sprite Creates a new Sprite instance. After you create the Sprite instance, call the DisplayObjectContainer.addChild() or DisplayObjectContainer.addChildAt() method to add the Sprite to a parent DisplayObjectContainer."/>
<page href="flash/display/Sprite.html#startDrag()" title="Sprite.startDrag()" text="startDrag Lets the user drag the specified sprite. The sprite remains draggable until explicitly stopped through a call to the Sprite.stopDrag() method, or until another sprite is made draggable. Only one sprite is draggable at a time. lockCenter bounds Specifies whether the draggable sprite is locked to the center of the mouse position (true), or locked to the point where the user first clicked the sprite (false). Value relative to the coordinates of the Sprite's parent that specify a constraint rectangle for the Sprite. The following example creates a circle sprite and two target sprites. The startDrag() method is called on the circle sprite when the user positions the cursor over the sprite and presses the mouse button, and the stopDrag() method is called when the user releases the mouse button. This lets the user drag the sprite. On release of the mouse button, the mouseRelease() method is called, which in turn traces the name of the dropTarget object — the one to which the user dragged the circle sprite: import flash.display.Sprite; import flash.events.MouseEvent; var circle:Sprite = new Sprite(); circle.graphics.beginFill(0xFFCC00); circle.graphics.drawCircle(0, 0, 40); var target1:Sprite = new Sprite(); target1.graphics.beginFill(0xCCFF00); target1.graphics.drawRect(0, 0, 100, 100); target1.name = &quot;target1&quot;; var target2:Sprite = new Sprite(); target2.graphics.beginFill(0xCCFF00); target2.graphics.drawRect(0, 200, 100, 100); target2.name = &quot;target2&quot;; addChild(target1); addChild(target2); addChild(circle); circle.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown) function mouseDown(event:MouseEvent):void { circle.startDrag(); } circle.addEventListener(MouseEvent.MOUSE_UP, mouseReleased); function mouseReleased(event:MouseEvent):void { circle.stopDrag(); trace(circle.dropTarget.name); }"/>
<page href="flash/display/Sprite.html#stopDrag()" title="Sprite.stopDrag()" text="stopDrag Ends the startDrag() method. A sprite that was made draggable with the startDrag() method remains draggable until a stopDrag() method is added, or until another sprite becomes draggable. Only one sprite is draggable at a time. The following example creates a circle sprite and two target sprites. The startDrag() method is called on the circle sprite when the user positions the cursor over the sprite and presses the mouse button, and the stopDrag() method is called when the user releases the mouse button. This lets the user drag the sprite. On release of the mouse button, the mouseRelease() method is called, which in turn traces the name of the dropTarget object — the one to which the user dragged the circle sprite: import flash.display.Sprite; import flash.events.MouseEvent; var circle:Sprite = new Sprite(); circle.graphics.beginFill(0xFFCC00); circle.graphics.drawCircle(0, 0, 40); var target1:Sprite = new Sprite(); target1.graphics.beginFill(0xCCFF00); target1.graphics.drawRect(0, 0, 100, 100); target1.name = &quot;target1&quot;; var target2:Sprite = new Sprite(); target2.graphics.beginFill(0xCCFF00); target2.graphics.drawRect(0, 200, 100, 100); target2.name = &quot;target2&quot;; addChild(target1); addChild(target2); addChild(circle); circle.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown) function mouseDown(event:MouseEvent):void { circle.startDrag(); } circle.addEventListener(MouseEvent.MOUSE_UP, mouseReleased); function mouseReleased(event:MouseEvent):void { circle.stopDrag(); trace(circle.dropTarget.name); }"/>
<page href="flash/display/Sprite.html#buttonMode" title="Sprite.buttonMode" text="buttonMode Specifies the button mode of this sprite. If true, this sprite behaves as a button, which means that it triggers the display of the hand cursor when the mouse passes over the sprite and can receive a click event if the enter or space keys are pressed when the sprite has focus. You can suppress the display of the hand cursor by setting the useHandCursor property to false, in which case the pointer is displayed. Although it is better to use the SimpleButton class to create buttons, you can use the buttonMode property to give a sprite some button-like functionality. To include a sprite in the tab order, set the tabEnabled property (inherited from the InteractiveObject class and false by default) to true. Additionally, consider whether you want the children of your sprite to be mouse enabled. Most buttons do not enable mouse interactivity for their child objects because it confuses the event flow. To disable mouse interactivity for all child objects, you must set the mouseChildren property (inherited from the DisplayObjectContainer class) to false. If you use the buttonMode property with the MovieClip class (which is a subclass of the Sprite class), your button might have some added functionality. If you include frames labeled _up, _over, and _down, Flash Player provides automatic state changes (functionality similar to that provided in previous versions of ActionScript for movie clips used as buttons). These automatic state changes are not available for sprites, which have no timeline, and thus no frames to label. The following example creates two sprites and sets the buttonMode property to true for one and false for the other. When you compile and run the application, both sprites respond to mouse events, but only the one in which buttonMode is set to true uses the hand cursor and is included in the tab order: import flash.display.Sprite; import flash.events.MouseEvent; var circle1:Sprite = new Sprite(); circle1.graphics.beginFill(0xFFCC00); circle1.graphics.drawCircle(40, 40, 40); circle1.buttonMode = true; circle1.addEventListener(MouseEvent.CLICK, clicked); var circle2:Sprite = new Sprite(); circle2.graphics.beginFill(0xFFCC00); circle2.graphics.drawCircle(120, 40, 40); circle2.buttonMode = false; circle2.addEventListener(MouseEvent.CLICK, clicked); function clicked(event:MouseEvent):void { trace(&quot;Click!&quot;); } addChild(circle1); addChild(circle2);"/>
<page href="flash/display/Sprite.html#dropTarget" title="Sprite.dropTarget" text="dropTarget Specifies the display object over which the sprite is being dragged, or on which the sprite was dropped. The following example creates a circle sprite and two target sprites. The startDrag() method is called on the circle sprite when the user positions the cursor over the sprite and presses the mouse button, and the stopDrag() method is called when the user releases the mouse button. This lets the user drag the sprite. On release of the mouse button, the mouseRelease() method is called, which in turn traces the name of the dropTarget object — the one to which the user dragged the circle sprite: import flash.display.Sprite; import flash.events.MouseEvent; var circle:Sprite = new Sprite(); circle.graphics.beginFill(0xFFCC00); circle.graphics.drawCircle(0, 0, 40); var target1:Sprite = new Sprite(); target1.graphics.beginFill(0xCCFF00); target1.graphics.drawRect(0, 0, 100, 100); target1.name = &quot;target1&quot;; var target2:Sprite = new Sprite(); target2.graphics.beginFill(0xCCFF00); target2.graphics.drawRect(0, 200, 100, 100); target2.name = &quot;target2&quot;; addChild(target1); addChild(target2); addChild(circle); circle.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown) function mouseDown(event:MouseEvent):void { circle.startDrag(); } circle.addEventListener(MouseEvent.MOUSE_UP, mouseReleased); function mouseReleased(event:MouseEvent):void { circle.stopDrag(); trace(circle.dropTarget.name); }"/>
<page href="flash/display/Sprite.html#graphics" title="Sprite.graphics" text="graphics Specifies the Graphics object that belongs to this sprite where vector drawing commands can occur. The following example creates a circle sprite and uses its graphics property to draw a circle with a yellow (0xFFCC00) fill: import flash.display.Sprite; var circle:Sprite = new Sprite(); circle.graphics.beginFill(0xFFCC00); circle.graphics.drawCircle(40, 40, 40); addChild(circle);"/>
<page href="flash/display/Sprite.html#hitArea" title="Sprite.hitArea" text="hitArea Designates another sprite to serve as the hit area for a sprite. If the hitArea property does not exist or the value is null or undefined, the sprite itself is used as the hit area. The value of the hitArea property can be a reference to a Sprite object. You can change the hitArea property at any time; the modified sprite immediately uses the new hit area behavior. The sprite designated as the hit area does not need to be visible; its graphical shape, although not visible, is still detected as the hit area. Note: You must set to false the mouseEnabled property of the sprite designated as the hit area. Otherwise, your sprite button might not work because the sprite designated as the hit area receives the mouse events instead of your sprite button. The following example creates a circle sprite and a square sprite. The square sprite is the hitArea for the circle sprite. So when the user clicks the square sprite, the circle sprite dispatches a click event: import flash.display.Sprite; import flash.events.MouseEvent; var circle:Sprite = new Sprite(); circle.graphics.beginFill(0xFFCC00); circle.graphics.drawCircle(0, 0, 40); var square:Sprite = new Sprite(); square.graphics.beginFill(0xCCFF00); square.graphics.drawRect(200, 0, 100, 100); circle.hitArea = square; square.mouseEnabled = false; circle.addEventListener(MouseEvent.CLICK, clicked); function clicked(event:MouseEvent):void{ trace(event.target == circle); // true trace(event.target == square); // false } addChild(circle); addChild(square);"/>
<page href="flash/display/Sprite.html#soundTransform" title="Sprite.soundTransform" text="soundTransform Controls sound within this sprite. The following example creates a sprite named container and adds a Loader object to its child list. The Loader object loads a SWF file. When the user clicks the link in the tf text field true, the mute() method sets the volume property of the soundTransform property of the container sprite: import flash.display.Sprite; import flash.display.Loader; import flash.events.IOErrorEvent; import flash.events.MouseEvent; import flash.net.URLRequest; import flash.text.TextField; import flash.media.SoundTransform; var container:Sprite = new Sprite(); addChild(container); var ldr:Loader = new Loader; var urlReq:URLRequest = new URLRequest(&quot;SoundPlayer.swf&quot;); ldr.load(urlReq); container.addChild(ldr); ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, urlNotFound); var tf:TextField = new TextField(); tf.htmlText = &quot;&lt;a href = 'event:Mute'&gt;Mute / Unmute&lt;/a&gt;&quot;; addChild(tf); var mySoundTransform:SoundTransform = new SoundTransform(); mySoundTransform.volume = 1; tf.addEventListener(MouseEvent.CLICK, mute); function mute(event:MouseEvent):void { if (mySoundTransform.volume == 0) { mySoundTransform.volume = 1; } else { mySoundTransform.volume = 0; } container.soundTransform = mySoundTransform; } function urlNotFound(event:IOErrorEvent):void { trace(&quot;The URL was not found.&quot;); }"/>
<page href="flash/display/Sprite.html#useHandCursor" title="Sprite.useHandCursor" text="useHandCursor A Boolean value that indicates whether the pointing hand (hand cursor) appears when the mouse rolls over a sprite in which the buttonMode property is set to true. The default value of the useHandCursor property is true. If useHandCursor is set to true, the pointing hand used for buttons appears when the mouse rolls over a button sprite. If useHandCursor is false, the arrow pointer is used instead. You can change the useHandCursor property at any time; the modified sprite immediately takes on the new cursor appearance. The following example creates two sprites and sets the buttonMode property to true for both, yet it sets the useHandCursor property to true for one and false for the other. When you compile and run the application, both sprites respond as buttons (and are included in the tab order), but only the one in which useHandCursor is set to true uses the hand cursor: import flash.display.Sprite; import flash.events.MouseEvent; var circle1:Sprite = new Sprite(); circle1.graphics.beginFill(0xFFCC00); circle1.graphics.drawCircle(40, 40, 40); circle1.buttonMode = true; circle1.useHandCursor = true; circle1.addEventListener(MouseEvent.CLICK, clicked); var circle2:Sprite = new Sprite(); circle2.graphics.beginFill(0xFFCC00); circle2.graphics.drawCircle(120, 40, 40); circle2.buttonMode = true; circle2.useHandCursor = false; circle2.addEventListener(MouseEvent.CLICK, clicked); function clicked(event:MouseEvent):void { trace(&quot;Click!&quot;); } addChild(circle1); addChild(circle2);"/>
<page href="flash/display/Loader.html" title="Loader class" text="Loader The Loader class is used to load SWF files or image (JPG, PNG, or GIF) files. Use the load() method to initiate loading. The loaded display object is added as a child of the Loader object. Use the URLLoader class to load text or binary data. The Loader class overrides the following methods that it inherits, because a Loader object can only have one child display object—the display object that it loads. Calling the following methods throws an exception: addChild(), addChildAt(), removeChild(), removeChildAt(), and setChildIndex(). To remove a loaded display object, you must remove the Loader object from its parent DisplayObjectContainer child array. Note: The ActionScript 2.0 MovieClipLoader and LoadVars classes are not used in ActionScript 3.0. The Loader and URLLoader classes replace them. When you use the Loader class, consider the Flash Player security model: You can load content from any accessible source. Loading is not allowed if the calling SWF file is in a network sandbox and the file to be loaded is local. If the loaded content is a SWF file written with ActionScript 3.0, it cannot be cross-scripted by a SWF file in another security sandbox unless that cross-scripting arrangement was approved through a call to the System.allowDomain() or the System.allowInsecureDomain() method in the loaded content file. If the loaded content is an AVM1 SWF file (written using ActionScript 1.0 or 2.0), it cannot be cross-scripted by an AVM2 SWF file (written using ActionScript 3.0). However, you can communicate between the two SWF files by using the LocalConnection class. If the loaded content is an image, its data cannot be accessed by a SWF file outside of the security sandbox, unless the domain of that SWF file was included in a cross-domain policy file at the origin domain of the image. Movie clips in the local-with-file-system sandbox cannot script movie clips in the local-with-networking sandbox, and the reverse is also prevented. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper When loading a SWF file from an untrusted source (such as a domain other than that of the Loader object's root SWF file), you may want to define a mask for the Loader object, to prevent the loaded content (which is a child of the Loader object) from drawing to portions of the Stage outside of that mask, as shown in the following code: import flash.display.~~; import flash.net.URLRequest; var rect:Shape = new Shape(); rect.graphics.beginFill(0xFFFFFF); rect.graphics.drawRect(0, 0, 100, 100); rect.graphics.endFill(); addChild(rect); var ldr:Loader = new Loader(); ldr.mask = rect; var url:String = &quot;http://www.unknown.example.com/content.swf&quot;; var urlReq:URLRequest = new URLRequest(url); ldr.load(urlReq); addChild(ldr);"/>
<page href="flash/display/Loader.html#Loader()" title="Loader.Loader()" text="Loader Creates a Loader object that you can use to load files, such as SWF, JPEG, GIF, or PNG files. Call the load() method to load the asset as a child of the Loader instance. You can then add the Loader object to the display list (for instance, by using the addChild() method of a DisplayObjectContainer instance). The asset appears on the Stage as it loads. You can also use a Loader instance &quot;offlist,&quot; that is without adding it to a display object container on the display list. In this mode, the Loader instance might be used to load a SWF file that contains additional modules of an application. To detect when the SWF file is finished loading, you can use the events of the LoaderInfo object associated with the contentLoaderInfo property of the Loader object. At that point, the code in the module SWF file can be executed to initialize and start the module. In the offlist mode, a Loader instance might also be used to load a SWF file that contains components or media assets. Again, you can use the LoaderInfo object event notifications to detect when the components is finished loading. At that point, the application can start using the components and media assets in the library of the SWF file by instantiating the ActionScript 3.0 classes that represent those components and assets. To determine the status of a Loader object, monitor the following events that the LoaderInfo object associated with the contentLoaderInfo property of the Loader object: The open event is dispatched when loading begins. The ioError or securityError event is dispatched if the file cannot be loaded or if an error occured during the load process. The progress event fires continuously while the file is being loaded. The complete event is dispatched when a file completes downloading, but before the loaded movie clip's methods and properties are available. The init event is dispatched after the properties and methods of the loaded SWF file are accessible, so you can begin manipulating the loaded SWF file. This event is dispatched before the complete handler. In streaming SWF files, the init event can occur significantly earlier than the complete event. For most purposes, use the init handler."/>
<page href="flash/display/Loader.html#close()" title="Loader.close()" text="close Cancels a load() method operation that is currently in progress for the Loader instance."/>
<page href="flash/display/Loader.html#load()" title="Loader.load()" text="load Loads a SWF, JPEG, progressive JPEG, unanimated GIF, or PNG file into an object that is a child of this Loader object. If you load an animated GIF file, only the first frame is displayed. As the Loader object can contain only a single child, issuing a subsequent load() request terminates the previous request, if still pending, and commences a new load. A SWF file or image loaded into a Loader object inherits the position, rotation, and scale properties of the parent display objects of the Loader object. Use the unload() method to remove movies or images loaded with this method, or to cancel a load operation that is in progress. When you use the load() method, consider the Flash Player security model: You can load content from any accessible source. Loading is not allowed if the calling SWF file is in a network sandbox and the file to be loaded is local. If the loaded content is a SWF file, it cannot be scripted by a SWF file in another security sandbox unless that cross-scripting arrangement was approved through a call to the Security.allowDomain() method in the loaded content file. SWF files written in ActionScript 1.0 or 2.0, which are loaded as AVM1Movie objects, cannot cross-script SWF files written in ActionScript 3.0, which are loaded as Sprite or MovieClip objects. You can use the LocalConnection class to have these files communicate with each other. If the loaded content is an image, its data cannot be accessed by a SWF file outside of the security sandbox, unless the domain of that SWF file was included a cross-domain policy file at the origin domain of the image. Movie clips in the local-with-file-system sandbox cannot cross-script movie clips in the local-with-networking sandbox, and the reverse is also prevented. 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. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper request context The absolute or relative URL of the SWF, JPEG, GIF, or PNG file to be loaded. A relative path must be relative to the main SWF file. Absolute URLs must include the protocol reference, such as http:// or file:///. Filenames cannot include disk drive specifications. A LoaderContext object, which has properties that define the following: Whether or not Flash Player should check for the existence of a policy file upon loading the object The ApplicationDomain for the loaded object The SecurityDomain for the loaded object For complete details, see the description of the properties in the LoaderContext class. The value of LoaderContext.securityDomain must be either null or SecurityDomain.currentDomain. This reflects the fact that you can only place the loaded media in its natural security sandbox or your own (the latter requires a policy file)."/>
<page href="flash/display/Loader.html#loadBytes()" title="Loader.loadBytes()" text="loadBytes Loads from binary data stored in a ByteArray object. bytes context A ByteArray object. The contents of the ByteArray can be any of the file formats supported by the Loader class: SWF, GIF, JPEG, or PNG. A LoaderContext object. Only the applicationDomain property of the LoaderContext object applies; the checkPolicyFile and securityDomain properties of the LoaderContext object do not apply. If the length property of the ByteArray object is not greater than 0."/>
<page href="flash/display/Loader.html#unload()" title="Loader.unload()" text="unload Removes a child of this Loader object that was loaded by using the load() method. The property of the associated LoaderInfo object is reset to null. The child is not necessarily destroyed because other objects might have references to it; however, it is no longer a child of the Loader object. As a best practice, before you unload a child SWF file, you should explicitly close any streams in the child SWF file's objects, such as LocalConnection, NetConnection, NetStream, and Sound objects. Otherwise, audio in the child SWF file might continue to play, even though the child SWF file was unloaded. To close streams in the child SWF file, add an event listener to the child that listens for the unload event. When the parent calls Loader.unload(), the unload event is dispatched to the child. The following code shows how you might do this: function closeAllStreams(evt:Event) { myNetStream.close(); mySound.close(); myNetConnection.close(); myLocalConnection.close(); } myMovieClip.loaderInfo.addEventListener(Event.UNLOAD, closeAllStreams);"/>
<page href="flash/display/Loader.html#content" title="Loader.content" text="content Contains the root display object of the SWF file or image (JPG, PNG, or GIF) file that was loaded by using the load() or loadBytes() methods. The loaded SWF file or image file belongs to a security sandbox to which you do not have access. For a loaded SWF file, you can avoid this situation by having the file call the Security.allowDomain() method or by having the loading file specify a loaderContext parameter with its securityDomain property set to SecurityDomain.currentDomain when you call the load() or loadBytes() method."/>
<page href="flash/display/Loader.html#contentLoaderInfo" title="Loader.contentLoaderInfo" text="contentLoaderInfo Returns a LoaderInfo object corresponding to the object being loaded. LoaderInfo objects are shared between the Loader object and the loaded content object. The LoaderInfo object supplies loading progress information and statistics about the loaded file. Events related to the load are dispatched by the LoaderInfo object referenced by the contentLoaderInfo property of the Loader object. The contentLoaderInfo property is set to a valid LoaderInfo object, even before the content is loaded, so that you can add event listeners to the object prior to the load."/>
<page href="flash/display/MorphShape.html" title="MorphShape class" text="MorphShape The MorphShape class represents MorphShape objects on the display list. You cannot create MorphShape objects directly in ActionScript; they are created when you create a shape tween in the Flash authoring tool."/>
<page href="fl/containers/BaseScrollPane.html" title="BaseScrollPane class" text="BaseScrollPane The BaseScrollPane class handles basic scroll pane functionality including events, styling, drawing the mask and background, the layout of scroll bars, and the handling of scroll positions. By default, the BaseScrollPane class is extended by the ScrollPane and SelectableList classes, for all list-based components. This means that any component that uses horizontal or vertical scrolling does not need to implement any scrolling, masking or layout logic, except for behavior that is specific to the component."/>
<page href="fl/containers/BaseScrollPane.html#BaseScrollPane()" title="BaseScrollPane.BaseScrollPane()" text="BaseScrollPane Creates a new BaseScrollPane component instance."/>
<page href="fl/containers/BaseScrollPane.html#getStyleDefinition()" title="BaseScrollPane.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/containers/BaseScrollPane.html#horizontalLineScrollSize" title="BaseScrollPane.horizontalLineScrollSize" text="horizontalLineScrollSize Gets or sets a value that describes the amount of content to be scrolled, horizontally, when a scroll arrow is clicked. This value is measured in pixels."/>
<page href="fl/containers/BaseScrollPane.html#horizontalPageScrollSize" title="BaseScrollPane.horizontalPageScrollSize" text="horizontalPageScrollSize Gets or sets the count of pixels by which to move the scroll thumb on the horizontal scroll bar when the scroll bar track is pressed. When this value is 0, this property retrieves the available width of the component."/>
<page href="fl/containers/BaseScrollPane.html#horizontalScrollBar" title="BaseScrollPane.horizontalScrollBar" text="horizontalScrollBar Gets a reference to the horizontal scroll bar."/>
<page href="fl/containers/BaseScrollPane.html#horizontalScrollPolicy" title="BaseScrollPane.horizontalScrollPolicy" text="horizontalScrollPolicy Gets or sets a value that indicates the state of the horizontal scroll bar. A value of ScrollPolicy.ON indicates that the horizontal scroll bar is always on; a value of ScrollPolicy.OFF indicates that the horizontal scroll bar is always off; and a value of ScrollPolicy.AUTO indicates that its state automatically changes. This property is used with other scrolling properties to set the setScrollProperties() method of the scroll bar."/>
<page href="fl/containers/BaseScrollPane.html#horizontalScrollPosition" title="BaseScrollPane.horizontalScrollPosition" text="horizontalScrollPosition Gets or sets a value that describes the horizontal position of the horizontal scroll bar in the scroll pane, in pixels. The following example creates a ScrollPane component instance that listens for the scroll event and traces the horizontal and vertical scroll positions: import fl.events.ScrollEvent; import fl.containers.ScrollPane; import fl.controls.ScrollBarDirection; var myScrollPane:ScrollPane = new ScrollPane(); myScrollPane.source = &quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;; myScrollPane.scrollDrag = true; myScrollPane.move(10, 10); myScrollPane.addEventListener(ScrollEvent.SCROLL, scrollHandler); addChild(myScrollPane); function scrollHandler(event:ScrollEvent):void { var sp:ScrollPane = event.target as ScrollPane; switch (event.direction) { case ScrollBarDirection.HORIZONTAL: trace(event.direction + &quot;:&quot;, sp.horizontalScrollPosition, &quot;of&quot;, sp.maxHorizontalScrollPosition); break; case ScrollBarDirection.VERTICAL: trace(event.direction + &quot;:&quot;, sp.verticalScrollPosition, &quot;of&quot;, sp.maxVerticalScrollPosition); break; } }"/>
<page href="fl/containers/BaseScrollPane.html#maxHorizontalScrollPosition" title="BaseScrollPane.maxHorizontalScrollPosition" text="maxHorizontalScrollPosition Gets the maximum horizontal scroll position for the current content, in pixels."/>
<page href="fl/containers/BaseScrollPane.html#maxVerticalScrollPosition" title="BaseScrollPane.maxVerticalScrollPosition" text="maxVerticalScrollPosition Gets the maximum vertical scroll position for the current content, in pixels."/>
<page href="fl/containers/BaseScrollPane.html#useBitmapScrolling" title="BaseScrollPane.useBitmapScrolling" text="useBitmapScrolling When set to true, the cacheAsBitmap property for the scrolling content is set to true; when set to false this value is turned off. Note: Setting this property to true increases scrolling performance."/>
<page href="fl/containers/BaseScrollPane.html#verticalLineScrollSize" title="BaseScrollPane.verticalLineScrollSize" text="verticalLineScrollSize Gets or sets a value that describes how many pixels to scroll vertically when a scroll arrow is clicked."/>
<page href="fl/containers/BaseScrollPane.html#verticalPageScrollSize" title="BaseScrollPane.verticalPageScrollSize" text="verticalPageScrollSize Gets or sets the count of pixels by which to move the scroll thumb on the vertical scroll bar when the scroll bar track is pressed. When this value is 0, this property retrieves the available height of the component."/>
<page href="fl/containers/BaseScrollPane.html#verticalScrollBar" title="BaseScrollPane.verticalScrollBar" text="verticalScrollBar Gets a reference to the vertical scroll bar."/>
<page href="fl/containers/BaseScrollPane.html#verticalScrollPolicy" title="BaseScrollPane.verticalScrollPolicy" text="verticalScrollPolicy Gets or sets a value that indicates the state of the vertical scroll bar. A value of ScrollPolicy.ON indicates that the vertical scroll bar is always on; a value of ScrollPolicy.OFF indicates that the vertical scroll bar is always off; and a value of ScrollPolicy.AUTO indicates that its state automatically changes. This property is used with other scrolling properties to set the setScrollProperties() method of the scroll bar."/>
<page href="fl/containers/BaseScrollPane.html#verticalScrollPosition" title="BaseScrollPane.verticalScrollPosition" text="verticalScrollPosition Gets or sets a value that describes the vertical position of the vertical scroll bar in the scroll pane, in pixels. The following example creates a ScrollPane component instance that listens for the scroll event and traces the horizontal and vertical scroll positions: import fl.events.ScrollEvent; import fl.containers.ScrollPane; import fl.controls.ScrollBarDirection; var myScrollPane:ScrollPane = new ScrollPane(); myScrollPane.source = &quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;; myScrollPane.scrollDrag = true; myScrollPane.move(10, 10); myScrollPane.addEventListener(ScrollEvent.SCROLL, scrollHandler); addChild(myScrollPane); function scrollHandler(event:ScrollEvent):void { var sp:ScrollPane = event.target as ScrollPane; switch (event.direction) { case ScrollBarDirection.HORIZONTAL: trace(event.direction + &quot;:&quot;, sp.horizontalScrollPosition, &quot;of&quot;, sp.maxHorizontalScrollPosition); break; case ScrollBarDirection.VERTICAL: trace(event.direction + &quot;:&quot;, sp.verticalScrollPosition, &quot;of&quot;, sp.maxVerticalScrollPosition); break; } }"/>
<page href="fl/containers/BaseScrollPane.html#event:scroll" title="BaseScrollPane.scroll" text="scroll Dispatched when the user scrolls content by using the scroll bars on the component or the wheel on a mouse device. The following example listens for the scroll event and uses the direction property of the ScrollEvent class to determine if the content was scrolled horizontally or vertically: import fl.containers.ScrollPane; import fl.events.ScrollEvent; import fl.controls.ScrollBarDirection; var myScrollPane:ScrollPane = new ScrollPane(); myScrollPane.scrollDrag = true; myScrollPane.source = &quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;; myScrollPane.addEventListener(ScrollEvent.SCROLL, scrollHandler); addChild(myScrollPane); function scrollHandler(event:ScrollEvent):void { switch (event.direction) { case ScrollBarDirection.HORIZONTAL: trace(&quot;horizontal scroll&quot;, event.position, &quot;of&quot;, event.currentTarget.maxHorizontalScrollPosition); break; case ScrollBarDirection.VERTICAL: trace(&quot;vertical scroll&quot;, event.position, &quot;of&quot;, event.currentTarget.maxVerticalScrollPosition); break; } }"/>
<page href="fl/containers/BaseScrollPane.html#style:contentPadding" title="BaseScrollPane.contentPadding" text="contentPadding Padding between the content (the component and scroll bar), and the outside edge of the background, in pixels."/>
<page href="fl/containers/BaseScrollPane.html#style:disabledAlpha" title="BaseScrollPane.disabledAlpha" text="disabledAlpha When the enabled property is set to false, interaction with the component is prevented and a white overlay is displayed over the component, dimming the component contents. The disabledAlpha style specifies the level of transparency that is applied to this overlay. Valid values range from 0, for an overlay that is completely transparent, to 1 for an overlay that is opaque."/>
<page href="fl/containers/BaseScrollPane.html#style:downArrowDisabledSkin" title="BaseScrollPane.downArrowDisabledSkin" text="downArrowDisabledSkin Name of the class to use as the skin for the down arrow button of the scroll bar when it is disabled. If you change the skin, either graphically or programmatically, you should ensure that the new skin is the same height (for horizontal scroll bars) or width (for vertical scroll bars) as the track."/>
<page href="fl/containers/BaseScrollPane.html#style:downArrowDownSkin" title="BaseScrollPane.downArrowDownSkin" text="downArrowDownSkin Name of the class to use as the skin for the down arrow button of the scroll bar when you click the arrow button. If you change the skin, either graphically or programmatically, you should ensure that the new skin is the same height (for horizontal scroll bars) or width (for vertical scroll bars) as the track."/>
<page href="fl/containers/BaseScrollPane.html#style:downArrowOverSkin" title="BaseScrollPane.downArrowOverSkin" text="downArrowOverSkin Name of the class to use as the skin for the down arrow button of the scroll bar when the mouse pointer is over the arrow button. If you change the skin, either graphically or programmatically, you should ensure that the new skin is the same height (for horizontal scroll bars) or width (for vertical scroll bars) as the track."/>
<page href="fl/containers/BaseScrollPane.html#style:downArrowUpSkin" title="BaseScrollPane.downArrowUpSkin" text="downArrowUpSkin Name of the class to use as the skin for the down arrow button of the scroll bar. If you change the skin, either graphically or programmatically, you should ensure that the new skin is the same height (for horizontal scroll bars) or width (for vertical scroll bars) as the track."/>
<page href="fl/containers/BaseScrollPane.html#style:repeatDelay" title="BaseScrollPane.repeatDelay" text="repeatDelay The number of milliseconds to wait after the buttonDown event is first dispatched before sending a second buttonDown event."/>
<page href="fl/containers/BaseScrollPane.html#style:repeatInterval" title="BaseScrollPane.repeatInterval" text="repeatInterval The interval, in milliseconds, between buttonDown events that are dispatched after the delay that is specified by the repeatDelay style."/>
<page href="fl/containers/BaseScrollPane.html#style:skin" title="BaseScrollPane.skin" text="skin The skin to be used as the background of the scroll pane."/>
<page href="fl/containers/BaseScrollPane.html#style:thumbDisabledSkin" title="BaseScrollPane.thumbDisabledSkin" text="thumbDisabledSkin The skin that is used to indicate the disabled state of the thumb."/>
<page href="fl/containers/BaseScrollPane.html#style:thumbDownSkin" title="BaseScrollPane.thumbDownSkin" text="thumbDownSkin Name of the class to use as the skin for the thumb of the scroll bar when you click the thumb."/>
<page href="fl/containers/BaseScrollPane.html#style:thumbIcon" title="BaseScrollPane.thumbIcon" text="thumbIcon Name of the class to use as the icon for the thumb of the scroll bar."/>
<page href="fl/containers/BaseScrollPane.html#style:thumbOverSkin" title="BaseScrollPane.thumbOverSkin" text="thumbOverSkin Name of the class to use as the skin for the thumb of the scroll bar when the mouse pointer is over the thumb."/>
<page href="fl/containers/BaseScrollPane.html#style:thumbUpSkin" title="BaseScrollPane.thumbUpSkin" text="thumbUpSkin Name of the class to use as the skin used for the thumb of the scroll bar."/>
<page href="fl/containers/BaseScrollPane.html#style:trackDisabledSkin" title="BaseScrollPane.trackDisabledSkin" text="trackDisabledSkin The skin that is used to indicate a disabled track."/>
<page href="fl/containers/BaseScrollPane.html#style:trackDownSkin" title="BaseScrollPane.trackDownSkin" text="trackDownSkin The skin that is used to indicate the down state of a disabled skin."/>
<page href="fl/containers/BaseScrollPane.html#style:trackOverSkin" title="BaseScrollPane.trackOverSkin" text="trackOverSkin The skin that is used to indicate the mouseover state for the scroll track."/>
<page href="fl/containers/BaseScrollPane.html#style:trackUpSkin" title="BaseScrollPane.trackUpSkin" text="trackUpSkin The skin used to indicate the mouse up state for the scroll track."/>
<page href="fl/containers/BaseScrollPane.html#style:upArrowDisabledSkin" title="BaseScrollPane.upArrowDisabledSkin" text="upArrowDisabledSkin Name of the class to use as the skin for the up arrow button of the scroll bar when it is disabled. If you change the skin, either graphically or programmatically, you should ensure that the new skin is the same height (for horizontal scroll bars) or width (for vertical scroll bars) as the track."/>
<page href="fl/containers/BaseScrollPane.html#style:upArrowDownSkin" title="BaseScrollPane.upArrowDownSkin" text="upArrowDownSkin Name of the class to use as the skin for the up arrow button of the scroll bar when you click the arrow button. If you change the skin, either graphically or programmatically, you should ensure that the new skin is the same height (for horizontal scroll bars) or width (for vertical scroll bars) as the track."/>
<page href="fl/containers/BaseScrollPane.html#style:upArrowOverSkin" title="BaseScrollPane.upArrowOverSkin" text="upArrowOverSkin Name of the class to use as the skin for the up arrow button of the scroll bar when the mouse pointer is over the arrow button. If you change the skin, either graphically or programmatically, you should ensure that the new skin is the same height (for horizontal scroll bars) or width (for vertical scroll bars) as the track."/>
<page href="fl/containers/BaseScrollPane.html#style:upArrowUpSkin" title="BaseScrollPane.upArrowUpSkin" text="upArrowUpSkin Name of the class to use as the skin for the up arrow button of the scroll bar. If you change the skin, either graphically or programmatically, you should ensure that the new skin is the same height (for horizontal scroll bars) or width (for vertical scroll bars) as the track."/>
<page href="fl/containers/UILoader.html" title="UILoader class" text="UILoader The UILoader class makes it possible to set content to load and to then monitor the loading operation at run time. This class also handles the resizing of the loaded content. If loading content from a different domain (sandbox), security implications may mean content properties are inaccessible. Please see the Loader class for more information. Using ActionScript to set a property of the UILoader class overrides the parameter of the same name that is set in the Property inspector or Component inspector. This component wraps flash.display.Loader. The Loader class handles all the actual loading; the UILoader just provides a visual display for the Loader object. Note: When content is being loaded from a different domain or sandbox, the properties of the content may be inaccessible for security reasons. For more information about how domain security affects the load process, see the Loader class."/>
<page href="fl/containers/UILoader.html#UILoader()" title="UILoader.UILoader()" text="UILoader Creates a new UILoader component instance."/>
<page href="fl/containers/UILoader.html#close()" title="UILoader.close()" text="close Cancels a load() method operation that is currently in progress for the Loader instance. The load() method can also be called from the source parameter. The following example creates a UILoader component instance and a Button component instance that allows you to cancel the UILoader instance's image download: import fl.containers.UILoader; import fl.controls.Button; var myUILoader:UILoader = new UILoader(); myUILoader.source = &quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;; myUILoader.move(10, 30); addChild(myUILoader); var cancelButton:Button = new Button(); cancelButton.label = &quot;Cancel download&quot;; cancelButton.move(10, 10); cancelButton.addEventListener(MouseEvent.CLICK, clickHandler); addChild(cancelButton); function clickHandler(event:MouseEvent):void { var uil:UILoader = myUILoader; try { uil.close(); trace(&quot;Download cancelled:&quot;, uil.source); } catch (error:Error) { trace(&quot;Unable to cancel download.&quot;, error.message); } } The URLStream object does not have an open stream."/>
<page href="fl/containers/UILoader.html#getStyleDefinition()" title="UILoader.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/containers/UILoader.html#load()" title="UILoader.load()" text="load Loads the specified content or, if no content is specified, loads the content from the location identified by the source property. By default, the LoaderContext object uses the current domain as the application domain. To specify a different application domain, to check a policy file, or to change the security domain, initialize a new LoaderContext object and pass it to this method. By default, the context property uses the current domain. To specify a different ApplicationDomain, check a policy file, or change the SecurityDomain, pass a new LoaderContext object. request context The URLRequest object that identifies the location from which to load the content. If this value is not specified, the current value of the source property is used as the content location. The LoaderContext object that sets the context of the load operation. The following example creates a new UILoader instance and loads an image using the load() method with the source property: import fl.containers.UILoader; var myUILoader:UILoader = new UILoader(); myUILoader.autoLoad = false; myUILoader.scaleContent = false; myUILoader.source = &quot;http://www.helpexamples.com/flash/images/image3.jpg&quot;; myUILoader.load(); myUILoader.move(10, 10); addChild(myUILoader);"/>
<page href="fl/containers/UILoader.html#loadBytes()" title="UILoader.loadBytes()" text="loadBytes Loads binary data that is stored in a ByteArray object. bytes context A ByteArray object that contains a file in one of the formats supported by the Loader class: SWF, GIF, JPEG, or PNG. Only the applicationDomain property of the LoaderContext object applies; the checkPolicyFile and securityDomain properties of the LoaderContext object do not apply. The following example loads the raw bytes of a GIF into a UILoader object: import fl.containers.UILoader; var imageBytes:Array = [ 71, 73, 70, 56, 57, 97, 50, 0, 30, 0, 230, 0, 0, 0, 0, 0, 173, 169, 206, 82, 73, 153, 74, 74, 74, 115, 109, 155, 248, 247, 251, 102, 102, 102, 26, 24, 35, 181, 181, 181, 70, 61, 145, 222, 222, 222, 153, 153, 153, 204, 204, 204, 58, 58, 58, 132, 132, 132, 231, 231, 231, 8, 7, 14, 90, 90, 90, 89, 81, 163, 153, 153, 153, 191, 188, 217, 165, 165, 165, 190, 190, 190, 237, 237, 233, 51, 51, 51, 214, 214, 214, 90, 82, 156, 156, 152, 190, 123, 123, 123, 140, 140, 140, 140, 135, 187, 103, 96, 165, 78, 70, 150, 173, 173, 173, 127, 121, 179, 82, 82, 82, 206, 204, 226, 195, 195, 193, 102, 102, 102, 247, 247, 247, 41, 41, 41, 66, 66, 66, 183, 179, 212, 146, 141, 190, 21, 21, 20, 227, 226, 238, 119, 111, 181, 198, 195, 221, 99, 91, 162, 255, 255, 255, 218, 216, 233, 114, 114, 114, 16, 15, 27, 114, 107, 171, 210, 208, 228, 8, 8, 8, 179, 175, 209, 240, 239, 246, 153, 153, 153, 234, 233, 243, 95, 88, 160, 90, 74, 156, 33, 33, 33, 16, 16, 16, 163, 159, 200, 142, 137, 188, 197, 189, 222, 134, 129, 183, 151, 147, 193, 202, 199, 223, 222, 221, 235, 122, 115, 176, 215, 213, 231, 74, 66, 147, 82, 75, 146, 197, 197, 197, 106, 99, 166, 231, 230, 240, 175, 171, 207, 239, 239, 239, 209, 207, 227, 25, 25, 22, 119, 112, 182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 249, 4, 0, 7, 0, 255, 0, 44, 0, 0, 0, 0, 50, 0, 30, 0, 0, 7, 255, 128, 49, 130, 131, 132, 132, 8, 24, 0, 16, 6, 15, 133, 141, 5, 54, 69, 77, 141, 147, 148, 147, 51, 63, 0, 153, 0, 40, 8, 148, 5, 1, 53, 48, 48, 31, 30, 50, 149, 167, 133, 5, 41, 154, 172, 0, 33, 141, 59, 76, 9, 2, 26, 181, 32, 32, 42, 168, 168, 170, 173, 172, 63, 23, 132, 59, 31, 32, 181, 197, 181, 73, 185, 186, 147, 5, 3, 189, 173, 29, 131, 194, 196, 198, 198, 184, 202, 141, 205, 206, 172, 35, 130, 77, 195, 212, 224, 73, 56, 215, 131, 217, 218, 154, 41, 49, 222, 211, 224, 212, 226, 228, 230, 231, 153, 6, 5, 223, 237, 237, 239, 186, 241, 242, 0, 11, 46, 236, 247, 194, 5, 64, 181, 79, 222, 129, 15, 180, 2, 6, 76, 226, 164, 82, 193, 115, 52, 148, 72, 80, 72, 145, 225, 164, 135, 218, 34, 242, 160, 200, 145, 225, 133, 12, 229, 248, 177, 210, 200, 177, 36, 136, 13, 140, 98, 112, 16, 169, 9, 130, 146, 141, 37, 75, 38, 121, 17, 195, 2, 38, 150, 81, 8, 76, 228, 40, 160, 39, 79, 38, 77, 26, 176, 4, 192, 130, 129, 148, 132, 10, 147, 0, 65, 162, 1, 169, 194, 32, 67, 127, 100, 40, 224, 244, 94, 18, 34, 130, 108, 248, 228, 200, 242, 7, 131, 24, 70, 170, 134, 91, 65, 8, 202, 86, 133, 17, 248, 121, 21, 148, 131, 135, 216, 98, 73, 255, 130, 52, 42, 114, 182, 157, 8, 5, 62, 206, 173, 29, 228, 33, 137, 85, 15, 148, 232, 190, 213, 0, 195, 84, 5, 109, 123, 7, 181, 104, 26, 110, 200, 169, 23, 32, 196, 38, 24, 40, 168, 195, 141, 86, 40, 190, 54, 34, 161, 33, 73, 207, 158, 73, 0, 163, 122, 33, 192, 115, 79, 16, 87, 11, 101, 152, 209, 0, 195, 128, 5, 39, 42, 237, 32, 194, 132, 7, 143, 35, 20, 174, 181, 88, 241, 193, 182, 8, 154, 228, 42, 229, 200, 17, 188, 184, 241, 224, 29, 150, 148, 0, 25, 35, 67, 133, 24, 39, 20, 44, 89, 18, 3, 1, 243, 37, 8, 136, 215, 68, 112, 34, 250, 146, 39, 5, 16, 88, 16, 36, 125, 73, 120, 230, 25, 16, 164, 44, 81, 194, 0, 2, 235, 5, 44, 116, 232, 244, 0, 67, 135, 8, 41, 58, 52, 200, 80, 194, 129, 131, 1, 49, 204, 48, 195, 2, 6, 224, 197, 65, 6, 35, 44, 192, 193, 12, 57, 160, 112, 95, 126, 13, 40, 16, 130, 1, 21, 140, 144, 129, 3, 51, 84, 128, 194, 18, 28, 148, 32, 31, 7, 6, 196, 160, 64, 4, 49, 44, 65, 162, 3, 11, 88, 128, 98, 10, 10, 164, 35, 72, 6, 0, 46, 48, 131, 32, 3, 88, 64, 98, 123, 42, 85, 136, 226, 12, 29, 112, 163, 146, 5, 28, 88, 16, 66, 7, 11, 0, 56, 98, 77, 33, 162, 56, 194, 88, 18, 10, 52, 240, 64, 4, 22, 40, 208, 1, 3, 36, 50, 48, 130, 116, 17, 28, 9, 100, 12, 14, 132, 224, 64, 7, 82, 142, 168, 94, 10, 37, 112, 16, 66, 10, 25, 48, 144, 194, 5, 90, 38, 89, 193, 2, 40, 140, 128, 65, 5, 12, 248, 224, 3, 7, 79, 10, 226, 128, 157, 37, 156, 192, 141, 5, 51, 114, 80, 193, 19, 24, 196, 121, 66, 157, 173, 49, 208, 161, 3, 40, 68, 208, 0, 7, 129, 0, 0, 59 ]; var totalBytes:uint = imageBytes.length; var newBytes:ByteArray = new ByteArray() var i:uint; for(i=0; i&lt;totalBytes; i++) { newBytes.writeByte(imageBytes[i]); } var loader:UILoader = new UILoader(); loader.loadBytes(newBytes); addChild(loader); The length property of the ByteArray object is 0."/>
<page href="fl/containers/UILoader.html#setSize()" title="UILoader.setSize()" text="setSize Resizes the component to the requested size. If the scaleContent property is set to true, the UILoader is not resized. w h The width of the component, in pixels. The height of the component, in pixels. The following example creates a UILoader component instance and resizes it on the Stage using the setSize() method: import fl.containers.UILoader; var myUILoader:UILoader = new UILoader(); myUILoader.source = &quot;http://www.helpexamples.com/flash/images/image2.jpg&quot;; myUILoader.addEventListener(Event.COMPLETE, completeHandler); addChild(myUILoader); function completeHandler(event:Event):void { var uiLdr:UILoader = event.currentTarget as UILoader; var image:DisplayObject = uiLdr.content as DisplayObject; trace(&quot;UILoader:&quot;, uiLdr.width, uiLdr.height); // 100 100 trace(&quot;UILoader.content:&quot;, image.width, image.height); // 400 267 uiLdr.setSize(image.width, image.height); uiLdr.move((stage.stageWidth - image.width) / 2, (stage.stageHeight - image.height) / 2); }"/>
<page href="fl/containers/UILoader.html#unload()" title="UILoader.unload()" text="unload Removes a child of this UILoader object that was loaded by using either the load() method or the source property. The following example loads an image into a UILoader component and unloads the loaded image when the UILoader component's click event is dispatched: import fl.containers.UILoader; var myUILoader:UILoader = new UILoader(); myUILoader.source = &quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;; myUILoader.move(10, 10); myUILoader.addEventListener(MouseEvent.CLICK, clickHandler); addChild(myUILoader); function clickHandler(event:MouseEvent):void { var uil:UILoader = event.currentTarget as UILoader; uil.unload(); removeChild(uil); }"/>
<page href="fl/containers/UILoader.html#autoLoad" title="UILoader.autoLoad" text="autoLoad Gets or sets a value that indicates whether the UILoader instance automatically loads the specified content. A value of true indicates that the UILoader automatically loads the content; a value of false indicates that content is not loaded until the load() method is called. The following example shows how setting the autoLoad property to false prevents the content from being loaded until the load() method is called: import fl.containers.UILoader; import fl.controls.Button; var myUILoader:UILoader = new UILoader(); myUILoader.autoLoad = false; myUILoader.scaleContent = false; myUILoader.source = &quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;; myUILoader.move(10, 40); addChild(myUILoader); var myButton:Button = new Button(); myButton.label = &quot;Load image&quot;; myButton.move(10, 10); myButton.addEventListener(MouseEvent.CLICK, clickHandler); addChild(myButton); function clickHandler(event:MouseEvent):void { myUILoader.load(); }"/>
<page href="fl/containers/UILoader.html#bytesLoaded" title="UILoader.bytesLoaded" text="bytesLoaded Gets the count of bytes of content that have been loaded. When this property equals the value of bytesTotal, all the bytes are loaded. The following example creates a UILoader component instance that displays a loaded image, and a ProgressBar and Label component instance which display the current download status of the image: import fl.containers.UILoader; import fl.controls.Label; import fl.controls.ProgressBar; import fl.controls.ProgressBarMode; var url:String = &quot;http://www.helpexamples.com/flash/images/image3.jpg&quot;; var myLabel:Label = new Label(); myLabel.autoSize = TextFieldAutoSize.LEFT; myLabel.text = &quot;&quot;; myLabel.move(10, 10); addChild(myLabel); var myProgressBar:ProgressBar = new ProgressBar(); myProgressBar.mode = ProgressBarMode.MANUAL; myProgressBar.move(10, 30); addChild(myProgressBar); var myUILoader:UILoader = new UILoader(); myUILoader.load(new URLRequest(url)); myUILoader.addEventListener(ProgressEvent.PROGRESS, progressHandler); myUILoader.addEventListener(Event.COMPLETE, completeHandler); myUILoader.move(10, 35); addChild(myUILoader); function progressHandler(event:ProgressEvent):void { var uiLdr:UILoader = event.currentTarget as UILoader; var kbLoaded:String = Number(uiLdr.bytesLoaded / 1024).toFixed(1); var kbTotal:String = Number(uiLdr.bytesTotal / 1024).toFixed(1); myLabel.text = kbLoaded + &quot; of &quot; + kbTotal + &quot; KB&quot; + &quot; (&quot; + Math.round(uiLdr.percentLoaded) + &quot;%)&quot;; myProgressBar.setProgress(event.bytesLoaded, event.bytesTotal); } function completeHandler(event:Event):void { myLabel.visible = false; myProgressBar.visible = false; myUILoader.removeEventListener(ProgressEvent.PROGRESS, progressHandler); myUILoader.removeEventListener(Event.COMPLETE, completeHandler); }"/>
<page href="fl/containers/UILoader.html#bytesTotal" title="UILoader.bytesTotal" text="bytesTotal Gets the count of bytes of content to be loaded. The following example creates a UILoader component instance that displays a loaded image, and a ProgressBar and Label component instance which display the current download status of the image: import fl.containers.UILoader; import fl.controls.Label; import fl.controls.ProgressBar; import fl.controls.ProgressBarMode; var url:String = &quot;http://www.helpexamples.com/flash/images/image3.jpg&quot;; var myLabel:Label = new Label(); myLabel.autoSize = TextFieldAutoSize.LEFT; myLabel.text = &quot;&quot;; myLabel.move(10, 10); addChild(myLabel); var myProgressBar:ProgressBar = new ProgressBar(); myProgressBar.mode = ProgressBarMode.MANUAL; myProgressBar.move(10, 30); addChild(myProgressBar); var myUILoader:UILoader = new UILoader(); myUILoader.load(new URLRequest(url)); myUILoader.addEventListener(ProgressEvent.PROGRESS, progressHandler); myUILoader.addEventListener(Event.COMPLETE, completeHandler); myUILoader.move(10, 35); addChild(myUILoader); function progressHandler(event:ProgressEvent):void { var uiLdr:UILoader = event.currentTarget as UILoader; var kbLoaded:String = Number(uiLdr.bytesLoaded / 1024).toFixed(1); var kbTotal:String = Number(uiLdr.bytesTotal / 1024).toFixed(1); myLabel.text = kbLoaded + &quot; of &quot; + kbTotal + &quot; KB&quot; + &quot; (&quot; + Math.round(uiLdr.percentLoaded) + &quot;%)&quot;; myProgressBar.setProgress(event.bytesLoaded, event.bytesTotal); } function completeHandler(event:Event):void { myLabel.visible = false; myProgressBar.visible = false; myUILoader.removeEventListener(ProgressEvent.PROGRESS, progressHandler); myUILoader.removeEventListener(Event.COMPLETE, completeHandler); }"/>
<page href="fl/containers/UILoader.html#content" title="UILoader.content" text="content Contains the root display object of the SWF file or image file (a JPEG, PNG, or GIF format file) that was loaded by using the load() method or setting the source property. The value is undefined until the load begins. Set the properties for the content within an event handler function for the complete event. The following example creates a slider that modifies the transparency of a UILoader object's content: import fl.controls.Slider; import fl.containers.UILoader; import fl.events.SliderEvent; var s:Slider = new Slider(); s.minimum = 10; s.maximum = 100; s.liveDragging = true; s.value = s.maximum; s.move(10,10); s.addEventListener(SliderEvent.THUMB_DRAG, updateUILoaderContentAlpha); addChild(s); var loader:UILoader = new UILoader(); loader.move(10,40); loader.setSize(400, 300); loader.source = &quot;http://www.helpexamples.com/flash/images/image2.jpg&quot;; addChild(loader); function updateUILoaderContentAlpha(e:SliderEvent):void { loader.content.alpha = s.value/100; }"/>
<page href="fl/containers/UILoader.html#maintainAspectRatio" title="UILoader.maintainAspectRatio" text="maintainAspectRatio Gets or sets a value that indicates whether to maintain the aspect ratio that was used in the original image or to resize the image at the curent width and height of the UILoader component. A value of true indicates that the original aspect ratio is to be maintained; a value of false indicates that the loaded content should be resized to the current dimensions of the UILoader. To use this property, you must set the scaleContent property to false; otherwise, this property is ignored. The following example uses a check box to toggle the value of the maintainAspectRatio property: import fl.containers.UILoader; import fl.controls.CheckBox; var myUILoader:UILoader = new UILoader(); myUILoader.setSize(200, 200); myUILoader.scaleContent = true; myUILoader.maintainAspectRatio = true; myUILoader.source = &quot;http://www.helpexamples.com/flash/images/image3.jpg&quot;; myUILoader.move(10, 10); addChild(myUILoader); var myCheckBox:CheckBox = new CheckBox(); myCheckBox.label = &quot;maintainAspectRatio&quot;; myCheckBox.selected = myUILoader.maintainAspectRatio; myCheckBox.width = 150; myCheckBox.move(220, 10); myCheckBox.addEventListener(Event.CHANGE, changeHandler); addChild(myCheckBox); function changeHandler(event:Event):void { myUILoader.maintainAspectRatio = event.target.selected; }"/>
<page href="fl/containers/UILoader.html#percentLoaded" title="UILoader.percentLoaded" text="percentLoaded Gets a number between 0 and 100 indicating what percentage of the content is loaded. If you are loading assets from your library, and not externally loaded content, the percentLoaded property is set to 0. The following example creates a UILoader component instance that displays a loaded image, and a ProgressBar and Label component instance which display the current download status of the image: import fl.containers.UILoader; import fl.controls.Label; import fl.controls.ProgressBar; import fl.controls.ProgressBarMode; var url:String = &quot;http://www.helpexamples.com/flash/images/image3.jpg&quot;; var myLabel:Label = new Label(); myLabel.autoSize = TextFieldAutoSize.LEFT; myLabel.text = &quot;&quot;; myLabel.move(10, 10); addChild(myLabel); var myProgressBar:ProgressBar = new ProgressBar(); myProgressBar.mode = ProgressBarMode.MANUAL; myProgressBar.move(10, 30); addChild(myProgressBar); var myUILoader:UILoader = new UILoader(); myUILoader.load(new URLRequest(url)); myUILoader.addEventListener(ProgressEvent.PROGRESS, progressHandler); myUILoader.addEventListener(Event.COMPLETE, completeHandler); myUILoader.move(10, 35); addChild(myUILoader); function progressHandler(event:ProgressEvent):void { var uiLdr:UILoader = event.currentTarget as UILoader; var kbLoaded:String = Number(uiLdr.bytesLoaded / 1024).toFixed(1); var kbTotal:String = Number(uiLdr.bytesTotal / 1024).toFixed(1); myLabel.text = kbLoaded + &quot; of &quot; + kbTotal + &quot; KB&quot; + &quot; (&quot; + Math.round(uiLdr.percentLoaded) + &quot;%)&quot;; myProgressBar.setProgress(event.bytesLoaded, event.bytesTotal); } function completeHandler(event:Event):void { myLabel.visible = false; myProgressBar.visible = false; myUILoader.removeEventListener(ProgressEvent.PROGRESS, progressHandler); myUILoader.removeEventListener(Event.COMPLETE, completeHandler); }"/>
<page href="fl/containers/UILoader.html#scaleContent" title="UILoader.scaleContent" text="scaleContent Gets or sets a value that indicates whether to automatically scale the image to the size of the UILoader instance. A value of true indicates that the image is automatically scaled to the size of the UILoader instance; a value of false indicates that the loaded content is automatically scaled to its default size. The following example creates a UILoader object that loads and matches the dimensions of an image: import fl.containers.UILoader; var loader:UILoader = new UILoader(); loader.scaleContent = false; loader.source = &quot;http://www.helpexamples.com/flash/images/image2.jpg&quot;; addChild(loader);"/>
<page href="fl/containers/UILoader.html#source" title="UILoader.source" text="source Gets or sets an absolute or relative URL that identifies the location of the SWF or image file to load, the class name of a movie clip in the library, a reference to a display object, or a instance name of a movie clip on the same level as the component. Valid image file formats include GIF, PNG, and JPEG. To load an asset by using a URLRequest object, use the load() method. The following example creates a UILoader object that loads and matches the dimensions of an image: import fl.containers.UILoader; var loader:UILoader = new UILoader(); loader.scaleContent = false; loader.source = &quot;http://www.helpexamples.com/flash/images/image2.jpg&quot;; addChild(loader);"/>
<page href="fl/containers/UILoader.html#event:complete" title="UILoader.complete" text="complete Dispatched when content loading is complete. This event is dispatched regardless of whether the load operation was triggered by an auto-load process or an explicit call to the load() method. The following example creates a UILoader instance and once the specified image has finished loading, centers the image on the Stage: import fl.containers.UILoader; var myUILoader:UILoader = new UILoader(); myUILoader.scaleContent = false; myUILoader.source = &quot;http://www.helpexamples.com/flash/images/image2.jpg&quot;; myUILoader.addEventListener(Event.COMPLETE, completeHandler); addChild(myUILoader); function completeHandler(event:Event):void { var uiLdr:UILoader = event.currentTarget as UILoader; var newX:uint = (stage.stageWidth - uiLdr.content.width) / 2; var newY:uint = (stage.stageHeight - uiLdr.content.height) / 2; uiLdr.move(newX, newY); }"/>
<page href="fl/containers/UILoader.html#event:init" title="UILoader.init" text="init Dispatched when the properties and methods of a loaded SWF file are accessible. The following conditions must exist for this event to be dispatched: All the properties and methods that are associated with the loaded object, as well as those that are associated with the component, must be accessible. The constructors for all child objects must have completed."/>
<page href="fl/containers/UILoader.html#event:ioError" title="UILoader.ioError" text="ioError Dispatched after an input or output error occurs. The following example creates a UILoader component instance and attempts to load a nonexistent file, which causes the ioError event to be dispatched: import fl.containers.UILoader; var url:String = &quot;http://www.helpexamples.com/flash/images/image404.jpg&quot; var myUILoader:UILoader = new UILoader(); myUILoader.load(new URLRequest(url)); myUILoader.move(10, 10); myUILoader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); addChild(myUILoader); function ioErrorHandler(event:IOErrorEvent):void { trace(&quot;&lt;&lt;&quot;, event.text, &quot;&gt;&gt;&quot;); myUILoader.removeEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); removeChild(myUILoader); }"/>
<page href="fl/containers/UILoader.html#event:open" title="UILoader.open" text="open Dispatched after a network operation starts."/>
<page href="fl/containers/UILoader.html#event:progress" title="UILoader.progress" text="progress Dispatched when content is loading. This event is dispatched regardless of whether the load operation was triggered by an auto-load process or an explicit call to the load() method. The following example creates a UILoader component instance that displays a loaded image, and a ProgressBar and Label component instance which display the current download status of the image: import fl.containers.UILoader; import fl.controls.Label; import fl.controls.ProgressBar; import fl.controls.ProgressBarMode; var url:String = &quot;http://www.helpexamples.com/flash/images/image3.jpg&quot;; var myLabel:Label = new Label(); myLabel.autoSize = TextFieldAutoSize.LEFT; myLabel.text = &quot;&quot;; myLabel.move(10, 10); addChild(myLabel); var myProgressBar:ProgressBar = new ProgressBar(); myProgressBar.mode = ProgressBarMode.MANUAL; myProgressBar.move(10, 30); addChild(myProgressBar); var myUILoader:UILoader = new UILoader(); myUILoader.load(new URLRequest(url)); myUILoader.addEventListener(ProgressEvent.PROGRESS, progressHandler); myUILoader.addEventListener(Event.COMPLETE, completeHandler); myUILoader.move(10, 35); addChild(myUILoader); function progressHandler(event:ProgressEvent):void { var uiLdr:UILoader = event.currentTarget as UILoader; var kbLoaded:String = Number(uiLdr.bytesLoaded / 1024).toFixed(1); var kbTotal:String = Number(uiLdr.bytesTotal / 1024).toFixed(1); myLabel.text = kbLoaded + &quot; of &quot; + kbTotal + &quot; KB&quot; + &quot; (&quot; + Math.round(uiLdr.percentLoaded) + &quot;%)&quot;; myProgressBar.setProgress(event.bytesLoaded, event.bytesTotal); } function completeHandler(event:Event):void { myLabel.visible = false; myProgressBar.visible = false; myUILoader.removeEventListener(ProgressEvent.PROGRESS, progressHandler); myUILoader.removeEventListener(Event.COMPLETE, completeHandler); }"/>
<page href="fl/containers/UILoader.html#event:resize" title="UILoader.resize" text="resize Dispatched after the component is resized. The following example creates a UILoader component instance, listens for the resize event, and centers the image on the Stage after it finishes loading: import fl.containers.UILoader; import fl.events.ComponentEvent; var myUILoader:UILoader = new UILoader(); myUILoader.scaleContent = false; myUILoader.source = &quot;http://www.helpexamples.com/flash/images/image3.jpg&quot;; myUILoader.addEventListener(ComponentEvent.RESIZE, resizeHandler); addChild(myUILoader); function resizeHandler(event:ComponentEvent):void { var uiLdr:UILoader = event.currentTarget as UILoader; trace(uiLdr.width, uiLdr.height); // 400 267 uiLdr.move((stage.stageWidth - uiLdr.width) / 2, (stage.stageHeight - uiLdr.height) / 2); }"/>
<page href="fl/containers/UILoader.html#event:securityError" title="UILoader.securityError" text="securityError Dispatched after a security error occurs while content is loading."/>
<page href="fl/containers/ScrollPane.html" title="ScrollPane class" text="ScrollPane The ScrollPane component displays display objects and JPEG, GIF, and PNG files, as well as SWF files, in a scrollable area. You can use a scroll pane to limit the screen area that is occupied by these media types. The scroll pane can display content that is loaded from a local disk or from the Internet. You can set this content while authoring and, at run time, by using ActionScript. After the scroll pane has focus, if its content has valid tab stops, those markers receive focus. After the last tab stop in the content, focus moves to the next component. The vertical and horizontal scroll bars in the scroll pane do not receive focus. Note: When content is being loaded from a different domain or sandbox, the properties of the content may be inaccessible for security reasons. For more information about how domain security affects the load process, see the Loader class."/>
<page href="fl/containers/ScrollPane.html#ScrollPane()" title="ScrollPane.ScrollPane()" text="ScrollPane Creates a new ScrollPane component instance."/>
<page href="fl/containers/ScrollPane.html#getStyleDefinition()" title="ScrollPane.getStyleDefinition()" text="getStyleDefinition Retrieves the default style map for the current component. The style map contains the type that is appropriate for the component, depending on the style that the component uses. For example, the disabledTextFormat style contains a value of null or a TextFormat object. You can use these styles and call setStyle() on the current component. The following code overrides the default disabledTextFormat style on the specified component: componentInstance.setStyle(&quot;disabledTextFormat&quot;, new TextFormat()); The following example creates a style browser for several component classes: import fl.controls.*; import fl.containers.*; import fl.controls.listClasses.*; import fl.controls.dataGridClasses.*; import fl.controls.progressBarClasses.*; import fl.core.UIComponent; import fl.data.DataProvider; var dp:DataProvider = new DataProvider(); dp.addItem( { label: &quot;BaseScrollPane&quot;, data:BaseScrollPane } ); dp.addItem( { label: &quot;Button&quot;, data:Button } ); dp.addItem( { label: &quot;CellRenderer&quot;, data:CellRenderer } ); dp.addItem( { label: &quot;CheckBox&quot;, data:CheckBox } ); dp.addItem( { label: &quot;ColorPicker&quot;, data:ColorPicker } ); dp.addItem( { label: &quot;ComboBox&quot;, data:ComboBox } ); dp.addItem( { label: &quot;DataGrid&quot;, data:DataGrid } ); dp.addItem( { label: &quot;HeaderRenderer&quot;, data:HeaderRenderer } ); dp.addItem( { label: &quot;ImageCell&quot;, data:ImageCell } ); dp.addItem( { label: &quot;IndeterminateBar&quot;,data:IndeterminateBar } ); dp.addItem( { label: &quot;Label&quot;, data:Label } ); dp.addItem( { label: &quot;List&quot;, data:List } ); dp.addItem( { label: &quot;NumericStepper&quot;, data:NumericStepper } ); dp.addItem( { label: &quot;ProgressBar&quot;, data:ProgressBar } ); dp.addItem( { label: &quot;RadioButton&quot;, data:RadioButton } ); dp.addItem( { label: &quot;ScrollPane&quot;, data:ScrollPane } ); dp.addItem( { label: &quot;Slider&quot;, data:Slider } ); dp.addItem( { label: &quot;TextArea&quot;, data:TextArea } ); dp.addItem( { label: &quot;TextInput&quot;, data:TextInput } ); dp.addItem( { label: &quot;TileList&quot;, data:TileList } ); dp.addItem( { label: &quot;UILoader&quot;, data:UILoader } ); dp.addItem( { label: &quot;UIComponent&quot;, data:UIComponent } ); var cb:ComboBox = new ComboBox(); cb.move(10,10); cb.setSize(300,25); cb.prompt = &quot;Select a component to view its styles&quot;; cb.rowCount = 12; cb.dataProvider = dp; cb.addEventListener(Event.CHANGE, showStyleDefinition); addChild(cb); var dg:DataGrid = new DataGrid(); dg.setSize(425,300); dg.move(10,50); dg.columns = [ new DataGridColumn(&quot;StyleName&quot;), new DataGridColumn(&quot;DefaultValue&quot;) ]; addChild(dg); function showStyleDefinition(e:Event):void { var componentClass:Class = e.target.selectedItem.data as Class; var styles:Object = componentClass[&quot;getStyleDefinition&quot;].call(this); trace(styles.toString()); var styleData:DataProvider = new DataProvider(); for(var i:* in styles) { trace(i + &quot; : &quot; + styles[i]); styleData.addItem( { StyleName:i, DefaultValue:styles[i] } ); } styleData.sortOn(&quot;StyleName&quot;); dg.dataProvider = styleData; }"/>
<page href="fl/containers/ScrollPane.html#load()" title="ScrollPane.load()" text="load The request parameter of this method accepts only a URLRequest object whose source property contains a string, a class, or a URLRequest object. By default, the LoaderContext object uses the current domain as the application domain. To specify a different application domain value, to check a policy file, or to change the security domain, initialize a new LoaderContext object and pass it to this method. request context The URLRequest object to use to load an image into the scroll pane. The LoaderContext object that sets the context of the load operation. The following example loads an image into a scroll pane: import fl.containers.ScrollPane; var request:URLRequest = new URLRequest(&quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;); var sp:ScrollPane = new ScrollPane(); sp.setSize(180, 160); sp.load(request); addChild(sp);"/>
<page href="fl/containers/ScrollPane.html#refreshPane()" title="ScrollPane.refreshPane()" text="refreshPane Reloads the contents of the scroll pane. This method does not redraw the scroll bar. To reset the scroll bar, use the update() method. The following example loads an image into a ScrollPane component instance and refreshes the pane using the refreshPane() method: import fl.containers.ScrollPane; import fl.controls.Button; import fl.controls.TextArea; var url:String = &quot;http://www.helpexamples.com/flash/images/image2.jpg&quot;; var myScrollPane:ScrollPane = new ScrollPane(); myScrollPane.setSize(320, 240); myScrollPane.move(10, 10); myScrollPane.load(new URLRequest(url)); myScrollPane.addEventListener(ProgressEvent.PROGRESS, progressHandler); myScrollPane.addEventListener(Event.COMPLETE, completeHandler); addChild(myScrollPane); var refreshButton:Button = new Button(); refreshButton.emphasized = true; refreshButton.label = &quot;refreshPane()&quot;; refreshButton.move(myScrollPane.x + myScrollPane.width + 10, myScrollPane.y); refreshButton.addEventListener(MouseEvent.CLICK, clickHandler); addChild(refreshButton); var myTextArea:TextArea = new TextArea(); myTextArea.editable = false; myTextArea.setSize(320, 120); myTextArea.move(myScrollPane.x, myScrollPane.y + myScrollPane.height + 10); addChild(myTextArea); function progressHandler(event:ProgressEvent):void { var bLoaded:int = event.bytesLoaded; var bTotal:int = event.bytesTotal; var pctLoaded:int = int(event.currentTarget.percentLoaded); addText(&quot;progress (&quot; + bLoaded + &quot; of &quot; + bTotal + &quot; bytes loaded -- &quot; + pctLoaded + &quot;%)&quot;); } function completeHandler(event:Event):void { addText(&quot;complete&quot;); addText(&quot;----------&quot;); } function clickHandler(event:MouseEvent):void { myScrollPane.refreshPane(); } function addText(str:String):void { myTextArea.appendText(str + &quot;\n&quot;); myTextArea.verticalScrollPosition = myTextArea.maxVerticalScrollPosition; }"/>
<page href="fl/containers/ScrollPane.html#update()" title="ScrollPane.update()" text="update Refreshes the scroll bar properties based on the width and height of the content. This is useful if the content of the ScrollPane changes during run time. The following example creates a ScrollPane component instance and loads different images based on which buttons a user clicks: import fl.containers.ScrollPane; import fl.controls.Button; var baseURL:String = &quot;http://www.helpexamples.com/flash/images/&quot;; var img1Button:Button = new Button(); img1Button.label = &quot;Image 1&quot;; img1Button.move(10, 10); img1Button.addEventListener(MouseEvent.CLICK, clickHandler); addChild(img1Button); var img2Button:Button = new Button(); img2Button.label = &quot;Image 2&quot;; img2Button.move(10, 40); img2Button.addEventListener(MouseEvent.CLICK, clickHandler); addChild(img2Button); var img3Button:Button = new Button(); img3Button.label = &quot;Image 3&quot;; img3Button.move(10, 70); img3Button.addEventListener(MouseEvent.CLICK, clickHandler); addChild(img3Button); var myScrollPane:ScrollPane = new ScrollPane(); myScrollPane.setSize(320, 240); myScrollPane.move(120, 10); myScrollPane.addEventListener(Event.COMPLETE, completeHandler); addChild(myScrollPane); function clickHandler(event:MouseEvent):void { switch (event.currentTarget) { case img1Button: myScrollPane.source = baseURL + &quot;image1.jpg&quot;; break; case img2Button: myScrollPane.source = baseURL + &quot;image2.jpg&quot;; break; case img3Button: myScrollPane.source = baseURL + &quot;image3.jpg&quot;; break; } } function completeHandler(event:Event):void { myScrollPane.update(); }"/>
<page href="fl/containers/ScrollPane.html#bytesLoaded" title="ScrollPane.bytesLoaded" text="bytesLoaded Gets the count of bytes of content that have been loaded. When this property equals the value of bytesTotal, all the bytes are loaded. The following example creates a scroll pane and loads &quot;test.jpg&quot; into it. As the load progresses, the Output panel displays the bytes loaded and bytes total and a progress bar provides a visual representation. Replace &quot;test.jpg&quot; with an image and place both ScrollPane and ProgressBar in the library of the FLA file: import fl.containers.ScrollPane; import fl.controls.ProgressBar; var path:String = &quot;test.jpg&quot;; var sp:ScrollPane = new ScrollPane(); sp.move(10,10); sp.setSize(530,300); sp.addEventListener(ProgressEvent.PROGRESS,reportProgress); sp.load(new URLRequest(path)); addChild(sp); var progressBar:ProgressBar = new ProgressBar(); progressBar.move(10,320); progressBar.setSize(530,50); progressBar.source = sp; addChild(progressBar); function reportProgress(e:ProgressEvent):void { trace(e.bytesLoaded + &quot; loaded out of &quot; + e.bytesTotal); }"/>
<page href="fl/containers/ScrollPane.html#bytesTotal" title="ScrollPane.bytesTotal" text="bytesTotal Gets the count of bytes of content to be loaded. The following example loads an external image into a ScrollPane instance and displays the bytesLoaded, bytesTotal and percentLoaded properties by listening for the progress and complete events: import fl.containers.ScrollPane; var url:String = &quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;; var myScrollPane:ScrollPane = new ScrollPane(); myScrollPane.setSize(320, 240); myScrollPane.move(10, 10); myScrollPane.addEventListener(ProgressEvent.PROGRESS, progressHandler); myScrollPane.addEventListener(Event.COMPLETE, completeHandler); myScrollPane.load(new URLRequest(url)); addChild(myScrollPane); function progressHandler(event:ProgressEvent):void { var bLoaded:int = event.bytesLoaded; var bTotal:int = event.bytesTotal; var pctLoaded:int = int(event.currentTarget.percentLoaded); trace(&quot;progress: &quot; + bLoaded + &quot; of &quot; + bTotal + &quot; bytes loaded (&quot; + pctLoaded + &quot;%)&quot;); } function completeHandler(event:Event):void { trace(&quot;complete:&quot;); }"/>
<page href="fl/containers/ScrollPane.html#content" title="ScrollPane.content" text="content Gets a reference to the content loaded into the scroll pane. The following example demonstrates how to modify the transparency of the content of a scroll pane: import fl.containers.ScrollPane; import fl.controls.NumericStepper; var ns:NumericStepper = new NumericStepper(); ns.minimum = 10; ns.maximum = 100; ns.stepSize = 10; ns.value = ns.maximum; ns.addEventListener(Event.CHANGE, updateScrollPaneContentAlpha); addChild(ns); var sp:ScrollPane = new ScrollPane(); sp.move(0,30); sp.setSize(180, 160); sp.source = &quot;http://www.helpexamples.com/flash/images/image2.jpg&quot;; addChild(sp); function updateScrollPaneContentAlpha(e:Event):void { sp.content.alpha = e.target.value / 100; }"/>
<page href="fl/containers/ScrollPane.html#percentLoaded" title="ScrollPane.percentLoaded" text="percentLoaded Gets a number between 0 and 100 indicating what percentage of the content is loaded. If you are loading assets from your library, and not externally loaded content, the percentLoaded property is set to 0. The following example loads an external image into a ScrollPane instance and displays the bytesLoaded, bytesTotal and percentLoaded properties by listening for the progress and complete events: import fl.containers.ScrollPane; var url:String = &quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;; var myScrollPane:ScrollPane = new ScrollPane(); myScrollPane.setSize(320, 240); myScrollPane.move(10, 10); myScrollPane.addEventListener(ProgressEvent.PROGRESS, progressHandler); myScrollPane.addEventListener(Event.COMPLETE, completeHandler); myScrollPane.load(new URLRequest(url)); addChild(myScrollPane); function progressHandler(event:ProgressEvent):void { var bLoaded:int = event.bytesLoaded; var bTotal:int = event.bytesTotal; var pctLoaded:int = int(event.currentTarget.percentLoaded); trace(&quot;progress: &quot; + bLoaded + &quot; of &quot; + bTotal + &quot; bytes loaded (&quot; + pctLoaded + &quot;%)&quot;); } function completeHandler(event:Event):void { trace(&quot;complete:&quot;); }"/>
<page href="fl/containers/ScrollPane.html#scrollDrag" title="ScrollPane.scrollDrag" text="scrollDrag Gets or sets a value that indicates whether scrolling occurs when a user drags on content within the scroll pane. A value of true indicates that scrolling occurs when a user drags on the content; a value of false indicates that it does not. The following example creates a ScrollPane instance and traces the component's horizontal and vertical scroll position when the content is scrolled: import fl.containers.ScrollPane; import fl.events.ScrollEvent; var myScrollPane:ScrollPane = new ScrollPane(); myScrollPane.scrollDrag = true; myScrollPane.source = &quot;http://www.helpexamples.com/flash/images/image2.jpg&quot;; myScrollPane.addEventListener(ScrollEvent.SCROLL, scrollHandler); myScrollPane.move(10, 10); addChild(myScrollPane); function scrollHandler(event:ScrollEvent):void { var mySP:ScrollPane = event.currentTarget as ScrollPane; trace(&quot;scrolling&quot;); trace(&quot;\t&quot; + &quot;direction:&quot;, event.direction); trace(&quot;\t&quot; + &quot;position:&quot;, event.position); trace(&quot;\t&quot; + &quot;horizontalScrollPosition:&quot;, mySP.horizontalScrollPosition, &quot;of&quot;, mySP.maxHorizontalScrollPosition); trace(&quot;\t&quot; + &quot;verticalScrollPosition:&quot;, mySP.verticalScrollPosition, &quot;of&quot;, mySP.maxVerticalScrollPosition); }"/>
<page href="fl/containers/ScrollPane.html#source" title="ScrollPane.source" text="source Gets or sets an absolute or relative URL that identifies the location of the SWF or image file to load, the class name of a movie clip in the library, a reference to a display object, or a instance name of a movie clip on the same level as the component. Valid image file formats include GIF, PNG, and JPEG. To load an asset by using a URLRequest object, use the load() method. The following example loads an external image into a ScrollPane component using the source property: import fl.containers.ScrollPane; var myScrollPane:ScrollPane = new ScrollPane(); myScrollPane.source = &quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;; myScrollPane.setSize(320, 240); myScrollPane.move(10, 10); addChild(myScrollPane);"/>
<page href="fl/containers/ScrollPane.html#event:complete" title="ScrollPane.complete" text="complete Dispatched when content has finished loading. The following example creates a ScrollPane component instance, loads an external image, and listens for the progress and complete events: import fl.containers.ScrollPane; import fl.controls.Label; var url:String = &quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;; var conversion:Number = 1024; var myLabel:Label = new Label(); myLabel.autoSize = TextFieldAutoSize.LEFT; myLabel.text = &quot;&quot;; myLabel.move(10, 10); addChild(myLabel); var myScrollPane:ScrollPane = new ScrollPane(); myScrollPane.addEventListener(ProgressEvent.PROGRESS, progressHandler); myScrollPane.addEventListener(Event.COMPLETE, completeHandler); myScrollPane.load(new URLRequest(url)); function progressHandler(event:ProgressEvent):void { var bLoaded:int = int(event.bytesLoaded / conversion); var bTotal:int = int(event.bytesTotal / conversion); var pctLoaded:int = event.target.percentLoaded as int; myLabel.text = bLoaded + &quot; of &quot; + bTotal + &quot; (&quot; + pctLoaded + &quot;%)&quot;; } function completeHandler(event:Event):void { var img:DisplayObject = myScrollPane.content; myScrollPane.removeEventListener(ProgressEvent.PROGRESS, progressHandler); myScrollPane.removeEventListener(Event.COMPLETE, completeHandler); removeChild(myLabel); myScrollPane.setSize(img.width, img.height); var newX:uint = (stage.stageWidth - myScrollPane.width) / 2; var newY:uint = (stage.stageHeight - myScrollPane.height) / 2; myScrollPane.move(newX, newY); addChild(myScrollPane); }"/>
<page href="fl/containers/ScrollPane.html#event:progress" title="ScrollPane.progress" text="progress Dispatched while content is loading. The following example loads an external image into a ScrollPane instance and displays the bytesLoaded, bytesTotal and percentLoaded properties by listening for the progress and complete events: import fl.containers.ScrollPane; var url:String = &quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;; var myScrollPane:ScrollPane = new ScrollPane(); myScrollPane.setSize(320, 240); myScrollPane.move(10, 10); myScrollPane.addEventListener(ProgressEvent.PROGRESS, progressHandler); myScrollPane.addEventListener(Event.COMPLETE, completeHandler); myScrollPane.load(new URLRequest(url)); addChild(myScrollPane); function progressHandler(event:ProgressEvent):void { var bLoaded:int = event.bytesLoaded; var bTotal:int = event.bytesTotal; var pctLoaded:int = int(event.currentTarget.percentLoaded); trace(&quot;progress: &quot; + bLoaded + &quot; of &quot; + bTotal + &quot; bytes loaded (&quot; + pctLoaded + &quot;%)&quot;); } function completeHandler(event:Event):void { trace(&quot;complete:&quot;); }"/>
<page href="fl/containers/ScrollPane.html#event:scroll" title="ScrollPane.scroll" text="scroll Dispatched when the user scrolls content by using the scroll bars on the component or the wheel on a mouse device. The following example listens for the scroll event and uses the direction property of the ScrollEvent class to determine if the content was scrolled horizontally or vertically: import fl.containers.ScrollPane; import fl.events.ScrollEvent; import fl.controls.ScrollBarDirection; var myScrollPane:ScrollPane = new ScrollPane(); myScrollPane.scrollDrag = true; myScrollPane.source = &quot;http://www.helpexamples.com/flash/images/image1.jpg&quot;; myScrollPane.addEventListener(ScrollEvent.SCROLL, scrollHandler); addChild(myScrollPane); function scrollHandler(event:ScrollEvent):void { switch (event.direction) { case ScrollBarDirection.HORIZONTAL: trace(&quot;horizontal scroll&quot;, event.position, &quot;of&quot;, event.currentTarget.maxHorizontalScrollPosition); break; case ScrollBarDirection.VERTICAL: trace(&quot;vertical scroll&quot;, event.position, &quot;of&quot;, event.currentTarget.maxVerticalScrollPosition); break; } }"/>
<page href="fl/containers/ScrollPane.html#style:contentPadding" title="ScrollPane.contentPadding" text="contentPadding The amount of padding to put around the content in the scroll pane, in pixels."/>
<page href="fl/containers/ScrollPane.html#style:disabledSkin" title="ScrollPane.disabledSkin" text="disabledSkin The skin that shows when the scroll pane is disabled."/>
<page href="fl/containers/ScrollPane.html#style:upSkin" title="ScrollPane.upSkin" text="upSkin The default skin shown on the scroll pane."/>
<page href="flash/filters/GradientGlowFilter.html" title="GradientGlowFilter class" text="GradientGlowFilter The GradientGlowFilter class lets you apply a gradient glow effect to display objects. A gradient glow is a realistic-looking glow with a color gradient that you can control. You can apply a gradient glow around the inner or outer edge of an object or on top of an object. You can apply the filter to any display object (objects that inherit from the DisplayObject class), such as MovieClip, SimpleButton, TextField, and Video objects, as well as to BitmapData objects. The use of filters depends on the object to which you apply the filter: To apply filters to display objects, use the filters property. Setting the filters property of an object does not modify the object, and you can remove the filter by clearing the filters property. To apply filters to BitmapData objects, use the BitmapData.applyFilter() method. Calling applyFilter() on a BitmapData object takes the source BitmapData object and the filter object and generates a filtered image as a result. If you apply a filter to a display object, the cacheAsBitmap property of the display object is set to true. If you clear all filters, the original value of cacheAsBitmap is restored. This filter supports Stage scaling. However, it does not support general scaling, rotation, and skewing; if the object itself is scaled (if scaleX and scaleY are set to a value other than 1.0), the filter effect is not scaled. It is scaled only when the user zooms in on the Stage. A filter is not applied if the resulting image exceeds 2880 pixels in width or height. For example, if you zoom in on a large movie clip with a filter applied, the filter is turned off if the resulting image exceeds the limit of 2880 pixels."/>
<page href="flash/filters/GradientGlowFilter.html#GradientGlowFilter()" title="GradientGlowFilter.GradientGlowFilter()" text="GradientGlowFilter Initializes the filter with the specified parameters. distance angle colors alphas ratios blurX blurY strength quality type knockout The offset distance of the glow. The angle, in degrees. Valid values are 0 to 360. An array of colors that defines a gradient. For example, red is 0xFF0000, blue is 0x0000FF, and so on. An array of alpha transparency values for the corresponding colors in the colors array. Valid values for each element in the array are 0 to 1. For example, a value of .25 sets the alpha transparency value to 25%. An array of color distribution ratios. Valid values are 0 to 255. This value defines the percentage of the width where the color is sampled at 100 percent. The amount of horizontal blur. Valid values are 0 to 255. A blur of 1 or less means that the original image is copied as is. Values that are a power of 2 (such as 2, 4, 8, 16 and 32) are optimized to render more quickly than other values. The amount of vertical blur. Valid values are 0 to 255. A blur of 1 or less means that the original image is copied as is. Values that are a power of 2 (such as 2, 4, 8, 16 and 32) are optimized to render more quickly than other values. The strength of the imprint or spread. The higher the value, the more color is imprinted and the stronger the contrast between the glow and the background. Valid values are 0 to 255. The larger the value, the stronger the imprint. A value of 0 means the filter is not applied. The number of times to apply the filter. Use the BitmapFilterQuality constants: BitmapFilterQuality.LOW BitmapFilterQuality.MEDIUM BitmapFilterQuality.HIGH For more information, see the description of the quality property. The placement of the filter effect. Possible values are the flash.filters.BitmapFilterType constants: BitmapFilterType.OUTER — Glow on the outer edge of the object BitmapFilterType.INNER — Glow on the inner edge of the object; the default. BitmapFilterType.FULL — Glow on top of the object Specifies whether the object has a knockout effect. A knockout effect makes the object's fill transparent and reveals the background color of the document. The value true specifies a knockout effect; the default is false (no knockout effect)."/>
<page href="flash/filters/GradientGlowFilter.html#clone()" title="GradientGlowFilter.clone()" text="clone Returns a copy of this filter object."/>
<page href="flash/filters/GradientGlowFilter.html#alphas" title="GradientGlowFilter.alphas" text="alphas An array of alpha transparency values for the corresponding colors in the colors array. Valid values for each element in the array are 0 to 1. For example, .25 sets the alpha transparency value to 25%. The alphas property cannot be changed by directly modifying its values. Instead, you must get a reference to alphas, make the change to the reference, and then set alphas to the reference. The colors, alphas, and ratios properties are related. The first element in the colors array corresponds to the first element in the alphas array and in the ratios array, and so on. The Array is null when being set"/>
<page href="flash/filters/GradientGlowFilter.html#angle" title="GradientGlowFilter.angle" text="angle The angle, in degrees. Valid values are 0 to 360. The default is 45. The angle value represents the angle of the theoretical light source falling on the object and determines the placement of the effect relative to the object. If distance is set to 0, the effect is not offset from the object, and therefore the angle property has no effect."/>
<page href="flash/filters/GradientGlowFilter.html#blurX" title="GradientGlowFilter.blurX" text="blurX The amount of horizontal blur. Valid values are 0 to 255. A blur of 1 or less means that the original image is copied as is. The default value is 4. Values that are a power of 2 (such as 2, 4, 8, 16, and 32) are optimized to render more quickly than other values."/>
<page href="flash/filters/GradientGlowFilter.html#blurY" title="GradientGlowFilter.blurY" text="blurY The amount of vertical blur. Valid values are 0 to 255. A blur of 1 or less means that the original image is copied as is. The default value is 4. Values that are a power of 2 (such as 2, 4, 8, 16, and 32) are optimized to render more quickly than other values."/>
<page href="flash/filters/GradientGlowFilter.html#colors" title="GradientGlowFilter.colors" text="colors An array of colors that defines a gradient. For example, red is 0xFF0000, blue is 0x0000FF, and so on. The colors property cannot be changed by directly modifying its values. Instead, you must get a reference to colors, make the change to the reference, and then set colors to the reference. The colors, alphas, and ratios properties are related. The first element in the colors array corresponds to the first element in the alphas array and in the ratios array, and so on. The Array is null when being set"/>
<page href="flash/filters/GradientGlowFilter.html#distance" title="GradientGlowFilter.distance" text="distance The offset distance of the glow. The default value is 4."/>
<page href="flash/filters/GradientGlowFilter.html#knockout" title="GradientGlowFilter.knockout" text="knockout Specifies whether the object has a knockout effect. A knockout effect makes the object's fill transparent and reveals the background color of the document. The value true specifies a knockout effect; the default value is false (no knockout effect)."/>
<page href="flash/filters/GradientGlowFilter.html#quality" title="GradientGlowFilter.quality" text="quality The number of times to apply the filter. The default value is BitmapFilterQuality.LOW, which is equivalent to applying the filter once. The value BitmapFilterQuality.MEDIUM applies the filter twice; the value BitmapFilterQuality.HIGH applies it three times. Filters with lower values are rendered more quickly. For most applications, a quality value of low, medium, or high is sufficient. Although you can use additional numeric values up to 15 to achieve different effects, higher values are rendered more slowly. Instead of increasing the value of quality, you can often get a similar effect, and with faster rendering, by simply increasing the values of the blurX and blurY properties."/>
<page href="flash/filters/GradientGlowFilter.html#ratios" title="GradientGlowFilter.ratios" text="ratios An array of color distribution ratios for the corresponding colors in the colors array. Valid values are 0 to 255. The ratios property cannot be changed by directly modifying its values. Instead, you must get a reference to ratios, make the change to the reference, and then set ratios to the reference. The colors, alphas, and ratios properties are related. The first element in the colors array corresponds to the first element in the alphas array and in the ratios array, and so on. Think of the gradient glow filter as a glow that emanates from the center of the object (if the distance value is set to 0), with gradients that are stripes of color blending into each other. The first color in the colors array is the outermost color of the glow. The last color is the innermost color of the glow. Each value in the ratios array sets the position of the color on the radius of the gradient, where 0 represents the outermost point of the gradient and 255 represents the innermost point of the gradient. The ratio values can range from 0 to 255 pixels, in increasing value; for example [0, 64, 128, 200, 255]. Values from 0 to 128 appear on the outer edges of the glow. Values from 129 to 255 appear in the inner area of the glow. Depending on the ratio values of the colors and the type value of the filter, the filter colors might be obscured by the object to which the filter is applied. In the following code and image, a filter is applied to a black circle movie clip, with the type set to &quot;full&quot;. For instructional purposes, the first color in the colors array, pink, has an alpha value of 1, so it shows against the white document background. (In practice, you probably would not want the first color showing in this way.) The last color in the array, yellow, obscures the black circle to which the filter is applied: var colors:Array = [0xFFCCFF, 0x0000FF, 0x9900FF, 0xFF0000, 0xFFFF00]; var alphas:Array = [1, 1, 1, 1, 1]; var ratios:Array = [0, 32, 64, 128, 225]; var myGGF:GradientGlowFilter = new GradientGlowFilter(0, 0, colors, alphas, ratios, 50, 50, 1, 2, &quot;full&quot;, false); To achieve a seamless effect with your document background when you set the type value to &quot;outer&quot; or &quot;full&quot;, set the first color in the array to the same color as the document background, or set the alpha value of the first color to 0; either technique makes the filter blend in with the background. If you make two small changes in the code, the effect of the glow can be very different, even with the same ratios and colors arrays. Set the alpha value of the first color in the array to 0, to make the filter blend in with the document's white background; and set the type property to &quot;outer&quot; or &quot;inner&quot;. Observe the results, as shown in the following images. Keep in mind that the spread of the colors in the gradient varies based on the values of the blurX, blurY, strength, and quality properties, as well as the ratios values. The Array is null when being set"/>
<page href="flash/filters/GradientGlowFilter.html#strength" title="GradientGlowFilter.strength" text="strength The strength of the imprint or spread. The higher the value, the more color is imprinted and the stronger the contrast between the glow and the background. Valid values are 0 to 255. A value of 0 means that the filter is not applied. The default value is 1."/>
<page href="flash/filters/GradientGlowFilter.html#type" title="GradientGlowFilter.type" text="type The placement of the filter effect. Possible values are flash.filters.BitmapFilterType constants: BitmapFilterType.OUTER — Glow on the outer edge of the object BitmapFilterType.INNER — Glow on the inner edge of the object; the default. BitmapFilterType.FULL — Glow on top of the object The string is null when being set"/>
<page href="flash/filters/BitmapFilterQuality.html" title="BitmapFilterQuality class" text="BitmapFilterQuality The BitmapFilterQuality class contains values to set the rendering quality of a BitmapFilter object."/>
<page href="flash/filters/BitmapFilterQuality.html#HIGH" title="BitmapFilterQuality.HIGH" text="HIGH Defines the high quality filter setting."/>
<page href="flash/filters/BitmapFilterQuality.html#LOW" title="BitmapFilterQuality.LOW" text="LOW Defines the low quality filter setting."/>
<page href="flash/filters/BitmapFilterQuality.html#MEDIUM" title="BitmapFilterQuality.MEDIUM" text="MEDIUM Defines the medium quality filter setting."/>
<page href="flash/filters/BitmapFilterType.html" title="BitmapFilterType class" text="BitmapFilterType The BitmapFilterType class contains values to set the type of a BitmapFilter."/>
<page href="flash/filters/BitmapFilterType.html#FULL" title="BitmapFilterType.FULL" text="FULL Defines the setting that applies a filter to the entire area of an object."/>
<page href="flash/filters/BitmapFilterType.html#INNER" title="BitmapFilterType.INNER" text="INNER Defines the setting that applies a filter to the inner area of an object."/>
<page href="flash/filters/BitmapFilterType.html#OUTER" title="BitmapFilterType.OUTER" text="OUTER Defines the setting that applies a filter to the outer area of an object."/>
<page href="flash/filters/BlurFilter.html" title="BlurFilter class" text="BlurFilter The BlurFilter class lets you apply a blur visual effect to display objects. A blur effect softens the details of an image. You can produce blurs that range from a softly unfocused look to a Gaussian blur, a hazy appearance like viewing an image through semi-opaque glass. When the quality property of this filter is set to low, the result is a softly unfocused look. When the quality property is set to high, it approximates a Gaussian blur filter. You can apply the filter to any display object (that is, objects that inherit from the DisplayObject class), such as MovieClip, SimpleButton, TextField, and Video objects, as well as to BitmapData objects. To create a new filter, use the constructor new BlurFilter(). The use of filters depends on the object to which you apply the filter: To apply filters to movie clips, text fields, buttons, and video, use the filters property (inherited from DisplayObject). Setting the filters property of an object does not modify the object, and you can remove the filter by clearing the filters property. To apply filters to BitmapData objects, use the BitmapData.applyFilter() method. Calling applyFilter() on a BitmapData object takes the source BitmapData object and the filter object and generates a filtered image as a result. If you apply a filter to a display object, the cacheAsBitmap property of the display object is set to true. If you remove all filters, the original value of cacheAsBitmap is restored. This filter supports Stage scaling. However, it does not support general scaling, rotation, and skewing. If the object itself is scaled (scaleX and scaleY are not set to 100%), the filter effect is not scaled. It is scaled only when the user zooms in on the Stage. A filter is not applied if the resulting image exceeds 2880 pixels in width or height. If, for example, you zoom in on a large movie clip with a filter applied, the filter is turned off if the resulting image exceeds the limit of 2880 pixels."/>
<page href="flash/filters/BlurFilter.html#BlurFilter()" title="BlurFilter.BlurFilter()" text="BlurFilter Initializes the filter with the specified parameters. The default values create a soft, unfocused image. blurX blurY quality The amount to blur horizontally. Valid values are from 0 to 255.0 (floating-point value). The amount to blur vertically. Valid values are from 0 to 255.0 (floating-point value). The number of times to apply the filter. You can specify the quality using the BitmapFilterQuality constants: flash.filters.BitmapFilterQuality.LOW flash.filters.BitmapFilterQuality.MEDIUM flash.filters.BitmapFilterQuality.HIGH High quality approximates a Gaussian blur. For most applications, these three values are sufficient. Although you can use additional numeric values up to 15 to achieve different effects, be aware that higher values are rendered more slowly."/>
<page href="flash/filters/BlurFilter.html#clone()" title="BlurFilter.clone()" text="clone Returns a copy of this filter object."/>
<page href="flash/filters/BlurFilter.html#blurX" title="BlurFilter.blurX" text="blurX The amount of horizontal blur. Valid values are from 0 to 255 (floating point). The default value is 4. Values that are a power of 2 (such as 2, 4, 8, 16 and 32) are optimized to render more quickly than other values."/>
<page href="flash/filters/BlurFilter.html#blurY" title="BlurFilter.blurY" text="blurY The amount of vertical blur. Valid values are from 0 to 255 (floating point). The default value is 4. Values that are a power of 2 (such as 2, 4, 8, 16 and 32) are optimized to render more quickly than other values."/>
<page href="flash/filters/BlurFilter.html#quality" title="BlurFilter.quality" text="quality The number of times to perform the blur. The default value is BitmapFilterQuality.LOW, which is equivalent to applying the filter once. The value BitmapFilterQuality.MEDIUM applies the filter twice; the value BitmapFilterQuality.HIGH applies it three times and approximates a Gaussian blur. Filters with lower values are rendered more quickly. For most applications, a quality value of low, medium, or high is sufficient. Although you can use additional numeric values up to 15 to increase the number of times the blur is applied, higher values are rendered more slowly. Instead of increasing the value of quality, you can often get a similar effect, and with faster rendering, by simply increasing the values of the blurX and blurY properties. You can use the following BitmapFilterQuality constants to specify values of the quality property: BitmapFilterQuality.LOW BitmapFilterQuality.MEDIUM BitmapFilterQuality.HIGH"/>
<page href="flash/filters/BitmapFilter.html" title="BitmapFilter class" text="BitmapFilter The BitmapFilter class is the base class for all image filter effects. The BevelFilter, BlurFilter, ColorMatrixFilter, ConvolutionFilter, DisplacementMapFilter, DropShadowFilter, GlowFilter, GradientBevelFilter, and GradientGlowFilter classes all extend the BitmapFilter class. You can apply these filter effects to any display object. You can neither directly instantiate nor extend BitmapFilter."/>
<page href="flash/filters/BitmapFilter.html#clone()" title="BitmapFilter.clone()" text="clone Returns a BitmapFilter object that is an exact copy of the original BitmapFilter object."/>
<page href="flash/filters/GradientBevelFilter.html" title="GradientBevelFilter class" text="GradientBevelFilter The GradientBevelFilter class lets you apply a gradient bevel effect to display objects. A gradient bevel is a beveled edge, enhanced with gradient color, on the outside, inside, or top of an object. Beveled edges make objects look three-dimensional. You can apply the filter to any display object (that is, objects that inherit from the DisplayObject class), such as MovieClip, SimpleButton, TextField, and Video objects, as well as to BitmapData objects. The use of filters depends on the object to which you apply the filter: To apply filters to display objects, use the filters property. Setting the filters property of an object does not modify the object, and you can remove the filter by clearing the filters property. To apply filters to BitmapData objects, use the BitmapData.applyFilter() method. Calling applyFilter() on a BitmapData object takes the source BitmapData object and the filter object and generates a filtered image as a result. If you apply a filter to a display object, the cacheAsBitmap property of the display object is set to true. If you clear all filters, the original value of cacheAsBitmap is restored. This filter supports Stage scaling. However, it does not support general scaling, rotation, and skewing; if the object itself is scaled (if scaleX and scaleY are set to a value other than 1.0), the filter effect is not scaled. It is scaled only when the user zooms in on the Stage. A filter is not applied if the resulting image exceeds 2880 pixels in width or height. For example, if you zoom in on a large movie clip with a filter applied, the filter is turned off if the resulting image exceeds the limit of 2880 pixels."/>
<page href="flash/filters/GradientBevelFilter.html#GradientBevelFilter()" title="GradientBevelFilter.GradientBevelFilter()" text="GradientBevelFilter Initializes the filter with the specified parameters. distance angle colors alphas ratios blurX blurY strength quality type knockout The offset distance. Valid values are 0 to 8. The angle, in degrees. Valid values are 0 to 360. An array of RGB hexadecimal color values to use in the gradient. For example, red is 0xFF0000, blue is 0x0000FF, and so on. An array of alpha transparency values for the corresponding colors in the colors array. Valid values for each element in the array are 0 to 1. For example, .25 sets a transparency value of 25%. An array of color distribution ratios; valid values are 0 to 255. The amount of horizontal blur. Valid values are 0 to 255. A blur of 1 or less means that the original image is copied as is. The default value is 4. Values that are a power of 2 (such as 2, 4, 8, 16 and 32) are optimized to render more quickly than other values. The amount of vertical blur. Valid values are 0 to 255. A blur of 1 or less means that the original image is copied as is. Values that are a power of 2 (such as 2, 4, 8, 16 and 32) are optimized to render more quickly than other values. The strength of the imprint or spread. The higher the value, the more color is imprinted and the stronger the contrast between the bevel and the background. Valid values are 0 to 255. A value of 0 means that the filter is not applied. The quality of the filter. Use BitmapFilterQuality constants: BitmapFilterQuality.LOW BitmapFilterQuality.MEDIUM BitmapFilterQuality.HIGH For more information, see the description of the quality property. The placement of the bevel effect. Possible values are BitmapFilterType constants: BitmapFilterType.OUTER — Bevel on the outer edge of the object BitmapFilterType.INNER — Bevel on the inner edge of the object BitmapFilterType.FULL — Bevel on top of the object Specifies whether a knockout effect is applied. The value true makes the object's fill transparent and reveals the background color of the document."/>
<page href="flash/filters/GradientBevelFilter.html#clone()" title="GradientBevelFilter.clone()" text="clone Returns a copy of this filter object."/>
<page href="flash/filters/GradientBevelFilter.html#alphas" title="GradientBevelFilter.alphas" text="alphas An array of alpha transparency values for the corresponding colors in the colors array. Valid values for each element in the array are 0 to 1. For example, .25 sets a transparency value of 25%. The alphas property cannot be changed by directly modifying its values. Instead, you must get a reference to alphas, make the change to the reference, and then set alphas to the reference. The colors, alphas, and ratios properties are related. The first element in the colors array corresponds to the first element in the alphas array and in the ratios array, and so on. The Array is null when being set"/>
<page href="flash/filters/GradientBevelFilter.html#angle" title="GradientBevelFilter.angle" text="angle The angle, in degrees. Valid values are 0 to 360. The default is 45. The angle value represents the angle of the theoretical light source falling on the object. The value determines the angle at which the gradient colors are applied to the object: where the highlight and the shadow appear, or where the first color in the array appears. The colors are then applied in the order in which they appear in the array."/>
<page href="flash/filters/GradientBevelFilter.html#blurX" title="GradientBevelFilter.blurX" text="blurX The amount of horizontal blur. Valid values are 0 to 255. A blur of 1 or less means that the original image is copied as is. The default value is 4. Values that are a power of 2 (such as 2, 4, 8, 16 and 32) are optimized to render more quickly than other values."/>
<page href="flash/filters/GradientBevelFilter.html#blurY" title="GradientBevelFilter.blurY" text="blurY The amount of vertical blur. Valid values are 0 to 255. A blur of 1 or less means that the original image is copied as is. The default value is 4. Values that are a power of 2 (such as 2, 4, 8, 16 and 32) are optimized to render more quickly than other values."/>
<page href="flash/filters/GradientBevelFilter.html#colors" title="GradientBevelFilter.colors" text="colors An array of RGB hexadecimal color values to use in the gradient. For example, red is 0xFF0000, blue is 0x0000FF, and so on. The colors property cannot be changed by directly modifying its values. Instead, you must get a reference to colors, make the change to the reference, and then set colors to the reference. The colors, alphas, and ratios properties are related. The first element in the colors array corresponds to the first element in the alphas array and in the ratios array, and so on. The Array is null when being set"/>
<page href="flash/filters/GradientBevelFilter.html#distance" title="GradientBevelFilter.distance" text="distance The offset distance. Valid values are 0 to 8. The default value is 4.0."/>
<page href="flash/filters/GradientBevelFilter.html#knockout" title="GradientBevelFilter.knockout" text="knockout Specifies whether the object has a knockout effect. A knockout effect makes the object's fill transparent and reveals the background color of the document. The value true specifies a knockout effect; the default is false (no knockout effect)."/>
<page href="flash/filters/GradientBevelFilter.html#quality" title="GradientBevelFilter.quality" text="quality The number of times to apply the filter. The default value is BitmapFilterQuality.LOW, which is equivalent to applying the filter once. The value BitmapFilterQuality.MEDIUM applies the filter twice; the value BitmapFilterQuality.HIGH applies it three times. Filters with lower values are rendered more quickly. For most applications, a quality value of low, medium, or high is sufficient. Although you can use additional numeric values up to 15 to achieve different effects, higher values are rendered more slowly. Instead of increasing the value of quality, you can often get a similar effect, and with faster rendering, by simply increasing the values of the blurX and blurY properties."/>
<page href="flash/filters/GradientBevelFilter.html#ratios" title="GradientBevelFilter.ratios" text="ratios An array of color distribution ratios for the corresponding colors in the colors array. Valid values for each element in the array are 0 to 255. The ratios property cannot be changed by directly modifying its values. Instead, you must get a reference to ratios, make the change to the reference, and then set ratios to the reference. The colors, alphas, and ratios properties are related. The first element in the colors array corresponds to the first element in the alphas array and in the ratios array, and so on. To understand how the colors in a gradient bevel are distributed, think first of the colors that you want in your gradient bevel. Consider that a simple bevel has a highlight color and shadow color; a gradient bevel has a highlight gradient and a shadow gradient. Assume that the highlight appears on the top-left corner, and the shadow appears on the bottom-right corner. Assume that one possible usage of the filter has four colors in the highlight and four in the shadow. In addition to the highlight and shadow, the filter uses a base fill color that appears where the edges of the highlight and shadow meet. Therefore the total number of colors is nine, and the corresponding number of elements in the ratios array is nine. If you think of a gradient as composed of stripes of various colors, blending into each other, each ratio value sets the position of the color on the radius of the gradient, where 0 represents the outermost point of the gradient and 255 represents the innermost point of the gradient. For a typical usage, the middle value is 128, and that is the base fill value. To get the bevel effect shown in the image below, assign the ratio values as follows, using the example of nine colors: The first four colors range from 0-127, increasing in value so that each value is greater than or equal to the previous one. This is the highlight bevel edge. The fifth color (the middle color) is the base fill, set to 128. The pixel value of 128 sets the base fill, which appears either outside the shape (and around the bevel edges) if the type is set to outer; or inside the shape, effectively covering the object's own fill, if the type is set to inner. The last four colors range from 129-255, increasing in value so that each value is greater than or equal to the previous one. This is the shadow bevel edge. If you want an equal distribution of colors for each edge, use an odd number of colors, where the middle color is the base fill. Distribute the values between 0-127 and 129-255 equally among your colors, then adjust the value to change the width of each stripe of color in the gradient. For a gradient bevel with nine colors, a possible array is [16, 32, 64, 96, 128, 160, 192, 224, 235]. The following image depicts the gradient bevel as described: Keep in mind that the spread of the colors in the gradient varies based on the values of the blurX, blurY, strength, and quality properties, as well as the ratios values. The Array is null when being set"/>
<page href="flash/filters/GradientBevelFilter.html#strength" title="GradientBevelFilter.strength" text="strength The strength of the imprint or spread. The higher the value, the more color is imprinted and the stronger the contrast between the bevel and the background. Valid values are 0 to 255. A value of 0 means that the filter is not applied. The default value is 1."/>
<page href="flash/filters/GradientBevelFilter.html#type" title="GradientBevelFilter.type" text="type The placement of the bevel effect. Possible values are BitmapFilterType constants: BitmapFilterType.OUTER — Bevel on the outer edge of the object BitmapFilterType.INNER — Bevel on the inner edge of the object BitmapFilterType.FULL — Bevel on top of the object"/>
<page href="flash/filters/GlowFilter.html" title="GlowFilter class" text="GlowFilter The GlowFilter class lets you apply a glow effect to display objects. You have several options for the style of the glow, including inner or outer glow and knockout mode. The glow filter is similar to the drop shadow filter with the distance and angle properties of the drop shadow filter set to 0. You can apply the filter to any display object (that is, objects that inherit from the DisplayObject class), such as MovieClip, SimpleButton, TextField, and Video objects, as well as to BitmapData objects. The use of filters depends on the object to which you apply the filter: To apply filters to display objects, use the filters property (inherited from DisplayObject). Setting the filters property of an object does not modify the object, and you can remove the filter by clearing the filters property. To apply filters to BitmapData objects, use the BitmapData.applyFilter() method. Calling applyFilter() on a BitmapData object takes the source BitmapData object and the filter object and generates a filtered image as a result. If you apply a filter to a display object, the cacheAsBitmap property of the display object is set to true. If you clear all filters, the original value of cacheAsBitmap is restored. This filter supports Stage scaling. However, it does not support general scaling, rotation, and skewing. If the object itself is scaled (if scaleX and scaleY are set to a value other than 1.0), the filter is not scaled. It is scaled only when the user zooms in on the Stage. A filter is not applied if the resulting image exceeds 2880 pixels in width or height. For example, if you zoom in on a large movie clip with a filter applied, the filter is turned off if the resulting image exceeds the limit of 2880 pixels."/>
<page href="flash/filters/GlowFilter.html#GlowFilter()" title="GlowFilter.GlowFilter()" text="GlowFilter Initializes a new GlowFilter instance with the specified parameters. color alpha blurX blurY strength quality inner knockout The color of the glow, in the hexadecimal format 0xRRGGBB. The default value is 0xFF0000. The alpha transparency value for the color. Valid values are 0 to 1. For example, .25 sets a transparency value of 25%. The amount of horizontal blur. Valid values are 0 to 255 (floating point). Values that are a power of 2 (such as 2, 4, 8, 16 and 32) are optimized to render more quickly than other values. The amount of vertical blur. Valid values are 0 to 255 (floating point). Values that are a power of 2 (such as 2, 4, 8, 16 and 32) are optimized to render more quickly than other values. The strength of the imprint or spread. The higher the value, the more color is imprinted and the stronger the contrast between the glow and the background. Valid values are 0 to 255. The number of times to apply the filter. Use the BitmapFilterQuality constants: BitmapFilterQuality.LOW BitmapFilterQuality.MEDIUM BitmapFilterQuality.HIGH For more information, see the description of the quality property. Specifies whether the glow is an inner glow. The value true specifies an inner glow. The value false specifies an outer glow (a glow around the outer edges of the object). Specifies whether the object has a knockout effect. The value true makes the object's fill transparent and reveals the background color of the document."/>
<page href="flash/filters/GlowFilter.html#clone()" title="GlowFilter.clone()" text="clone Returns a copy of this filter object."/>
<page href="flash/filters/GlowFilter.html#alpha" title="GlowFilter.alpha" text="alpha The alpha transparency value for the color. Valid values are 0 to 1. For example, .25 sets a transparency value of 25%. The default value is 1."/>
<page href="flash/filters/GlowFilter.html#blurX" title="GlowFilter.blurX" text="blurX The amount of horizontal blur. Valid values are 0 to 255 (floating point). The default value is 6. Values that are a power of 2 (such as 2, 4, 8, 16, and 32) are optimized to render more quickly than other values."/>
<page href="flash/filters/GlowFilter.html#blurY" title="GlowFilter.blurY" text="blurY The amount of vertical blur. Valid values are 0 to 255 (floating point). The default value is 6. Values that are a power of 2 (such as 2, 4, 8, 16, and 32) are optimized to render more quickly than other values."/>
<page href="flash/filters/GlowFilter.html#color" title="GlowFilter.color" text="color The color of the glow. Valid values are in the hexadecimal format 0xRRGGBB. The default value is 0xFF0000."/>
<page href="flash/filters/GlowFilter.html#inner" title="GlowFilter.inner" text="inner Specifies whether the glow is an inner glow. The value true indicates an inner glow. The default is false, an outer glow (a glow around the outer edges of the object)."/>
<page href="flash/filters/GlowFilter.html#knockout" title="GlowFilter.knockout" text="knockout Specifies whether the object has a knockout effect. A value of true makes the object's fill transparent and reveals the background color of the document. The default value is false (no knockout effect)."/>
<page href="flash/filters/GlowFilter.html#quality" title="GlowFilter.quality" text="quality The number of times to apply the filter. The default value is BitmapFilterQuality.LOW, which is equivalent to applying the filter once. The value BitmapFilterQuality.MEDIUM applies the filter twice; the value BitmapFilterQuality.HIGH applies it three times. Filters with lower values are rendered more quickly. For most applications, a quality value of low, medium, or high is sufficient. Although you can use additional numeric values up to 15 to achieve different effects, higher values are rendered more slowly. Instead of increasing the value of quality, you can often get a similar effect, and with faster rendering, by simply increasing the values of the blurX and blurY properties."/>
<page href="flash/filters/GlowFilter.html#strength" title="GlowFilter.strength" text="strength The strength of the imprint or spread. The higher the value, the more color is imprinted and the stronger the contrast between the glow and the background. Valid values are 0 to 255. The default is 2."/>
<page href="flash/filters/DisplacementMapFilterMode.html" title="DisplacementMapFilterMode class" text="DisplacementMapFilterMode The DisplacementMapFilterMode class provides values for the mode property of the DisplacementMapFilter class."/>
<page href="flash/filters/DisplacementMapFilterMode.html#CLAMP" title="DisplacementMapFilterMode.CLAMP" text="CLAMP Clamps the displacement value to the edge of the source image. Use with the DisplacementMapFilter.mode property."/>
<page href="flash/filters/DisplacementMapFilterMode.html#COLOR" title="DisplacementMapFilterMode.COLOR" text="COLOR If the displacement value is outside the image, substitutes the values in the color and alpha properties. Use with the DisplacementMapFilter.mode property."/>
<page href="flash/filters/DisplacementMapFilterMode.html#IGNORE" title="DisplacementMapFilterMode.IGNORE" text="IGNORE If the displacement value is out of range, ignores the displacement and uses the source pixel. Use with the DisplacementMapFilter.mode property."/>
<page href="flash/filters/DisplacementMapFilterMode.html#WRAP" title="DisplacementMapFilterMode.WRAP" text="WRAP Wraps the displacement value to the other side of the source image. Use with the DisplacementMapFilter.mode property."/>
<page href="flash/filters/ColorMatrixFilter.html" title="ColorMatrixFilter class" text="ColorMatrixFilter The ColorMatrixFilter class lets you apply a 4 x 5 matrix transformation on the RGBA color and alpha values of every pixel in the input image to produce a result with a new set of RGBA color and alpha values. It allows saturation changes, hue rotation, luminance to alpha, and various other effects. You can apply the filter to any display object (that is, objects that inherit from the DisplayObject class), such as MovieClip, SimpleButton, TextField, and Video objects, as well as to BitmapData objects. Note: For RGBA values, the most significant byte represents the red channel value, followed by green, blue, and then alpha. To create a new color matrix filter, use the syntax new ColorMatrixFilter(). The use of filters depends on the object to which you apply the filter: To apply filters to movie clips, text fields, buttons, and video, use the filters property (inherited from DisplayObject). Setting the filters property of an object does not modify the object, and you can remove the filter by clearing the filters property. To apply filters to BitmapData objects, use the BitmapData.applyFilter() method. Calling applyFilter() on a BitmapData object takes the source BitmapData object and the filter object and generates a filtered image as a result. If you apply a filter to a display object, the cacheAsBitmap property of the display object is set to true. If you remove all filters, the original value of cacheAsBitmap is restored. A filter is not applied if the resulting image would exceed 2880 pixels in width or height. For example, if you zoom in on a large movie clip with a filter applied, the filter is turned off if the resulting image reaches the 2880-pixel limit."/>
<page href="flash/filters/ColorMatrixFilter.html#ColorMatrixFilter()" title="ColorMatrixFilter.ColorMatrixFilter()" text="ColorMatrixFilter Initializes a new ColorMatrixFilter instance with the specified parameters. matrix An array of 20 items arranged as a 4 x 5 matrix."/>
<page href="flash/filters/ColorMatrixFilter.html#clone()" title="ColorMatrixFilter.clone()" text="clone Returns a copy of this filter object."/>
<page href="flash/filters/ColorMatrixFilter.html#matrix" title="ColorMatrixFilter.matrix" text="matrix An array of 20 items for 4 x 5 color transform. The matrix property cannot be changed by directly modifying its value (for example, myFilter.matrix[2] = 1;). Instead, you must get a reference to the array, make the change to the reference, and reset the value. The color matrix filter separates each source pixel into its red, green, blue, and alpha components as srcR, srcG, srcB, srcA. To calculate the result of each of the four channels, the value of each pixel in the image is multiplied by the values in the transformation matrix. An offset, between -255 and 255, can optionally be added to each result (the fifth item in each row of the matrix). The filter combines each color component back into a single pixel and writes out the result. In the following formula, a[0] through a[19] correspond to entries 0 through 19 in the 20-item array that is passed to the matrix property: redResult = (a[0] ~~ srcR) + (a[1] ~~ srcG) + (a[2] ~~ srcB) + (a[3] ~~ srcA) + a[4] greenResult = (a[5] ~~ srcR) + (a[6] ~~ srcG) + (a[7] ~~ srcB) + (a[8] ~~ srcA) + a[9] blueResult = (a[10] ~~ srcR) + (a[11] ~~ srcG) + (a[12] ~~ srcB) + (a[13] ~~ srcA) + a[14] alphaResult = (a[15] ~~ srcR) + (a[16] ~~ srcG) + (a[17] ~~ srcB) + (a[18] ~~ srcA) + a[19] For each color value in the array, a value of 1 is equal to 100% of that channel being sent to the output, preserving the value of the color channel. The calculations are performed on unmultiplied color values. If the input graphic consists of premultiplied color values, those values are automatically converted into unmultiplied color values for this operation. Two optimized modes are available: Alpha only. When you pass to the filter a matrix that adjusts only the alpha component, as shown here, the filter optimizes its performance: 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 N 0 (where N is between 0.0 and 1.0) Faster version. Available only with SSE/AltiVec accelerator-enabled processors, such as Intel® Pentium 3 and later and Apple® G4 and later. The accelerator is used when the multiplier terms are in the range -15.99 to 15.99 and the adder terms a[4], a[9], a[14], and a[19] are in the range -8000 to 8000. The Array is null when being set"/>
<page href="flash/filters/ConvolutionFilter.html" title="ConvolutionFilter class" text="ConvolutionFilter The ConvolutionFilter class applies a matrix convolution filter effect. A convolution combines pixels in the input image with neighboring pixels to produce an image. A wide variety of image effects can be achieved through convolutions, including blurring, edge detection, sharpening, embossing, and beveling. You can apply the filter to any display object (that is, objects that inherit from the DisplayObject class), such as MovieClip, SimpleButton, TextField, and Video objects, as well as to BitmapData objects. To create a convolution filter, use the syntax new ConvolutionFilter(). The use of filters depends on the object to which you apply the filter: To apply filters to movie clips, text fields, buttons, and video, use the filters property (inherited from DisplayObject). Setting the filters property of an object does not modify the object, and you can remove the filter by clearing the filters property. To apply filters to BitmapData objects, use the BitmapData.applyFilter() method. Calling applyFilter() on a BitmapData object takes the source BitmapData object and the filter object and generates a filtered image as a result. If you apply a filter to a display object, the value of the cacheAsBitmap property of the object is set to true. If you clear all filters, the original value of cacheAsBitmap is restored. A filter is not applied if the resulting image exceeds 2880 pixels in width or height. For example, if you zoom in on a large movie clip with a filter applied, the filter is turned off if the resulting image exceeds the limit of 2880 pixels."/>
<page href="flash/filters/ConvolutionFilter.html#ConvolutionFilter()" title="ConvolutionFilter.ConvolutionFilter()" text="ConvolutionFilter Initializes a ConvolutionFilter instance with the specified parameters. matrixX matrixY matrix divisor bias preserveAlpha clamp color alpha The x dimension of the matrix (the number of columns in the matrix). The default value is 0. The y dimension of the matrix (the number of rows in the matrix). The default value is 0. The array of values used for matrix transformation. The number of items in the array must equal matrixX ~~ matrixY. The divisor used during matrix transformation. The default value is 1. A divisor that is the sum of all the matrix values evens out the overall color intensity of the result. A value of 0 is ignored and the default is used instead. The bias to add to the result of the matrix transformation. The default value is 0. A value of false indicates that the alpha value is not preserved and that the convolution applies to all channels, including the alpha channel. A value of true indicates that the convolution applies only to the color channels. The default value is true. For pixels that are off the source image, a value of true indicates that the input image is extended along each of its borders as necessary by duplicating the color values at the given edge of the input image. A value of false indicates that another color should be used, as specified in the color and alpha properties. The default is true. The hexadecimal color to substitute for pixels that are off the source image. The alpha of the substitute color."/>
<page href="flash/filters/ConvolutionFilter.html#clone()" title="ConvolutionFilter.clone()" text="clone Returns a copy of this filter object."/>
<page href="flash/filters/ConvolutionFilter.html#alpha" title="ConvolutionFilter.alpha" text="alpha The alpha transparency value of the substitute color. Valid values are 0 to 1.0. The default is 0. For example, .25 sets a transparency value of 25%."/>
<page href="flash/filters/ConvolutionFilter.html#bias" title="ConvolutionFilter.bias" text="bias The amount of bias to add to the result of the matrix transformation. The bias increases the color value of each channel, so that dark colors appear brighter. The default value is 0."/>
<page href="flash/filters/ConvolutionFilter.html#clamp" title="ConvolutionFilter.clamp" text="clamp Indicates whether the image should be clamped. For pixels off the source image, a value of true indicates that the input image is extended along each of its borders as necessary by duplicating the color values at each respective edge of the input image. A value of false indicates that another color should be used, as specified in the color and alpha properties. The default is true. The following example creates two boxes using the BitmapData class, one of which is half the size of the other. When the example first loads, the larger box is drawn inside mc using the attachBitmap(). When mc is clicked and the applyFilter() method is called, the largeBox instance of BitmapData is redrawn with smallBox as a source bitmap. Since applyFilter() draws smallBox over a Rectangle whose width and height is specified as those of largeBox, the source bitmap is smaller than the drawing area. The clamp property of ConvolutionFilter in this case is set to false and the area which is not covered by the source bitmap, smallBox, is a solid red as determined by the clampColor and clampAlpha variables. package { import flash.display.Sprite; import flash.display.BitmapData; import flash.filters.ConvolutionFilter; import flash.text.TextField; import flash.geom.Rectangle; import flash.geom.Point; public class ConvolutionClampExample extends Sprite { // Variables that affect clamping: var clamp:Boolean = false; var clampColor:Number = 0xFF0000; var clampAlpha:Number = 1; // For illustration, keep other ConvolutionFilter variables neutral: var bias:Number = 0; var preserveAlpha:Boolean = false; // Also, construct a neutral matrix var matrixCols:Number = 3; var matrixRows:Number = 3; var matrix:Array = [ 1,1,1, 1,1,1, 1,1,1 ]; var filter:ConvolutionFilter = new ConvolutionFilter(matrixCols, matrixRows, matrix, matrix.length, bias, preserveAlpha, clamp, clampColor, clampAlpha); var largeBoxWidth:Number = 100; var largeBoxHeight:Number = 100; var largeBox:BitmapData = new BitmapData(largeBoxWidth, largeBoxWidth, true, 0xCC00FF00); var smallBoxWidth:Number = largeBoxWidth / 2; var smallBoxHeight:Number = largeBoxHeight / 2; var smallBox:BitmapData = new BitmapData(smallBoxWidth, smallBoxWidth, true, 0xCC0000FF); var mc:MovieClip = this.createEmptyMovieClip(&quot;mc&quot;, this.getNextHighestDepth()); mc.attachBitmap(largeBox, this.getNextHighestDepth()); mc.onPress = function() { largeBox.applyFilter(smallBox, new Rectangle(0,0, largeBoxWidth, largeBoxHeight), new Point(0,0), filter); } } }"/>
<page href="flash/filters/ConvolutionFilter.html#color" title="ConvolutionFilter.color" text="color The hexadecimal color to substitute for pixels that are off the source image. It is an RGB value with no alpha component. The default is 0."/>
<page href="flash/filters/ConvolutionFilter.html#divisor" title="ConvolutionFilter.divisor" text="divisor The divisor used during matrix transformation. The default value is 1. A divisor that is the sum of all the matrix values smooths out the overall color intensity of the result. A value of 0 is ignored and the default is used instead."/>
<page href="flash/filters/ConvolutionFilter.html#matrix" title="ConvolutionFilter.matrix" text="matrix An array of values used for matrix transformation. The number of items in the array must equal matrixX ~~ matrixY. A matrix convolution is based on an n x m matrix, which describes how a given pixel value in the input image is combined with its neighboring pixel values to produce a resulting pixel value. Each result pixel is determined by applying the matrix to the corresponding source pixel and its neighboring pixels. For a 3 x 3 matrix convolution, the following formula is used for each independent color channel: dst (x, y) = ((src (x-1, y-1) ~~ a0 + src(x, y-1) ~~ a1.... src(x, y+1) ~~ a7 + src (x+1,y+1) ~~ a8) / divisor) + bias Certain filter specifications perform faster when run by a processor that offers SSE (Streaming SIMD Extensions). The following are criteria for faster convolution operations: The filter must be a 3x3 filter. All the filter terms must be integers between -127 and +127. The sum of all the filter terms must not have an absolute value greater than 127. If any filter term is negative, the divisor must be between 2.00001 and 256. If all filter terms are positive, the divisor must be between 1.1 and 256. The bias must be an integer. Note: If you create a ConvolutionFilter instance using the constructor without parameters, the order you assign values to matrix properties affects the behavior of the filter. In the following case, the matrix array is assigned while the matrixX and matrixY properties are still set to 0 (the default value): public var myfilter:ConvolutionFilter = new ConvolutionFilter(); myfilter.matrix = [0, 0, 0, 0, 1, 0, 0, 0, 0]; myfilter.matrixX = 3; myfilter.matrixY = 3; In the following case, the matrix array is assigned while the matrixX and matrixY properties are set to 3: public var myfilter:ConvolutionFilter = new ConvolutionFilter(); myfilter.matrixX = 3; myfilter.matrixY = 3; myfilter.matrix = [0, 0, 0, 0, 1, 0, 0, 0, 0]; The Array is null when being set"/>
<page href="flash/filters/ConvolutionFilter.html#matrixX" title="ConvolutionFilter.matrixX" text="matrixX The x dimension of the matrix (the number of columns in the matrix). The default value is 0."/>
<page href="flash/filters/ConvolutionFilter.html#matrixY" title="ConvolutionFilter.matrixY" text="matrixY The y dimension of the matrix (the number of rows in the matrix). The default value is 0."/>
<page href="flash/filters/ConvolutionFilter.html#preserveAlpha" title="ConvolutionFilter.preserveAlpha" text="preserveAlpha Indicates if the alpha channel is preserved without the filter effect or if the convolution filter is applied to the alpha channel as well as the color channels. A value of false indicates that the convolution applies to all channels, including the alpha channel. A value of true indicates that the convolution applies only to the color channels. The default value is true."/>
<page href="flash/filters/BevelFilter.html" title="BevelFilter class" text="BevelFilter The BevelFilter class lets you add a bevel effect to display objects. A bevel effect gives objects such as buttons a three-dimensional look. You can customize the look of the bevel with different highlight and shadow colors, the amount of blur on the bevel, the angle of the bevel, the placement of the bevel, and a knockout effect. You can apply the filter to any display object (that is, objects that inherit from the DisplayObject class), such as MovieClip, SimpleButton, TextField, and Video objects, as well as to BitmapData objects. To create a new filter, use the constructor new BevelFilter(). The use of filters depends on the object to which you apply the filter: To apply filters to movie clips, text fields, buttons, and video, use the filters property (inherited from DisplayObject). Setting the filters property of an object does not modify the object, and you can remove the filter by clearing the filters property. To apply filters to BitmapData objects, use the BitmapData.applyFilter() method. Calling applyFilter() on a BitmapData object takes the source BitmapData object and the filter object and generates a filtered image as a result. If you apply a filter to a display object, the value of the cacheAsBitmap property of the object is set to true. If you remove all filters, the original value of cacheAsBitmap is restored. This filter supports Stage scaling. However, it does not support general scaling, rotation, and skewing. If the object itself is scaled (if the scaleX and scaleY properties are not set to 100%), the filter is not scaled. It is scaled only when the user zooms in on the Stage. A filter is not applied if the resulting image exceeds 2880 pixels in width or height. If, for example, you zoom in on a large movie clip with a filter applied, the filter is turned off if the resulting image exceeds the limit of 2880 pixels."/>
<page href="flash/filters/BevelFilter.html#BevelFilter()" title="BevelFilter.BevelFilter()" text="BevelFilter Initializes a new BevelFilter instance with the specified parameters. distance angle highlightColor highlightAlpha shadowColor shadowAlpha blurX blurY strength quality type knockout The offset distance of the bevel, in pixels (floating point). The angle of the bevel, from 0 to 360 degrees. The highlight color of the bevel, 0xRRGGBB. The alpha transparency value of the highlight color. Valid values are 0.0 to 1.0. For example, .25 sets a transparency value of 25%. The shadow color of the bevel, 0xRRGGBB. The alpha transparency value of the shadow color. Valid values are 0.0 to 1.0. For example, .25 sets a transparency value of 25%. The amount of horizontal blur in pixels. Valid values are 0 to 255.0 (floating point). The amount of vertical blur in pixels. Valid values are 0 to 255.0 (floating point). The strength of the imprint or spread. The higher the value, the more color is imprinted and the stronger the contrast between the bevel and the background. Valid values are 0 to 255.0. The quality of the bevel. Valid values are 0 to 15, but for most applications, you can use BitmapFilterQuality constants: BitmapFilterQuality.LOW BitmapFilterQuality.MEDIUM BitmapFilterQuality.HIGH Filters with lower values render faster. You can use the other available numeric values to achieve different effects. The type of bevel. Valid values are BitmapFilterType constants: BitmapFilterType.INNER, BitmapFilterType.OUTER, or BitmapFilterType.FULL. Applies a knockout effect (true), which effectively makes the object's fill transparent and reveals the background color of the document."/>
<page href="flash/filters/BevelFilter.html#clone()" title="BevelFilter.clone()" text="clone Returns a copy of this filter object."/>
<page href="flash/filters/BevelFilter.html#angle" title="BevelFilter.angle" text="angle The angle of the bevel. Valid values are from 0 to 360°. The default value is 45°. The angle value represents the angle of the theoretical light source falling on the object and determines the placement of the effect relative to the object. If the distance property is set to 0, the effect is not offset from the object and, therefore, the angle property has no effect."/>
<page href="flash/filters/BevelFilter.html#blurX" title="BevelFilter.blurX" text="blurX The amount of horizontal blur, in pixels. Valid values are from 0 to 255 (floating point). The default value is 4. Values that are a power of 2 (such as 2, 4, 8, 16, and 32) are optimized to render more quickly than other values."/>
<page href="flash/filters/BevelFilter.html#blurY" title="BevelFilter.blurY" text="blurY The amount of vertical blur, in pixels. Valid values are from 0 to 255 (floating point). The default value is 4. Values that are a power of 2 (such as 2, 4, 8, 16, and 32) are optimized to render more quickly than other values."/>
<page href="flash/filters/BevelFilter.html#distance" title="BevelFilter.distance" text="distance The offset distance of the bevel. Valid values are in pixels (floating point). The default is 4."/>
<page href="flash/filters/BevelFilter.html#highlightAlpha" title="BevelFilter.highlightAlpha" text="highlightAlpha The alpha transparency value of the highlight color. The value is specified as a normalized value from 0 to 1. For example, .25 sets a transparency value of 25%. The default value is 1."/>
<page href="flash/filters/BevelFilter.html#highlightColor" title="BevelFilter.highlightColor" text="highlightColor The highlight color of the bevel. Valid values are in hexadecimal format, 0xRRGGBB. The default is 0xFFFFFF."/>
<page href="flash/filters/BevelFilter.html#knockout" title="BevelFilter.knockout" text="knockout Applies a knockout effect (true), which effectively makes the object's fill transparent and reveals the background color of the document. The default value is false (no knockout)."/>
<page href="flash/filters/BevelFilter.html#quality" title="BevelFilter.quality" text="quality The number of times to apply the filter. The default value is BitmapFilterQuality.LOW, which is equivalent to applying the filter once. The value BitmapFilterQuality.MEDIUM applies the filter twice; the value BitmapFilterQuality.HIGH applies it three times. Filters with lower values are rendered more quickly. For most applications, a quality value of low, medium, or high is sufficient. Although you can use additional numeric values up to 15 to achieve different effects, higher values are rendered more slowly. Instead of increasing the value of quality, you can often get a similar effect, and with faster rendering, by simply increasing the values of the blurX and blurY properties. You can use the following BitmapFilterQuality constants to specify values of the quality property: BitmapFilterQuality.LOW BitmapFilterQuality.MEDIUM BitmapFilterQuality.HIGH"/>
<page href="flash/filters/BevelFilter.html#shadowAlpha" title="BevelFilter.shadowAlpha" text="shadowAlpha The alpha transparency value of the shadow color. This value is specified as a normalized value from 0 to 1. For example, .25 sets a transparency value of 25%. The default is 1."/>
<page href="flash/filters/BevelFilter.html#shadowColor" title="BevelFilter.shadowColor" text="shadowColor The shadow color of the bevel. Valid values are in hexadecimal format, 0xRRGGBB. The default is 0x000000."/>
<page href="flash/filters/BevelFilter.html#strength" title="BevelFilter.strength" text="strength The strength of the imprint or spread. Valid values are from 0 to 255. The larger the value, the more color is imprinted and the stronger the contrast between the bevel and the background. The default value is 1."/>
<page href="flash/filters/BevelFilter.html#type" title="BevelFilter.type" text="type The placement of the bevel on the object. Inner and outer bevels are placed on the inner or outer edge; a full bevel is placed on the entire object. Valid values are the BitmapFilterType constants: BitmapFilterType.INNER BitmapFilterType.OUTER BitmapFilterType.FULL The string is null when being set"/>
<page href="flash/filters/DisplacementMapFilter.html" title="DisplacementMapFilter class" text="DisplacementMapFilter The DisplacementMapFilter class uses the pixel values from the specified BitmapData object (called the displacement map image) to perform a displacement of an object. You can use this filter to apply a warped or mottled effect to any object that inherits from the DisplayObject class, such as MovieClip, SimpleButton, TextField, and Video objects, as well as to BitmapData objects. The use of filters depends on the object to which you apply the filter: To apply filters to a display object, use the filters property of the display object. Setting the filters property of an object does not modify the object, and you can remove the filter by clearing the filters property. To apply filters to BitmapData objects, use the BitmapData.applyFilter() method. Calling applyFilter() on a BitmapData object takes the source BitmapData object and the filter object and generates a filtered image. If you apply a filter to a display object, the value of the cacheAsBitmap property of the display object is set to true. If you clear all filters, the original value of cacheAsBitmap is restored. The filter uses the following formula: dstPixel[x, y] = srcPixel[x + ((componentX(x, y) - 128) ~~ scaleX) / 256, y + ((componentY(x, y) - 128) ~~scaleY) / 256) where componentX(x, y) gets the componentX property color value from the mapBitmap property at (x - mapPoint.x ,y - mapPoint.y). The map image used by the filter is scaled to match the Stage scaling. It is not scaled when the object itself is scaled. This filter supports Stage scaling. However, general scaling, rotation, and skewing are not supported. If the object itself is scaled (if the scaleX and scaleY properties are set to a value other than 1.0), the filter effect is not scaled. It is scaled only when the user zooms in on the Stage."/>
<page href="flash/filters/DisplacementMapFilter.html#DisplacementMapFilter()" title="DisplacementMapFilter.DisplacementMapFilter()" text="DisplacementMapFilter Initializes a DisplacementMapFilter instance with the specified parameters. mapBitmap mapPoint componentX componentY scaleX scaleY mode color alpha A BitmapData object containing the displacement map data. A value that contains the offset of the upper-left corner of the target display object from the upper-left corner of the map image. Describes which color channel to use in the map image to displace the x result. Possible values are the BitmapDataChannel constants. Describes which color channel to use in the map image to displace the y result. Possible values are the BitmapDataChannel constants. The multiplier to use to scale the x displacement result from the map calculation. The multiplier to use to scale the y displacement result from the map calculation. The mode of the filter. Possible values are the DisplacementMapFilterMode constants. Specifies the color to use for out-of-bounds displacements. The valid range of displacements is 0.0 to 1.0. Use this parameter if mode is set to DisplacementMapFilterMode.COLOR. Specifies what alpha value to use for out-of-bounds displacements. It is specified as a normalized value from 0.0 to 1.0. For example, .25 sets a transparency value of 25%. Use this parameter if mode is set to DisplacementMapFilterMode.COLOR."/>
<page href="flash/filters/DisplacementMapFilter.html#clone()" title="DisplacementMapFilter.clone()" text="clone Returns a copy of this filter object."/>
<page href="flash/filters/DisplacementMapFilter.html#alpha" title="DisplacementMapFilter.alpha" text="alpha Specifies the alpha transparency value to use for out-of-bounds displacements. It is specified as a normalized value from 0.0 to 1.0. For example, .25 sets a transparency value of 25%. The default value is 0. Use this property if the mode property is set to DisplacementMapFilterMode.COLOR."/>
<page href="flash/filters/DisplacementMapFilter.html#color" title="DisplacementMapFilter.color" text="color Specifies what color to use for out-of-bounds displacements. The valid range of displacements is 0.0 to 1.0. Values are in hexadecimal format. The default value for color is 0. Use this property if the mode property is set to DisplacementMapFilterMode.COLOR."/>
<page href="flash/filters/DisplacementMapFilter.html#componentX" title="DisplacementMapFilter.componentX" text="componentX Describes which color channel to use in the map image to displace the x result. Possible values are BitmapDataChannel constants: BitmapDataChannel.ALPHA BitmapDataChannel.BLUE BitmapDataChannel.GREEN BitmapDataChannel.RED"/>
<page href="flash/filters/DisplacementMapFilter.html#componentY" title="DisplacementMapFilter.componentY" text="componentY Describes which color channel to use in the map image to displace the y result. Possible values are BitmapDataChannel constants: BitmapDataChannel.ALPHA BitmapDataChannel.BLUE BitmapDataChannel.GREEN BitmapDataChannel.RED"/>
<page href="flash/filters/DisplacementMapFilter.html#mapBitmap" title="DisplacementMapFilter.mapBitmap" text="mapBitmap A BitmapData object containing the displacement map data. The BitmapData is null when being set"/>
<page href="flash/filters/DisplacementMapFilter.html#mapPoint" title="DisplacementMapFilter.mapPoint" text="mapPoint A value that contains the offset of the upper-left corner of the target display object from the upper-left corner of the map image. The Point is null when being set"/>
<page href="flash/filters/DisplacementMapFilter.html#mode" title="DisplacementMapFilter.mode" text="mode The mode for the filter. Possible values are DisplacementMapFilterMode constants: DisplacementMapFilterMode.WRAP — Wraps the displacement value to the other side of the source image. DisplacementMapFilterMode.CLAMP — Clamps the displacement value to the edge of the source image. DisplacementMapFilterMode.IGNORE — If the displacement value is out of range, ignores the displacement and uses the source pixel. DisplacementMapFilterMode.COLOR — If the displacement value is outside the image, substitutes the values in the color and alpha properties. The String is null when being set"/>
<page href="flash/filters/DisplacementMapFilter.html#scaleX" title="DisplacementMapFilter.scaleX" text="scaleX The multiplier to use to scale the x displacement result from the map calculation."/>
<page href="flash/filters/DisplacementMapFilter.html#scaleY" title="DisplacementMapFilter.scaleY" text="scaleY The multiplier to use to scale the y displacement result from the map calculation."/>
<page href="flash/filters/DropShadowFilter.html" title="DropShadowFilter class" text="DropShadowFilter The DropShadowFilter class lets you add a drop shadow to display objects. The shadow algorithm is based on the same box filter that the blur filter uses. You have several options for the style of the drop shadow, including inner or outer shadow and knockout mode. You can apply the filter to any display object (that is, objects that inherit from the DisplayObject class), such as MovieClip, SimpleButton, TextField, and Video objects, as well as to BitmapData objects. The use of filters depends on the object to which you apply the filter: To apply filters to display objects use the filters property (inherited from DisplayObject). Setting the filters property of an object does not modify the object, and you can remove the filter by clearing the filters property. To apply filters to BitmapData objects, use the BitmapData.applyFilter() method. Calling applyFilter() on a BitmapData object takes the source BitmapData object and the filter object and generates a filtered image as a result. If you apply a filter to a display object, the value of the cacheAsBitmap property of the display object is set to true. If you clear all filters, the original value of cacheAsBitmap is restored. This filter supports Stage scaling. However, it does not support general scaling, rotation, and skewing. If the object itself is scaled (if scaleX and scaleY are set to a value other than 1.0), the filter is not scaled. It is scaled only when the user zooms in on the Stage. A filter is not applied if the resulting image exceeds 2880 pixels in width or height. If, for example, you zoom in on a large movie clip with a filter applied, the filter is turned off if the resulting image exceeds the limit of 2880 pixels."/>
<page href="flash/filters/DropShadowFilter.html#DropShadowFilter()" title="DropShadowFilter.DropShadowFilter()" text="DropShadowFilter Creates a new DropShadowFilter instance with the specified parameters. distance angle color alpha blurX blurY strength quality inner knockout hideObject Offset distance for the shadow, in pixels. Angle of the shadow, 0 to 360 degrees (floating point). Color of the shadow, in hexadecimal format 0xRRGGBB. The default value is 0x000000. Alpha transparency value for the shadow color. Valid values are 0.0 to 1.0. For example, .25 sets a transparency value of 25%. Amount of horizontal blur. Valid values are 0 to 255.0 (floating point). Amount of vertical blur. Valid values are 0 to 255.0 (floating point). The strength of the imprint or spread. The higher the value, the more color is imprinted and the stronger the contrast between the shadow and the background. Valid values are 0 to 255.0. The number of times to apply the filter. Use the BitmapFilterQuality constants: BitmapFilterQuality.LOW BitmapFilterQuality.MEDIUM BitmapFilterQuality.HIGH For more information about these values, see the quality property description. Indicates whether or not the shadow is an inner shadow. A value of true specifies an inner shadow. A value of false specifies an outer shadow (a shadow around the outer edges of the object). Applies a knockout effect (true), which effectively makes the object's fill transparent and reveals the background color of the document. Indicates whether or not the object is hidden. A value of true indicates that the object itself is not drawn; only the shadow is visible."/>
<page href="flash/filters/DropShadowFilter.html#clone()" title="DropShadowFilter.clone()" text="clone Returns a copy of this filter object."/>
<page href="flash/filters/DropShadowFilter.html#alpha" title="DropShadowFilter.alpha" text="alpha The alpha transparency value for the shadow color. Valid values are 0.0 to 1.0. For example, .25 sets a transparency value of 25%. The default value is 1.0."/>
<page href="flash/filters/DropShadowFilter.html#angle" title="DropShadowFilter.angle" text="angle The angle of the shadow. Valid values are 0 to 360 degrees (floating point). The default value is 45."/>
<page href="flash/filters/DropShadowFilter.html#blurX" title="DropShadowFilter.blurX" text="blurX The amount of horizontal blur. Valid values are 0 to 255.0 (floating point). The default value is 4.0."/>
<page href="flash/filters/DropShadowFilter.html#blurY" title="DropShadowFilter.blurY" text="blurY The amount of vertical blur. Valid values are 0 to 255.0 (floating point). The default value is 4.0."/>
<page href="flash/filters/DropShadowFilter.html#color" title="DropShadowFilter.color" text="color The color of the shadow. Valid values are in hexadecimal format 0xRRGGBB. The default value is 0x000000."/>
<page href="flash/filters/DropShadowFilter.html#distance" title="DropShadowFilter.distance" text="distance The offset distance for the shadow, in pixels. The default value is 4.0 (floating point)."/>
<page href="flash/filters/DropShadowFilter.html#hideObject" title="DropShadowFilter.hideObject" text="hideObject Indicates whether or not the object is hidden. The value true indicates that the object itself is not drawn; only the shadow is visible. The default is false (the object is shown)."/>
<page href="flash/filters/DropShadowFilter.html#inner" title="DropShadowFilter.inner" text="inner Indicates whether or not the shadow is an inner shadow. The value true indicates an inner shadow. The default is false, an outer shadow (a shadow around the outer edges of the object)."/>
<page href="flash/filters/DropShadowFilter.html#knockout" title="DropShadowFilter.knockout" text="knockout Applies a knockout effect (true), which effectively makes the object's fill transparent and reveals the background color of the document. The default is false (no knockout)."/>
<page href="flash/filters/DropShadowFilter.html#quality" title="DropShadowFilter.quality" text="quality The number of times to apply the filter. The default value is BitmapFilterQuality.LOW, which is equivalent to applying the filter once. The value BitmapFilterQuality.MEDIUM applies the filter twice; the value BitmapFilterQuality.HIGH applies it three times. Filters with lower values are rendered more quickly. For most applications, a quality value of low, medium, or high is sufficient. Although you can use additional numeric values up to 15 to achieve different effects, higher values are rendered more slowly. Instead of increasing the value of quality, you can often get a similar effect, and with faster rendering, by simply increasing the values of the blurX and blurY properties."/>
<page href="flash/filters/DropShadowFilter.html#strength" title="DropShadowFilter.strength" text="strength The strength of the imprint or spread. The higher the value, the more color is imprinted and the stronger the contrast between the shadow and the background. Valid values are from 0 to 255.0. The default is 1.0."/>
<page href="fl/livepreview/LivePreviewParent.html" title="LivePreviewParent class" text="LivePreviewParent The LivePreviewParent class provides the timeline for a SWC file or for a compiled clip that is being exported when ActionScript 3.0 is selected. When a property is set on a component instance or when a component instance is resized on the Stage, Flash makes calls to the methods of this class, which in turn call methods in your component code to set the properties and to resize the component. In cases where your component must implement a specific action when it is in live preview mode, use the following code to test for live preview mode: var isLivePreview:Boolean = (parent != null &amp;&amp; getQualifiedClassName(parent) == &quot;fl.livepreview::LivePreviewParent&quot;); The LivePreviewParent class supports the definition of a setSize() method that uses width and height values to resize a component. If you do not define a setSize() method, this object sets the width and height properties individually. When the user resizes the live preview of your component in the Flash authoring tool, Flash will attempt to call your component's setSize() method for the preview. If your component does not define a setSize() method, the LivePreviewParent class instance will set the width and height properties of your component individually. The easiest way to create a component live preview file is to create a SWC file and extract the live preview SWF: Exporting your component as a SWC file. Changing the .swc file extension to .zip. Extract the SWF file within the ZIP file. Alternatively, you can use the LivePreviewParent class to create a custom live preview SWF file without creating a SWC file. To create a component live preview file in this way, follow these steps:&quot; Create a new Flash document. Set its document class to fl.livepreview.LivePreviewParent. Drag your component to the Stage and position it to x and y coordinates of 0. Check to ensure that the component parameters remain at their default settings. This should be the case if you drag the component from the Library panel or from the Components panel. Select Modify &gt; Document from the main menu and, for the Match option, click Contents. Click OK. Publish the file to see the resulting SWF file as a custom live preview SWF file. Right-click the asset in the Library panel and select Component Definition from the context menu. The Component Definition dialog box allows you to specify a custom live preview SWF file for a component. In some cases, you may want to have a custom live preview SWF file that is completely different from your component. See the live preview of the fl.containers.UILoader component for such an example. This live preview does not use the properties of UILoader, nor does it implement getter and setter functions for these properties. It does, however, implement a setSize() method that uses width and height parameters to draw the component at the new size."/>
<page href="fl/livepreview/LivePreviewParent.html#LivePreviewParent()" title="LivePreviewParent.LivePreviewParent()" text="LivePreviewParent Initializes the scale and align modes of the Stage, sets the myInstance property, resizes myInstance to the proper size and uses the ExternalInterface class to expose functions to Flash."/>
<page href="fl/livepreview/LivePreviewParent.html#onResize()" title="LivePreviewParent.onResize()" text="onResize Resizes the component instance on the Stage to the specified dimensions, either by calling a user-defined method, or by separately setting the width and height properties. This method is called by the Flash authoring tool. width height The new width for the myInstance instance. The new height for the myInstance instance."/>
<page href="fl/livepreview/LivePreviewParent.html#onUpdate()" title="LivePreviewParent.onUpdate()" text="onUpdate Updates the properties of the component instance. This method is called by the Flash authoring tool when there is a change in the value of a property. This method updates all component properties, whether or not they were changed. updateArray An array of parameter names and values."/>
<page href="fl/livepreview/LivePreviewParent.html#myInstance" title="LivePreviewParent.myInstance" text="myInstance The component instance associated with the live preview. This property is internally used to refer to your component instance. Component developers are not required to set this property, since this occurs automatically when an instance of a component is placed on the Stage."/>
<page href="flash/external/ExternalInterface.html" title="ExternalInterface class" text="ExternalInterface The ExternalInterface class is the External API, an application programming interface that enables straightforward communication between ActionScript and the Flash Player container– for example, an HTML page with JavaScript. Adobe recommends using ExternalInterface for all JavaScript-ActionScript communication. You can call an ActionScript function in Flash Player, using JavaScript in the HTML page. The ActionScript function can return a value, and JavaScript receives it immediately as the return value of the call. This functionality replaces the fscommand() method. Use the ExternalInterface class in the following combinations of browser and operating system: Browser Operating System Operating System Internet Explorer 5.0 and later  Windows    Netscape 8.0 and later  Windows   MacOS  Mozilla 1.7.5 and later  Windows   MacOS  Firefox 1.0 and later  Windows   MacOS  Safari 1.3 and later    MacOS  Flash Player for Linux version 9.0.31.0 and later supports the ExternalInterface class in the following browsers: Browser Mozilla 1.7.x and later Firefox 1.5.0.7 and later SeaMonkey 1.0.5 and later The ExternalInterface class requires the user's web browser to support either ActiveX or the NPRuntime API that is exposed by some browsers for plug-in scripting. Even if a browser and operating system combination are not listed above, they should support the ExternalInterface class if they support the NPRuntime API. See http://www.mozilla.org/projects/plugins/npruntime.html. Note: When embedding SWF files within an HTML page, make sure that the id and name attributes of the object and embed tags do not include the following characters: . - + ~~ / \ From ActionScript, you can do the following on the HTML page: Call any JavaScript function. Pass any number of arguments, with any names. Pass various data types (Boolean, Number, String, and so on). Receive a return value from the JavaScript function. From JavaScript on the HTML page, you can: Call an ActionScript function. Pass arguments using standard function call notation. Return a value to the JavaScript function. Flash Player does not currently support SWF files embedded within HTML forms."/>
<page href="flash/external/ExternalInterface.html#addCallback()" title="ExternalInterface.addCallback()" text="addCallback Registers an ActionScript method as callable from the container. After a successful invocation of addCallBack(), the registered function in Flash Player can be called by JavaScript or ActiveX code in the container. Note: For local content running in a browser, calls to the ExternalInterface.addCallback() method work only if the SWF file and the containing web page are in the local-trusted security sandbox. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper functionName closure The name by which the container can invoke the function. The function closure to invoke. This could be a free-standing function, or it could be a method closure referencing a method of an object instance. By passing a method closure, you can direct the callback at a method of a particular object instance. The container does not support incoming calls. Incoming calls are supported only in Internet Explorer for Windows and browsers that use the NPRuntime API such as Mozilla 1.7.5 and later or Firefox 1.0 and later."/>
<page href="flash/external/ExternalInterface.html#call()" title="ExternalInterface.call()" text="call Calls a function exposed by the Flash Player container, passing zero or more arguments. If the function is not available, the call returns null; otherwise it returns the value provided by the function. Recursion is not permitted on Opera or Netscape browsers; on these browsers a recursive call produces a null response. (Recursion is supported on Internet Explorer and Firefox browsers.) If the container is an HTML page, this method invokes a JavaScript function in a script element. If the container is another ActiveX container, this method dispatches the FlashCall ActiveX event with the specified name, and the container processes the event. If the container is hosting the Netscape plug-in, you can either write custom support for the new NPRuntime interface or embed an HTML control and embed Flash Player within the HTML control. If you embed an HTML control, you can communicate with Flash Player through a JavaScript interface to the native container application. Note: For local content running in a browser, calls to the ExternalInterface.call() method are permitted only if the SWF file and the containing web page (if there is one) are in the local-trusted security sandbox. Also, you can prevent a SWF file from using this method by setting the allowNetworking parameter of the object and embed tags in the HTML page that contains the SWF content. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper functionName arguments The alphanumeric name of the function to call in the container. The arguments to pass to the function in the container. You can specify zero or more parameters, separating them with commas. They can be of any ActionScript data type. When the call is to a JavaScript function, the ActionScript types are automatically converted into JavaScript types; when the call is to some other ActiveX container, the parameters are encoded in the request message. The container does not support outgoing calls. Outgoing calls are supported only in Internet Explorer for Windows and browsers that use the NPRuntime API such as Mozilla 1.7.5 and later or Firefox 1.0 and later."/>
<page href="flash/external/ExternalInterface.html#available" title="ExternalInterface.available" text="available Indicates whether this player is in a container that offers an external interface. If the external interface is available, this property is true; otherwise, it is false. Note: When using the External API with HTML, always check that the HTML has finished loading before you attempt to call any JavaScript methods. The following example uses the available property to determine whether the player is in a container that offers an external interface. package { import flash.text.TextField; import flash.display.MovieClip; import flash.external.ExternalInterface; public class extint_test extends MovieClip { public function extint_test() { var isAvailable:Boolean = ExternalInterface.available; var availTxt:TextField = new TextField(); availTxt.text = isAvailable.toString(); addChild(availTxt); } } }"/>
<page href="flash/external/ExternalInterface.html#marshallExceptions" title="ExternalInterface.marshallExceptions" text="marshallExceptions Indicates whether the external interface should attempt to pass ActionScript exceptions to the current browser and JavaScript exceptions to Flash Player. You must explicitly set this property to true to catch JavaScript exceptions in ActionScript and to catch ActionScript exceptions in JavaScript. Player Version: Flash Player 9 Update 3. The following example creates an ActionScript function and registers it with the containing browser by using the addCallback() method. The new function throws an exception so that JavaScript code running in the browser can catch it. This example also contains a try..catch statement to catch any exceptions thrown by the browser when the throwit() function is called. package { import flash.external.* import flash.net.*; import flash.display.*; import flash.system.System; public class ext_test extends Sprite { function ext_test():void { ExternalInterface.marshallExceptions = true; ExternalInterface.addCallback(&quot;g&quot;, g); try { ExternalInterface.call(&quot;throwit&quot;); } catch(e:Error) { trace(e) } } function g() { throw new Error(&quot;exception from actionscript!!!!&quot;) } } }"/>
<page href="flash/external/ExternalInterface.html#objectID" title="ExternalInterface.objectID" text="objectID Returns the id attribute of the object tag in Internet Explorer, or the name attribute of the embed tag in Netscape."/>
<page href="flash/printing/PrintJob.html" title="PrintJob class" text="PrintJob The PrintJob class lets you create content and print it to one or more pages. This class lets you render content that is visible, dynamic or off-screen to the user, prompt users with a single Print dialog box, and print an unscaled document with proportions that map to the proportions of the content. This capability is especially useful for rendering and printing dynamic content, such as database content and dynamic text. Use the PrintJob() constructor to create a print job. Additionally, with properties populated by PrintJob.start(), your document can read your user's printer settings, such as page height, width, and image orientation, and you can configure your document to format, dynamically, Flash content that is appropriate for the printer settings. The user layout properties populated by PrintJob.start() are read-only and cannot be changed by Flash Player. Note: ActionScript 3.0 does not restrict a PrintJob object to a single frame (as did previous versions of ActionScript). However, since the operating system displays print status information to the user after the user has clicked the OK button in the Print dialog box, you should call PrintJob.addPage() and PrintJob.send() as soon as possible to send pages to the spooler. A delay reaching the frame containing the PrintJob.send() call will delay the printing process. Additionally, a 15 second script timeout limit applies to the following intervals: PrintJob.start() and the first PrintJob.addPage() PrintJob.addPage() and the next PrintJob.addPage() The last PrintJob.addPage() and PrintJob.send() If any of the above intervals span more than 15 seconds, the next call to PrintJob.start() on the PrintJob instance returns false, and the next PrintJob.addPage() on the PrintJob instance causes Flash Player to throw a runtime exception."/>
<page href="flash/printing/PrintJob.html#PrintJob()" title="PrintJob.PrintJob()" text="PrintJob Creates a PrintJob object that you can use to print one or more pages. After you create a PrintJob object, you need to use (in the following sequence) the PrintJob.start(), PrintJob.addPage(), and then PrintJob.send() methods to send the print job to the printer. For example, you can replace the [params] placeholder text for the my_pj.addPage() method calls with custom parameters as shown in the following code: // create PrintJob object var my_pj:PrintJob = new PrintJob(); // display Print dialog box, but only initiate the print job // if start returns successfully. if (my_pj.start()) { // add specified page to print job // repeat once for each page to be printed try { my_pj.addPage([params]); } catch(e:Error) { // handle error } try { my_pj.addPage([params]); } catch(e:Error) { // handle error } // send pages from the spooler to the printer, but only if one or more // calls to addPage() was successful. You should always check for successful // calls to start() and addPage() before calling send(). my_pj.send(); } You cannot create a second PrintJob object while the first one is still active. If you create a second PrintJob object (by calling new PrintJob()) while the first PrintJob object is still active, the second PrintJob object will not be created. So, you may check for the my_pj value before creating a second PrintJob. Throws an exception if another PrintJob object is still active."/>
<page href="flash/printing/PrintJob.html#addPage()" title="PrintJob.addPage()" text="addPage Sends the specified Sprite object as a single page to the print spooler. Before using this method, you must create a PrintJob object and then use PrintJob.start(). Then, after calling PrintJob.addPage() one or more times for a print job, you use PrintJob.send() to send the spooled pages to the printer. In other words, after you create a PrintJob object, use (in the following sequence) PrintJob.start(), PrintJob.addPage(), and then PrintJob.send() to send the print job to the printer. You can use PrintJob.addPage() multiple times after a single call to PrintJob.start() to print several pages at once. If PrintJob.addPage() causes Flash Player to throw an exception (for example, if you haven't called PrintJob.start() or the user canceled the print job), any subsequent calls to PrintJob.addPage() will fail. However, if previous calls to PrintJob.addPage() were successful, the concluding PrintJob.send() command sends the successfully spooled pages to the printer. If the print job takes more than 15 seconds to complete a PrintJob.addPage() operation, Flash Player will throw an exception on the next Print.addPage() call. If you pass a value for the printArea parameter, the x and y coordinates of the printArea object map to the upper-left corner (0,0 coordinates) of the printable area on the page. The printable area is described by the read-only pageHeight and pageWidth properties set by PrintJob.start(). Because the printout aligns with the upper-left corner of the printable area on the page, when the area defined in printArea is bigger than the printable area on the page, the printout is cropped to the right or bottom (or both) of the area defined by printArea. If you don't pass a value for printArea and the Stage is larger than the printable area, the same type of clipping occurs. If you want to scale a Sprite object before you print it, set scale properties (see flash.display.DisplayObject.scaleX and flash.display.DisplayObject.scaleY) before calling this method, and set them back to their original values after printing. The scale of a Sprite object has no relation to printArea. That is, if you specify a print area that is 50 x 50 pixels, 2500 pixels are printed. If you scale the Sprite object, the same 2500 pixels are printed, but the Sprite object is printed at the scaled size. The Flash Player printing feature supports PostScript and non-PostScript printers. Non-PostScript printers convert vectors to bitmaps. sprite printArea options frameNum The instance name of the Sprite to print. A Rectangle object that specifies the area to print. A rectangle's width and height are pixel values. A printer uses points as print units of measurement. Points are a fixed physical size (1/72 inch), but the size of a pixel, onscreen, depends on the resolution of the particular screen. So, the conversion rate between pixels and points depends on the printer settings and whether the sprite is scaled. An unscaled sprite that is 72 pixels wide will print out one inch wide, with one point equal to one pixel, independent of screen resolution. You can use the following equivalencies to convert inches or centimeters to twips or points (a twip is 1/20 of a point): 1 point = 1/72 inch = 20 twips 1 inch = 72 points = 1440 twips 1 cm = 567 twips If you omit the printArea parameter, or if it is passed incorrectly, the full area of sprite is printed. If you don't want to specify a value for printArea but want to specify a value for options or frameNum, pass null for printArea. An optional parameter that specifies whether to print as vector or bitmap. The default value is null, which represents a request for vector printing. To print sprite as a bitmap, set the printAsBitmap property of the PrintJobOptions object to true. Remember the following suggestions when determining whether to set printAsBitmap to true: If the content that you're printing includes a bitmap image, set printAsBitmap to true to include any alpha transparency and color effects. If the content does not include bitmap images, omit this parameter to print the content in higher quality vector format. If options is omitted or is passed incorrectly, vector printing is used. If you don't want to specify a value for options but want to specify a value for frameNumber, pass null for options. An optional number that lets you specify which frame to print; passing a frameNum does not cause the ActionScript on that frame to be invoked. If you omit this parameter, the current frame in sprite is printed. Note: If you previously used print(), printAsBitmap(), printAsBitmapNum(), or printNum() to print from Flash, you might have used a #p frame label on multiple frames to specify which pages to print. To use PrintJob.addPage() to print multiple frames, you must use a PrintJob.addPage() method for each frame; #p frame labels are ignored. For one way to do this programmatically, see the Example section. Throws an exception if you haven't called PrintJob.start() or the user canceled the print job"/>
<page href="flash/printing/PrintJob.html#send()" title="PrintJob.send()" text="send Sends spooled pages to the printer after PrintJob.start() and PrintJob.addPage() have been successful. Calls to PrintJob.send() will not be successful if the call to PrintJob.start() fails, or PrintJob.addpage() throws an exception. So, you should check for PrintJob.start() to return true, and catch any PrintJob.addpage() exceptions before calling PrintJob.send(). For example: var my_pj:PrintJob = new PrintJob(); if (my_pj.start()) { try { my_pj.addPage([params]); } catch(e:Error) { // handle error } my_pj.send(); }"/>
<page href="flash/printing/PrintJob.html#start()" title="PrintJob.start()" text="start Displays the operating system's Print dialog box, starts spooling, and sets the PrintJob read-only property values. The Print dialog box lets the user change print settings. When the PrintJob.start() method returns successfully (the user clicks OK in the Print dialog box), the following read-only properties are populated, representing the user's current print settings: Property Type Units Notes PrintJob.paperHeight Number Points Overall paper height. PrintJob.paperWidth Number Points Overall paper width. PrintJob.pageHeight Number Points Height of actual printable area on the page; any user-set margins are ignored. PrintJob.pageWidth Number Points Width of actual printable area on the page; any user-set margins are ignored. PrintJob.orientation String &quot;portrait&quot; (flash.printing.PrintJobOrientation.PORTRAIT) or &quot;landscape&quot; (flash.printing.PrintJobOrientation.LANDSCAPE). Note: If the user cancels the Print dialog box, the properties are not populated. After the user clicks OK in the Print dialog box, the player begins spooling a print job to the operating system. Because the operating system then begins displaying information to the user about the printing progress, you should call the PrintJob.addPage() and PrintJob.send() calls as soon as possible to send pages to the spooler. You can use the read-only height, width, and orientation properties this method populates to format the printout. Test to see if this method returns true (when the user clicks OK in the operating system's Print dialog box) before any subsequent calls to PrintJob.addPage() and PrintJob.send(): var my_pj:PrintJob = new PrintJob(); if(my_pj.start()) { // addPage() and send() statements here } For the given print job instance, if any of the following intervals last more than 15 seconds the next call to PrintJob.start() will return false: PrintJob.start() and the first PrintJob.addPage() One PrintJob.addPage() and the next PrintJob.addPage() The last PrintJob.addPage() and PrintJob.send()"/>
<page href="flash/printing/PrintJob.html#orientation" title="PrintJob.orientation" text="orientation The image orientation for printing. This property is a value from the PrintJobOrientation class. This property is available only after a call to the PrintJob.start() method has been made."/>
<page href="flash/printing/PrintJob.html#pageHeight" title="PrintJob.pageHeight" text="pageHeight The height of the actual printable area on the page, in points. Any user-set margins are ignored. This property is available only after a call to the PrintJob.start() method has been made."/>
<page href="flash/printing/PrintJob.html#pageWidth" title="PrintJob.pageWidth" text="pageWidth The width of the actual printable area on the page, in points. Any user-set margins are ignored. This property is available only after a call to the PrintJob.start() method has been made."/>
<page href="flash/printing/PrintJob.html#paperHeight" title="PrintJob.paperHeight" text="paperHeight The overall paper height, in points. This property is available only after a call to the PrintJob.start() method has been made."/>
<page href="flash/printing/PrintJob.html#paperWidth" title="PrintJob.paperWidth" text="paperWidth The overall paper width, in points. This property is available only after a call to the PrintJob.start() method has been made."/>
<page href="flash/printing/PrintJobOrientation.html" title="PrintJobOrientation class" text="PrintJobOrientation This class provides values that are used by the PrintJob.orientation property for the image position of a printed page."/>
<page href="flash/printing/PrintJobOrientation.html#LANDSCAPE" title="PrintJobOrientation.LANDSCAPE" text="LANDSCAPE The landscape (horizontal) image orientation for printing. This constant is used with the PrintJob.orientation property. Use the syntax PrintJobOrientation.LANDSCAPE."/>
<page href="flash/printing/PrintJobOrientation.html#PORTRAIT" title="PrintJobOrientation.PORTRAIT" text="PORTRAIT The portrait (vertical) image orientation for printing. This constant is used with the PrintJob.orientation property. Use the syntax PrintJobOrientation.PORTRAIT."/>
<page href="flash/printing/PrintJobOptions.html" title="PrintJobOptions class" text="PrintJobOptions The PrintJobOptions class contains properties to use with the options parameter of the PrintJob.addPage() method. For more information about addPage(), see the PrintJob class."/>
<page href="flash/printing/PrintJobOptions.html#PrintJobOptions()" title="PrintJobOptions.PrintJobOptions()" text="PrintJobOptions Creates a new PrintJobOptions object. You pass this object to the options parameter of the PrintJob.addPage() method. printAsBitmap If true, this object is printed as a bitmap. If false, this object is printed as a vector. If the content that you're printing includes a bitmap image, set the printAsBitmap property to true to include any alpha transparency and color effects. If the content does not include bitmap images, omit this parameter to print the content in higher quality vector format (the default option)."/>
<page href="flash/printing/PrintJobOptions.html#printAsBitmap" title="PrintJobOptions.printAsBitmap" text="printAsBitmap Specifies whether the content in the print job is printed as a bitmap or as a vector. The default value is false, for vector printing. If the content that you're printing includes a bitmap image, set printAsBitmap to true to include any alpha transparency and color effects. If the content does not include bitmap images, you should print the content in higher quality vector format (the default option). For example, to print your content as a bitmap, use the following syntax: var options:PrintJobOptions = new PrintJobOptions(); options.printAsBitmap = true; myPrintJob.addPage(mySprite, null, options); The following example first loads a picture and puts it in a rectangle frame, then print the picture as a bitmap. The constructor loads the picture (image.jpg) using the Loader and URLRequest objects. It also checks if an error occurred during loading. Here the file is assumed to be in the same directory as the SWF file. The SWF file needs to be compiled with Local Playback Secuirty set to Access Local Files Only. When the picture is loaded (the event is complete), the completeHandler() method is called. The completeHandler() method, creates a BitmapData object, and loads the picture (bitmap) in it. A rectangle is drawn in the Sprite object (frame) and the beginBitmapFill() method is used to fill the rectangle with the picture (a BitmapData object). A Matrix object also is used to scale the image to fit the rectangle. (Note that this will distort the image. It is used in this example to make sure the image fits.) Once the image is filled, the printPage() method is called. The printPage() method creates a new instance of the print job and starts the printing process, which invokes the print dialog box for the user, and populates the properties of the print job. The addPage() method contains the details about the print job. Here, the frame with the picture (a Sprite object) is set to print as a bitmap and not as a vector. options is an instance of PrintJobOptions class and its property printAsBitmap is set to true in order to print as a bitmap (default setting is false). Note: There is very limited error handling defined for this example. package { import flash.display.Sprite; import flash.display.Loader; import flash.display.Bitmap; import flash.display.BitmapData; import flash.printing.PrintJob; import flash.printing.PrintJobOptions; import flash.events.Event; import flash.events.IOErrorEvent; import flash.net.URLRequest; import flash.geom.Matrix; public class printAsBitmapExample extends Sprite { private var frame:Sprite = new Sprite(); private var url:String = &quot;image.jpg&quot;; private var loader:Loader = new Loader(); public function printAsBitmapExample() { var request:URLRequest = new URLRequest(url); loader.load(request); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler); loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); } private function completeHandler(event:Event):void { var picture:Bitmap = Bitmap(loader.content); var bitmap:BitmapData = picture.bitmapData; var myBitmap:BitmapData = new BitmapData(loader.width, loader.height, false); var matrix:Matrix = new Matrix(); matrix.scale((200 / bitmap.width), (200 / bitmap.height)); frame.graphics.lineStyle(10); frame.graphics.beginBitmapFill(bitmap, matrix, true); frame.graphics.drawRect(0, 0, 200, 200); frame.graphics.endFill(); addChild(frame); printPage(); } private function ioErrorHandler(event:IOErrorEvent):void { trace(&quot;Unable to load the image: &quot; + url); } private function printPage ():void { var myPrintJob:PrintJob = new PrintJob(); var options:PrintJobOptions = new PrintJobOptions(); options.printAsBitmap = true; myPrintJob.start(); try { myPrintJob.addPage(frame, null, options); } catch(e:Error) { trace (&quot;Had problem adding the page to print job: &quot; + e); } try { myPrintJob.send(); } catch (e:Error) { trace (&quot;Had problem printing: &quot; + e); } } } }"/>
<page href="fl/transitions/Rotate.html" title="Rotate class" text="Rotate The Rotate class rotates the movie clip object. This effect requires the following parameters: ccw: A boolean value: false for clockwise rotation; true for counter-clockwise rotation. degrees: An integer that indicates the number of degrees the object is to be rotated. The recommended range is 1 to 9999. For example, a degrees setting of 1080 would rotate the object completely three times. For example, the following code uses the Rotate transition for the movie clip instance img1_mc: import fl.transitions.~~; import fl.transitions.easing.~~; TransitionManager.start(img1_mc, {type:Rotate, direction:Transition.IN, duration:3, easing:Strong.easeInOut, ccw:false, degrees:720});"/>
<page href="fl/transitions/Iris.html" title="Iris class" text="Iris The Iris class reveals the movie clip object by using an animated mask of a square shape or a circle shape that zooms in or out. This effect requires the following parameters: startPoint: An integer indicating a starting position; the range is 1 to 9: Top Left:1; Top Center:2, Top Right:3; Left Center:4; Center:5; Right Center:6; Bottom Left:7; Bottom Center:8, Bottom Right:9. shape: A mask shape of either fl.transitions.Iris.SQUARE (a square) or fl.transitions.Iris.CIRCLE (a circle). For example, the following code uses a circle-shaped animated mask transition for the movie clip instance img1_mc: import fl.transitions.~~; import fl.transitions.easing.~~; TransitionManager.start(img1_mc, {type:Iris, direction:Transition.IN, duration:2, easing:Strong.easeOut, startPoint:5, shape:Iris.CIRCLE});"/>
<page href="fl/transitions/Iris.html#CIRCLE" title="Iris.CIRCLE" text="CIRCLE Used to specify a circle mask shape for the transition effect."/>
<page href="fl/transitions/Iris.html#SQUARE" title="Iris.SQUARE" text="SQUARE Used to specify a square mask shape for the transition effect."/>
<page href="fl/transitions/Blinds.html" title="Blinds class" text="Blinds The Blinds class reveals the movie clip object by using appearing or disappearing rectangles. This effect requires the following parameters: numStrips: The number of masking strips in the Blinds effect. The recommended range is 1 to 50. dimension: An integer that indicates whether the masking strips are to be vertical (0) or horizontal (1). For example, the following code uses the Blinds transition for the movie clip instance img1_mc: import fl.transitions.~~; import fl.transitions.easing.~~; TransitionManager.start(img1_mc, {type:Blinds, direction:Transition.IN, duration:2, easing:None.easeNone, numStrips:10, dimension:0});"/>
<page href="fl/transitions/Zoom.html" title="Zoom class" text="Zoom The Zoom class zooms the movie clip object in or out by scaling it in proportion. This effect requires no additional parameters: For example, the following code uses the Zoom transition for the movie clip instance img1_mc: import fl.transitions.~~; import fl.transitions.easing.~~; TransitionManager.start(img1_mc, {type:Zoom, direction:Transition.IN, duration:2, easing:Elastic.easeOut});"/>
<page href="fl/transitions/Tween.html" title="Tween class" text="Tween The Tween class lets you use ActionScript to move, resize, and fade movie clips by specifying a property of the target movie clip to animate over a number of frames or seconds. The Tween class also lets you specify a variety of easing methods. &quot;Easing&quot; refers to gradual acceleration or deceleration during an animation, which helps your animations appear more realistic. The fl.transitions.easing package provides many easing methods that contain equations for this acceleration and deceleration, which change the easing animation accordingly. To use the methods and properties of the Tween class, you use the new operator with the constructor function to create an instance of the class, and you specify an easing method as a parameter. For example: import fl.transitions.Tween; import fl.transitions.easing.~~; var myTween:Tween = new Tween(myObject, &quot;x&quot;, Elastic.easeOut, 0, 300, 3, true);"/>
<page href="fl/transitions/Tween.html#Tween()" title="Tween.Tween()" text="Tween Creates an instance of the Tween class. Use the constructor function with the new operator: var myTween:Tween = new Tween(). obj prop func begin finish duration useSeconds Object that the Tween targets. Name of the property (obj parameter value) that will be affected. Name of the easing function to use. Starting value of the prop parameter. A number indicating the ending value of prop parameter (the target object property to be tweened). Length of time of the motion; set to infinity if negative or omitted. A flag specifying whether to use seconds instead of frames. The function uses seconds if true or frames in relation to the value specified in the duration parameter if false."/>
<page href="fl/transitions/Tween.html#continueTo()" title="Tween.continueTo()" text="continueTo Instructs the tweened animation to continue tweening from its current animation point to a new finish and duration point. finish duration A number indicating the ending value of the target object property that is to be tweened. A number indicating the length of time or number of frames for the tween motion; duration is measured in length of time if the Tween.start() useSeconds parameter is set to true, or measured in frames if it is set to false."/>
<page href="fl/transitions/Tween.html#fforward()" title="Tween.fforward()" text="fforward Forwards the tweened animation directly to the final value of the tweened animation."/>
<page href="fl/transitions/Tween.html#nextFrame()" title="Tween.nextFrame()" text="nextFrame Forwards the tweened animation to the next frame of an animation that was stopped. Use this method to forward a frame at a time of a tweened animation after you use the Tween.stop() method to stop it. Note: Use this method on frame-based tweens only. A tween is set to frame based at its creation by setting the useSeconds parameter to false."/>
<page href="fl/transitions/Tween.html#prevFrame()" title="Tween.prevFrame()" text="prevFrame Plays the previous frame of the tweened animation from the current stopping point of an animation that was stopped. Use this method to play a tweened animation backwards one frame at a time after you use the Tween.stop() method to stop it. Note: Use this method on frame-based tweens only. A tween is set to frame based at its creation by setting the Tween.start() useSeconds parameter to false."/>
<page href="fl/transitions/Tween.html#resume()" title="Tween.resume()" text="resume Resumes the play of a tweened animation that has been stopped. Use this method to continue a tweened animation after you have stopped it by using the Tween.stop() method. Note: Use this method on frame-based tweens only. A tween is set to be frame based at its creation by setting the useSeconds parameter to false."/>
<page href="fl/transitions/Tween.html#rewind()" title="Tween.rewind()" text="rewind Moves the play of a tweened animation back to its starting value. If Tween.rewind() is called while the tweened animation is still playing, the animation rewinds to its starting value and continues playing. If Tween.rewind() is called while the tweened animation has been stopped or has finished its animation, the tweened animation rewinds to its starting value and remains stopped. Use this method to rewind a tweened animation to its starting point after you have stopped it by using the Tween.stop() method or to rewind a tweened animation during its play. t Starting value."/>
<page href="fl/transitions/Tween.html#start()" title="Tween.start()" text="start Starts the play of a tweened animation from its starting point. This method is used for restarting a Tween from the beginning of its animation after it stops or has completed its animation."/>
<page href="fl/transitions/Tween.html#stop()" title="Tween.stop()" text="stop Stops the play of a tweened animation at its current value."/>
<page href="fl/transitions/Tween.html#yoyo()" title="Tween.yoyo()" text="yoyo Instructs the tweened animation to play in reverse from its last direction of tweened property increments. If this method is called before a Tween object's animation is complete, the animation abruptly jumps to the end of its play and then plays in a reverse direction from that point. You can achieve an effect of an animation completing its entire play and then reversing its entire play by calling the Tween.yoyo() method within a TweenEvent.MOTION_FINISH event handler. This process ensures that the reverse effect of the Tween.yoyo() method does not begin until the current tweened animation is complete."/>
<page href="fl/transitions/Tween.html#begin" title="Tween.begin" text="begin The initial value of the target object's designated property before the tween starts."/>
<page href="fl/transitions/Tween.html#duration" title="Tween.duration" text="duration The duration of the tweened animation in frames or seconds. This property is set as a parameter when creating a new Tween instance or when calling the Tween.yoyo() method."/>
<page href="fl/transitions/Tween.html#finish" title="Tween.finish" text="finish A number indicating the ending value of the target object property that is to be tweened. This property is set as a parameter when creating a new Tween instance or when calling the Tween.yoyo() method."/>
<page href="fl/transitions/Tween.html#FPS" title="Tween.FPS" text="FPS The number of frames per second calculated into the tweened animation. By default the current Stage frame rate is used to calculate the tweened animation. Setting this property recalculates the number of increments in the animated property that is displayed each second to the Tween.FPS property rather than the current Stage frame rate. Setting the Tween.FPS property does not change the actual frame rate of the Stage. Note: The Tween.FPS property returns undefined unless it is first set explicitly."/>
<page href="fl/transitions/Tween.html#func" title="Tween.func" text="func The easing function which is used with the tween."/>
<page href="fl/transitions/Tween.html#isPlaying" title="Tween.isPlaying" text="isPlaying Indicates whether the tween is currently playing."/>
<page href="fl/transitions/Tween.html#looping" title="Tween.looping" text="looping Indicates whether the tween will loop. If the value is true, the tween will restart indefinitely each time the tween has completed. If the value is false, the tween will play only once."/>
<page href="fl/transitions/Tween.html#obj" title="Tween.obj" text="obj The target object that is being tweened."/>
<page href="fl/transitions/Tween.html#position" title="Tween.position" text="position The current value of the target object property being tweened. This value updates with each drawn frame of the tweened animation."/>
<page href="fl/transitions/Tween.html#prop" title="Tween.prop" text="prop The name of the property affected by the tween of the target object."/>
<page href="fl/transitions/Tween.html#time" title="Tween.time" text="time The current time within the duration of the animation."/>
<page href="fl/transitions/Tween.html#useSeconds" title="Tween.useSeconds" text="useSeconds Indicates whether the tween plays over a period of frames or seconds. A value of true will cause the tween to animate over a period of seconds specified by the duration property. A value of false will cause the tween to animate over a period of frames."/>
<page href="fl/transitions/Tween.html#event:motionChange" title="Tween.motionChange" text="motionChange"/>
<page href="fl/transitions/Tween.html#event:motionFinish" title="Tween.motionFinish" text="motionFinish"/>
<page href="fl/transitions/Tween.html#event:motionLoop" title="Tween.motionLoop" text="motionLoop"/>
<page href="fl/transitions/Tween.html#event:motionResume" title="Tween.motionResume" text="motionResume"/>
<page href="fl/transitions/Tween.html#event:motionStart" title="Tween.motionStart" text="motionStart"/>
<page href="fl/transitions/Tween.html#event:motionStop" title="Tween.motionStop" text="motionStop"/>
<page href="fl/transitions/TransitionManager.html" title="TransitionManager class" text="TransitionManager The TransitionManager class defines animation effects. It allows you to apply one of ten animation effects to movie clips. When creating custom components, you can use the TransitionManager class to apply animation effects to movie clips in your component's visual interface. The transition effects in fl.transitions.easing are defined as a set of transition classes that all extend the base class fl.transitions.Transition. You apply transitions through an instance of a TransitionManager only; you do not instantiate them directly. The TransitionManager class implements animation events. You can create a TransitionManager instance in two ways: Call the TransitionManager.start() method. This is the simplest and recommended way to create a TransitionManager instance. Use the new operator. You then designate the transition properties and start the transition effect in a second step by calling the TransitionManager.startTransition() method."/>
<page href="fl/transitions/TransitionManager.html#TransitionManager()" title="TransitionManager.TransitionManager()" text="TransitionManager Constructor function for creating a new TransitionManager instance. However, the TransitionManager.start() method is a more efficient way of creating and implementing a TransitionManager instance. If you do use the TransitionManager constructor function to create an instance, use the new operator then designate the transition properties and start the transition effect in a second step by calling the TransitionManager.startTransition() method. For example: import fl.transitions.~~; import fl.transitions.easing.~~; var myTransitionManager:TransitionManager = new TransitionManager(myMovieClip); myTransitionManager.startTransition({type:Zoom, direction:Transition.IN, duration:1, easing:Bounce.easeOut}); content The MovieClip object to which to apply the transition effect."/>
<page href="fl/transitions/TransitionManager.html#start()" title="TransitionManager.start()" text="start Creates a new TransitionManager instance, designates the target object, applies a transition, and starts the transition. Specifically, calling this method creates an instance of the TransitionManager class if one does not already exist, creates an instance of the specified transition class designated in the transParams parameter, and then starts the transition. The transition is applied to the movie clip that is designated in the content parameter. For example: import fl.transitions.~~; import fl.transitions.easing.~~; TransitionManager.start(myMovieClip, {type:Zoom, direction:Transition.IN, duration:1, easing:Bounce.easeOut}); content transParams The MovieClip object to which to apply the transition effect. A collection of parameters that are passed within an object. The transParams object should contain a type parameter that indicates the transition effect class to be applied, followed by direction, duration, and easing parameters. In addition, you must include any parameters required by that transition effect class. For example, the fl.transitions.Iris transition effect class requires additional startPoint and shape parameters. So, in addition to the type, duration, and easing parameters that every transition requires, you would also add (to the transParams object) the startPoint and shape parameters that the fl.transitions.Iris effect requires."/>
<page href="fl/transitions/TransitionManager.html#startTransition()" title="TransitionManager.startTransition()" text="startTransition Creates a transition instance and starts it. If a matching transition already exists, the existing transition is removed and a new transition is created and started. This method is used in conjunction with the constructor function. For example: import fl.transitions.~~; import fl.transitions.easing.~~; var myTransitionManager:TransitionManager = new TransitionManager(myMovieClip); myTransitionManager.startTransition({type:Zoom, direction:Transition.IN, duration:1, easing:Bounce.easeOut}); Alternatively, you can use the TransitionManager.start() method, which is a more efficient way of implementing a transition effect. transParams A collection of parameters that are passed within an object. The transParams object should contain a type parameter that indicates the transition effect class to be applied, followed by direction, duration, and easing parameters. In addition, you must include any parameters required by that transition effect class. For example, the fl.transitions.Iris transition effect class requires additional startPoint and shape parameters. So, in addition to the type, duration, and easing parameters that every transition requires, you would also add (to the transParams object) the startPoint and shape parameters that the fl.transitions.Iris effect requires."/>
<page href="fl/transitions/TransitionManager.html#content" title="TransitionManager.content" text="content The movie clip instance to which TransitionManager is to apply a transition."/>
<page href="fl/transitions/TransitionManager.html#contentAppearance" title="TransitionManager.contentAppearance" text="contentAppearance An object that contains the saved visual properties of the content (target movie clip) to which the transitions will be applied."/>
<page href="fl/transitions/Fade.html" title="Fade class" text="Fade The Fade class fades the movie clip object in or out. This effect requires no additional parameters. For example, the following code uses the Fade transition for the movie clip instance img1_mc: import fl.transitions.~~; import fl.transitions.easing.~~; TransitionManager.start(img1_mc, {type:Fade, direction:Transition.IN, duration:9, easing:Strong.easeOut});"/>
<page href="fl/transitions/Squeeze.html" title="Squeeze class" text="Squeeze The Squeeze class scales the movie clip object horizontally or vertically. This effect requires the following parameters: dimension: An integer that indicates whether the Squeeze effect should be horizontal (0) or vertical (1). For example, the following code uses the Squeeze transition for the movie clip instance img1_mc: import fl.transitions.~~; import fl.transitions.easing.~~; TransitionManager.start(img1_mc, {type:Squeeze, direction:Transition.IN, duration:2, easing:Elastic.easeOut, dimension:1});"/>
<page href="fl/transitions/TweenEvent.html" title="TweenEvent class" text="TweenEvent The TweenEvent class represents events that are broadcast by the fl.transitions.Tween class."/>
<page href="fl/transitions/TweenEvent.html#TweenEvent()" title="TweenEvent.TweenEvent()" text="TweenEvent Constructor function for a TweenEvent object. type time position bubbles cancelable The event type; indicates the action that caused the event. The time within the duration of the animation. The frame of the tween. Specifies whether the event can bubble up the display list hierarchy. Specifies whether the behavior associated with the event can be prevented."/>
<page href="fl/transitions/TweenEvent.html#MOTION_CHANGE" title="TweenEvent.MOTION_CHANGE" text="MOTION_CHANGE Indicates that the Tween has changed and the screen has been updated. The properties of the event object have the following values: PropertyValue bubblesfalse cancelablefalse currentTargetThe object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget property. targetThe object that dispatched the event; it is not always the object listening for the event. Use the currentTarget property to always access the object listening for the event. timeThe time of the Tween when the event occurred. positionThe value of the property controlled by the Tween, when the event occurred."/>
<page href="fl/transitions/TweenEvent.html#MOTION_FINISH" title="TweenEvent.MOTION_FINISH" text="MOTION_FINISH Indicates that the Tween has reached the end and finished. The properties of the event object have the following values: PropertyValue bubblesfalse cancelablefalse currentTargetThe object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget property. targetThe object that dispatched the event; it is not always the object listening for the event. Use the currentTarget property to always access the object listening for the event. timeThe time of the Tween when the event occurred. positionThe value of the property controlled by the Tween, when the event occurred."/>
<page href="fl/transitions/TweenEvent.html#MOTION_LOOP" title="TweenEvent.MOTION_LOOP" text="MOTION_LOOP Indicates that the Tween has restarted playing from the beginning in looping mode. The properties of the event object have the following values: PropertyValue bubblesfalse cancelablefalse currentTargetThe object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget property. targetThe object that dispatched the event; it is not always the object listening for the event. Use the currentTarget property to always access the object listening for the event. timeThe time of the Tween when the event occurred. positionThe value of the property controlled by the Tween, when the event occurred."/>
<page href="fl/transitions/TweenEvent.html#MOTION_RESUME" title="TweenEvent.MOTION_RESUME" text="MOTION_RESUME Indicates that the Tween has resumed playing after being paused. The properties of the event object have the following values: PropertyValue bubblesfalse cancelablefalse currentTargetThe object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget property. targetThe object that dispatched the event; it is not always the object listening for the event. Use the currentTarget property to always access the object listening for the event. timeThe time of the Tween when the event occurred. positionThe value of the property controlled by the Tween, when the event occurred."/>
<page href="fl/transitions/TweenEvent.html#MOTION_START" title="TweenEvent.MOTION_START" text="MOTION_START Indicates that the motion has started playing. The properties of the event object have the following values: PropertyValue bubblesfalse cancelablefalse currentTargetThe object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget property. targetThe object that dispatched the event; it is not always the object listening for the event. Use the currentTarget property to always access the object listening for the event. timeThe time of the Tween when the event occurred. positionThe value of the property controlled by the Tween, when the event occurred."/>
<page href="fl/transitions/TweenEvent.html#MOTION_STOP" title="TweenEvent.MOTION_STOP" text="MOTION_STOP Indicates that the Tween has been stopped with an explicit call to Tween.stop(). The properties of the event object have the following values: PropertyValue bubblesfalse cancelablefalse currentTargetThe object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget property. targetThe object that dispatched the event; it is not always the object listening for the event. Use the currentTarget property to always access the object listening for the event. timeThe time of the Tween when the event occurred. positionThe value of the property controlled by the Tween, when the event occurred."/>
<page href="fl/transitions/TweenEvent.html#position" title="TweenEvent.position" text="position The value of the property controlled by the Tween, when the event occurred."/>
<page href="fl/transitions/TweenEvent.html#time" title="TweenEvent.time" text="time The time of the Tween when the event occurred."/>
<page href="fl/transitions/TweenEvent.html#event:motionChange" title="TweenEvent.motionChange" text="motionChange Indicates that the Tween has changed and the screen has been updated. The properties of the event object have the following values: PropertyValue bubblesfalse cancelablefalse currentTargetThe object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget property. targetThe object that dispatched the event; it is not always the object listening for the event. Use the currentTarget property to always access the object listening for the event. timeThe time of the Tween when the event occurred. positionThe value of the property controlled by the Tween, when the event occurred."/>
<page href="fl/transitions/TweenEvent.html#event:motionFinish" title="TweenEvent.motionFinish" text="motionFinish Indicates that the Tween has reached the end and finished. The properties of the event object have the following values: PropertyValue bubblesfalse cancelablefalse currentTargetThe object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget property. targetThe object that dispatched the event; it is not always the object listening for the event. Use the currentTarget property to always access the object listening for the event. timeThe time of the Tween when the event occurred. positionThe value of the property controlled by the Tween, when the event occurred."/>
<page href="fl/transitions/TweenEvent.html#event:motionLoop" title="TweenEvent.motionLoop" text="motionLoop Indicates that the Tween has restarted playing from the beginning in looping mode. The properties of the event object have the following values: PropertyValue bubblesfalse cancelablefalse currentTargetThe object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget property. targetThe object that dispatched the event; it is not always the object listening for the event. Use the currentTarget property to always access the object listening for the event. timeThe time of the Tween when the event occurred. positionThe value of the property controlled by the Tween, when the event occurred."/>
<page href="fl/transitions/TweenEvent.html#event:motionResume" title="TweenEvent.motionResume" text="motionResume Indicates that the Tween has resumed playing after being paused. The properties of the event object have the following values: PropertyValue bubblesfalse cancelablefalse currentTargetThe object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget property. targetThe object that dispatched the event; it is not always the object listening for the event. Use the currentTarget property to always access the object listening for the event. timeThe time of the Tween when the event occurred. positionThe value of the property controlled by the Tween, when the event occurred."/>
<page href="fl/transitions/TweenEvent.html#event:motionStart" title="TweenEvent.motionStart" text="motionStart Indicates that the motion has started playing. The properties of the event object have the following values: PropertyValue bubblesfalse cancelablefalse currentTargetThe object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget property. targetThe object that dispatched the event; it is not always the object listening for the event. Use the currentTarget property to always access the object listening for the event. timeThe time of the Tween when the event occurred. positionThe value of the property controlled by the Tween, when the event occurred."/>
<page href="fl/transitions/TweenEvent.html#event:motionStop" title="TweenEvent.motionStop" text="motionStop Indicates that the Tween has been stopped with an explicit call to Tween.stop(). The properties of the event object have the following values: PropertyValue bubblesfalse cancelablefalse currentTargetThe object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget property. targetThe object that dispatched the event; it is not always the object listening for the event. Use the currentTarget property to always access the object listening for the event. timeThe time of the Tween when the event occurred. positionThe value of the property controlled by the Tween, when the event occurred."/>
<page href="fl/transitions/PixelDissolve.html" title="PixelDissolve class" text="PixelDissolve The PixelDissolve class reveals reveals the movie clip object by using randomly appearing or disappearing rectangles in a checkerboard pattern. This effect requires the following parameters: xSections: An integer that indicates the number of masking rectangle sections along the horizontal axis. The recommended range is 1 to 50. ySections: An integer that indicates the number of masking rectangle sections along the vertical axis. The recommended range is 1 to 50. For example, the following code uses the PixelDissolve transition for the movie clip instance img1_mc: import fl.transitions.~~; import fl.transitions.easing.~~; TransitionManager.start(img1_mc, {type:PixelDissolve, direction:Transition.IN, duration:2, easing:Regular.easeIn, xSections:10, ySections:10});"/>
<page href="fl/transitions/Fly.html" title="Fly class" text="Fly The Fly class slides the movie clip object in from a specified direction. This effect requires the following parameters: startPoint: An integer indicating a starting position; the range is 1 to 9: Top Left:1; Top Center:2, Top Right:3; Left Center:4; Center:5; Right Center:6; Bottom Left:7; Bottom Center:8, Bottom Right:9. For example, the following code uses the Fly transition for the movie clip instance img1_mc: import fl.transitions.~~; import fl.transitions.easing.~~; TransitionManager.start(img1_mc, {type:Fly, direction:Transition.IN, duration:3, easing:Elastic.easeOut, startPoint:9});"/>
<page href="fl/transitions/Transition.html" title="Transition class" text="Transition The Transition class is the base class for all transition classes. You do not use or access this class directly. It allows transition-based classes to share some common behaviors and properties that are accessed by an instance of the TransitionManager class."/>
<page href="fl/transitions/Transition.html#direction" title="Transition.direction" text="direction Determines the easing direction for the Tween instance. Use one of the constants from the Transition class: Transition.IN or Transition.OUT."/>
<page href="fl/transitions/Transition.html#duration" title="Transition.duration" text="duration Determines the length of time for the Tween instance."/>
<page href="fl/transitions/Transition.html#easing" title="Transition.easing" text="easing Sets the tweening effect for the animation. Use one of the effects in the fl.transitions or fl.transitions.easing packages."/>
<page href="fl/transitions/Transition.html#IN" title="Transition.IN" text="IN Constant for the direction property that determines the type of easing."/>
<page href="fl/transitions/Transition.html#OUT" title="Transition.OUT" text="OUT Constant for the direction property that determines the type of easing."/>
<page href="fl/transitions/Photo.html" title="Photo class" text="Photo Makes the movie clip object appear or disappear like a photographic flash. This effect requires no additional parameters. For example, the following code uses the Photo transition for the movie clip instance img1_mc: import fl.transitions.~~; import fl.transitions.easing.~~; TransitionManager.start (img1_mc, {type:Photo, direction:Transition.IN, duration:1, easing:None.easeNone});"/>
<page href="fl/transitions/Wipe.html" title="Wipe class" text="Wipe The Wipe class reveals or hides the movie clip object by using an animated mask of a shape that moves horizontally. This effect requires the following parameter: startPoint: An integer indicating a starting position; the range is 1 to 9: Top Left:1; Top Center:2, Top Right:3; Left Center:4; Center:5; Right Center:6; Bottom Left:7; Bottom Center:8, Bottom Right:9. For example, the following code uses the Wipe transition for the movie clip instance img1_mc: import fl.transitions.~~; import fl.transitions.easing.~~; TransitionManager.start(img1_mc, {type:Wipe, direction:Transition.IN, duration:2, easing:None.easeNone, startPoint:1});"/>
<page href="fl/transitions/easing/None.html" title="None class" text="None The None class defines easing functions to implement nonaccelerated motion with ActionScript animations. Its methods all produce the same effect, a constant motion. The various names, easeIn, easeOut and so on are provided in the interest of polymorphism. The None class is identical to the fl.motion.easing.Linear class in functionality."/>
<page href="fl/transitions/easing/None.html#easeIn()" title="None.easeIn()" text="easeIn The easeIn() method defines a constant motion, with no acceleration. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion. This example animates a rectangle using the None.easeIn easing function: import fl.transitions.*; import fl.transitions.easing.*; stage.frameRate = 31; var box:Sprite = new Sprite(); box.graphics.beginFill(Math.random() * 0xFFFFFF); box.graphics.drawRect(0, 0, 100, 350); box.graphics.endFill(); box.x = 50; box.y = 10; addChild(box); var startValue:Number = box.x; var finishValue:Number = 400; var duration:Number = 3; var myTween:Tween = new Tween(box, &quot;x&quot;, None.easeIn, startValue, finishValue, duration, true); myTween.looping = true;"/>
<page href="fl/transitions/easing/None.html#easeInOut()" title="None.easeInOut()" text="easeInOut The easeInOut() method defines a constant motion, with no acceleration. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion. This example animates a rectangle using the None.easeInOut easing function: import fl.transitions.*; import fl.transitions.easing.*; stage.frameRate = 31; var box:Sprite = new Sprite(); box.graphics.beginFill(Math.random() * 0xFFFFFF); box.graphics.drawRect(0, 0, 100, 350); box.graphics.endFill(); box.x = 50; box.y = 10; addChild(box); var startValue:Number = box.x; var finishValue:Number = 400; var duration:Number = 3; var myTween:Tween = new Tween(box, &quot;x&quot;, None.easeInOut, startValue, finishValue, duration, true); myTween.looping = true;"/>
<page href="fl/transitions/easing/None.html#easeNone()" title="None.easeNone()" text="easeNone The easeNone() method defines a constant motion, with no acceleration. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion."/>
<page href="fl/transitions/easing/None.html#easeOut()" title="None.easeOut()" text="easeOut The easeOut() method defines a constant motion, with no acceleration. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion. This example animates a rectangle using the None.easeOut easing function: import fl.transitions.*; import fl.transitions.easing.*; stage.frameRate = 31; var box:Sprite = new Sprite(); box.graphics.beginFill(Math.random() * 0xFFFFFF); box.graphics.drawRect(0, 0, 100, 350); box.graphics.endFill(); box.x = 50; box.y = 10; addChild(box); var startValue:Number = box.x; var finishValue:Number = 400; var duration:Number = 3; var myTween:Tween = new Tween(box, &quot;x&quot;, None.easeOut, startValue, finishValue, duration, true); myTween.looping = true;"/>
<page href="fl/transitions/easing/Elastic.html" title="Elastic class" text="Elastic The Elastic class defines three easing functions to implement motion with ActionScript animation, where the motion is defined by an exponentially decaying sine wave."/>
<page href="fl/transitions/easing/Elastic.html#easeIn()" title="Elastic.easeIn()" text="easeIn The easeIn() method starts motion slowly and then accelerates motion as it executes. t b c d a p Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion. Specifies the amplitude of the sine wave. Specifies the period of the sine wave. This example animates a rectangle using the Elastic.easeIn easing function: import fl.transitions.*; import fl.transitions.easing.*; stage.frameRate = 31; var box:Sprite = new Sprite(); box.graphics.beginFill(Math.random() * 0xFFFFFF); box.graphics.drawRect(0, 0, 100, 350); box.graphics.endFill(); box.x = 50; box.y = 10; addChild(box); var startValue:Number = box.x; var finishValue:Number = 400; var duration:Number = 3; var myTween:Tween = new Tween(box, &quot;x&quot;, Elastic.easeIn, startValue, finishValue, duration, true); myTween.looping = true;"/>
<page href="fl/transitions/easing/Elastic.html#easeInOut()" title="Elastic.easeInOut()" text="easeInOut The easeInOut() method combines the motion of the easeIn() and easeOut() methods to start the motion slowly, accelerate motion, then decelerate. t b c d a p Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion. Specifies the amplitude of the sine wave. Specifies the period of the sine wave. This example animates a rectangle using the Elastic.easeInOut easing function: import fl.transitions.*; import fl.transitions.easing.*; stage.frameRate = 31; var box:Sprite = new Sprite(); box.graphics.beginFill(Math.random() * 0xFFFFFF); box.graphics.drawRect(0, 0, 100, 350); box.graphics.endFill(); box.x = 50; box.y = 10; addChild(box); var startValue:Number = box.x; var finishValue:Number = 400; var duration:Number = 3; var myTween:Tween = new Tween(box, &quot;x&quot;, Elastic.easeInOut, startValue, finishValue, duration, true); myTween.looping = true;"/>
<page href="fl/transitions/easing/Elastic.html#easeOut()" title="Elastic.easeOut()" text="easeOut The easeOut() method starts motion fast and then decelerates motion as it executes. t b c d a p Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion. Specifies the amplitude of the sine wave. Specifies the period of the sine wave. This example animates a rectangle using the Elastic.easeOut easing function: import fl.transitions.*; import fl.transitions.easing.*; stage.frameRate = 31; var box:Sprite = new Sprite(); box.graphics.beginFill(Math.random() * 0xFFFFFF); box.graphics.drawRect(0, 0, 100, 350); box.graphics.endFill(); box.x = 50; box.y = 10; addChild(box); var startValue:Number = box.x; var finishValue:Number = 400; var duration:Number = 3; var myTween:Tween = new Tween(box, &quot;x&quot;, Elastic.easeOut, startValue, finishValue, duration, true); myTween.looping = true;"/>
<page href="fl/transitions/easing/Bounce.html" title="Bounce class" text="Bounce The Bounce class defines three easing functions to implement bouncing motion with ActionScript animation, similar to a ball falling and bouncing on a floor with several decaying rebounds."/>
<page href="fl/transitions/easing/Bounce.html#easeIn()" title="Bounce.easeIn()" text="easeIn The easeIn() method starts the bounce motion slowly and then accelerates motion as it executes. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion. This example animates a rectangle using the Bounce.easeIn easing function: import fl.transitions.*; import fl.transitions.easing.*; stage.frameRate = 31; var box:Sprite = new Sprite(); box.graphics.beginFill(Math.random() * 0xFFFFFF); box.graphics.drawRect(0, 0, 100, 350); box.graphics.endFill(); box.x = 50; box.y = 10; addChild(box); var startValue:Number = box.x; var finishValue:Number = 400; var duration:Number = 3; var myTween:Tween = new Tween(box, &quot;x&quot;, Bounce.easeIn, startValue, finishValue, duration, true); myTween.looping = true;"/>
<page href="fl/transitions/easing/Bounce.html#easeInOut()" title="Bounce.easeInOut()" text="easeInOut The easeInOut() method combines the motion of the easeIn() and easeOut() methods to start the bounce motion slowly, accelerate motion, then decelerate. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion. This example animates a rectangle using the Bounce.easeInOut easing function: import fl.transitions.*; import fl.transitions.easing.*; stage.frameRate = 31; var box:Sprite = new Sprite(); box.graphics.beginFill(Math.random() * 0xFFFFFF); box.graphics.drawRect(0, 0, 100, 350); box.graphics.endFill(); box.x = 50; box.y = 10; addChild(box); var startValue:Number = box.x; var finishValue:Number = 400; var duration:Number = 3; var myTween:Tween = new Tween(box, &quot;x&quot;, Bounce.easeInOut, startValue, finishValue, duration, true); myTween.looping = true;"/>
<page href="fl/transitions/easing/Bounce.html#easeOut()" title="Bounce.easeOut()" text="easeOut The easeOut() method starts the bounce motion fast and then decelerates motion as it executes. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion. This example animates a rectangle using the Bounce.easeOut easing function: import fl.transitions.*; import fl.transitions.easing.*; stage.frameRate = 31; var box:Sprite = new Sprite(); box.graphics.beginFill(Math.random() * 0xFFFFFF); box.graphics.drawRect(0, 0, 100, 350); box.graphics.endFill(); box.x = 50; box.y = 10; addChild(box); var startValue:Number = box.x; var finishValue:Number = 400; var duration:Number = 3; var myTween:Tween = new Tween(box, &quot;x&quot;, Bounce.easeOut, startValue, finishValue, duration, true); myTween.looping = true;"/>
<page href="fl/transitions/easing/Regular.html" title="Regular class" text="Regular The Regular class defines three easing functions to implement accelerated motion with ActionScript animations. The acceleration of motion for a Regular easing equation is the same as for a timeline tween at 100% easing and is less dramatic than for the Strong easing equation. The Regular class is identical to the fl.motion.easing.Quadratic class in functionality."/>
<page href="fl/transitions/easing/Regular.html#easeIn()" title="Regular.easeIn()" text="easeIn The easeIn() method starts motion from a zero velocity and then accelerates motion as it executes. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion. This example animates a rectangle using the Regular.easeIn easing function: import fl.transitions.*; import fl.transitions.easing.*; stage.frameRate = 31; var box:Sprite = new Sprite(); box.graphics.beginFill(Math.random() * 0xFFFFFF); box.graphics.drawRect(0, 0, 100, 350); box.graphics.endFill(); box.x = 50; box.y = 10; addChild(box); var startValue:Number = box.x; var finishValue:Number = 400; var duration:Number = 3; var myTween:Tween = new Tween(box, &quot;x&quot;, Regular.easeIn, startValue, finishValue, duration, true); myTween.looping = true;"/>
<page href="fl/transitions/easing/Regular.html#easeInOut()" title="Regular.easeInOut()" text="easeInOut The easeInOut() method combines the motion of the easeIn() and easeOut() methods to start the motion from a zero velocity, accelerate motion, then decelerate to a zero velocity. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion. This example animates a rectangle using the Regular.easeInOut easing function: import fl.transitions.*; import fl.transitions.easing.*; stage.frameRate = 31; var box:Sprite = new Sprite(); box.graphics.beginFill(Math.random() * 0xFFFFFF); box.graphics.drawRect(0, 0, 100, 350); box.graphics.endFill(); box.x = 50; box.y = 10; addChild(box); var startValue:Number = box.x; var finishValue:Number = 400; var duration:Number = 3; var myTween:Tween = new Tween(box, &quot;x&quot;, Regular.easeInOut, startValue, finishValue, duration, true); myTween.looping = true;"/>
<page href="fl/transitions/easing/Regular.html#easeOut()" title="Regular.easeOut()" text="easeOut The easeOut() method starts motion fast and then decelerates motion to a zero velocity as it executes. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion. This example animates a rectangle using the Regular.easeOut easing function: import fl.transitions.*; import fl.transitions.easing.*; stage.frameRate = 31; var box:Sprite = new Sprite(); box.graphics.beginFill(Math.random() * 0xFFFFFF); box.graphics.drawRect(0, 0, 100, 350); box.graphics.endFill(); box.x = 50; box.y = 10; addChild(box); var startValue:Number = box.x; var finishValue:Number = 400; var duration:Number = 3; var myTween:Tween = new Tween(box, &quot;x&quot;, Regular.easeOut, startValue, finishValue, duration, true); myTween.looping = true;"/>
<page href="fl/transitions/easing/Strong.html" title="Strong class" text="Strong The Strong class defines three easing functions to implement motion with ActionScript animation. The acceleration of motion for a Strong easing equation is greater than for a Regular easing equation. The Strong class is identical to the fl.motion.easing.Quintic class in functionality."/>
<page href="fl/transitions/easing/Strong.html#easeIn()" title="Strong.easeIn()" text="easeIn The easeIn() method starts motion from zero velocity and then accelerates motion as it executes. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion. This example animates a rectangle using the Strong.easeIn easing function: import fl.transitions.*; import fl.transitions.easing.*; stage.frameRate = 31; var box:Sprite = new Sprite(); box.graphics.beginFill(Math.random() * 0xFFFFFF); box.graphics.drawRect(0, 0, 100, 350); box.graphics.endFill(); box.x = 50; box.y = 10; addChild(box); var startValue:Number = box.x; var finishValue:Number = 400; var duration:Number = 3; var myTween:Tween = new Tween(box, &quot;x&quot;, Strong.easeIn, startValue, finishValue, duration, true); myTween.looping = true;"/>
<page href="fl/transitions/easing/Strong.html#easeInOut()" title="Strong.easeInOut()" text="easeInOut The easeInOut() method combines the motion of the easeIn() and easeOut() methods to start the motion from a zero velocity, accelerate motion, then decelerate to a zero velocity. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion. This example animates a rectangle using the Strong.easeInOut easing function: import fl.transitions.*; import fl.transitions.easing.*; stage.frameRate = 31; var box:Sprite = new Sprite(); box.graphics.beginFill(Math.random() * 0xFFFFFF); box.graphics.drawRect(0, 0, 100, 350); box.graphics.endFill(); box.x = 50; box.y = 10; addChild(box); var startValue:Number = box.x; var finishValue:Number = 400; var duration:Number = 3; var myTween:Tween = new Tween(box, &quot;x&quot;, Strong.easeInOut, startValue, finishValue, duration, true); myTween.looping = true;"/>
<page href="fl/transitions/easing/Strong.html#easeOut()" title="Strong.easeOut()" text="easeOut The easeOut() method starts motion fast and then decelerates motion to a zero velocity as it executes. t b c d Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion. This example animates a rectangle using the Strong.easeOut easing function: import fl.transitions.*; import fl.transitions.easing.*; stage.frameRate = 31; var box:Sprite = new Sprite(); box.graphics.beginFill(Math.random() * 0xFFFFFF); box.graphics.drawRect(0, 0, 100, 350); box.graphics.endFill(); box.x = 50; box.y = 10; addChild(box); var startValue:Number = box.x; var finishValue:Number = 400; var duration:Number = 3; var myTween:Tween = new Tween(box, &quot;x&quot;, Strong.easeOut, startValue, finishValue, duration, true); myTween.looping = true;"/>
<page href="fl/transitions/easing/Back.html" title="Back class" text="Back The Back class defines three easing functions to implement motion with ActionScript animations."/>
<page href="fl/transitions/easing/Back.html#easeIn()" title="Back.easeIn()" text="easeIn The easeIn() method starts the motion by backtracking and then reversing direction and moving toward the target. t b c d s Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion. Specifies the amount of overshoot, where the higher the value, the greater the overshoot. This example animates a rectangle using the Back.easeIn easing function: import fl.transitions.*; import fl.transitions.easing.*; stage.frameRate = 31; var box:Sprite = new Sprite(); box.graphics.beginFill(Math.random() * 0xFFFFFF); box.graphics.drawRect(0, 0, 100, 350); box.graphics.endFill(); box.x = 50; box.y = 10; addChild(box); var startValue:Number = box.x; var finishValue:Number = 400; var duration:Number = 3; var myTween:Tween = new Tween(box, &quot;x&quot;, Back.easeIn, startValue, finishValue, duration, true); myTween.looping = true;"/>
<page href="fl/transitions/easing/Back.html#easeInOut()" title="Back.easeInOut()" text="easeInOut The easeInOut() method combines the motion of the easeIn() and easeOut() methods to start the motion by backtracking, then reversing direction and moving toward the target, overshooting the target slightly, reversing direction again, and then moving back toward the target. t b c d s Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion. Specifies the amount of overshoot, where the higher the value, the greater the overshoot. This example animates a rectangle using the Back.easeInOut easing function: import fl.transitions.*; import fl.transitions.easing.*; stage.frameRate = 31; var box:Sprite = new Sprite(); box.graphics.beginFill(Math.random() * 0xFFFFFF); box.graphics.drawRect(0, 0, 100, 350); box.graphics.endFill(); box.x = 50; box.y = 10; addChild(box); var startValue:Number = box.x; var finishValue:Number = 400; var duration:Number = 3; var myTween:Tween = new Tween(box, &quot;x&quot;, Back.easeInOut, startValue, finishValue, duration, true); myTween.looping = true;"/>
<page href="fl/transitions/easing/Back.html#easeOut()" title="Back.easeOut()" text="easeOut The easeOut() method starts the motion by moving towards the target, overshooting it slightly, and then reversing direction back toward the target. t b c d s Specifies the current time, between 0 and duration inclusive. Specifies the initial value of the animation property. Specifies the total change in the animation property. Specifies the duration of the motion. Specifies the amount of overshoot, where the higher the value, the greater the overshoot. This example animates a rectangle using the Back.easeOut easing function: import fl.transitions.*; import fl.transitions.easing.*; stage.frameRate = 31; var box:Sprite = new Sprite(); box.graphics.beginFill(Math.random() * 0xFFFFFF); box.graphics.drawRect(0, 0, 100, 350); box.graphics.endFill(); box.x = 50; box.y = 10; addChild(box); var startValue:Number = box.x; var finishValue:Number = 400; var duration:Number = 3; var myTween:Tween = new Tween(box, &quot;x&quot;, Back.easeOut, startValue, finishValue, duration, true); myTween.looping = true;"/>
<page href="fl/accessibility/DataGridAccImpl.html" title="DataGridAccImpl class" text="DataGridAccImpl The DataGridAccImpl class, also called the DataGrid Accessibility Implementation class, is used to make a DataGrid component accessible. The DataGridAccImpl class supports system roles, object-based events, and states. A DataGrid reports the role ROLE_SYSTEM_LIST (0x21) to a screen reader. Items of a DataGrid report the role ROLE_SYSTEM_LISTITEM (0x22). A DataGrid reports the following states to a screen reader: STATE_SYSTEM_NORMAL (0x00000000) STATE_SYSTEM_UNAVAILABLE (0x00000001) STATE_SYSTEM_FOCUSED (0x00000004) STATE_SYSTEM_FOCUSABLE (0x00100000) Additionally, items of a DataGrid report the following states: STATE_SYSTEM_SELECTED (0x00000002) STATE_SYSTEM_FOCUSED (0x00000004) STATE_SYSTEM_INVISIBLE (0x00008000) STATE_SYSTEM_OFFSCREEN (0x00010000) STATE_SYSTEM_SELECTABLE (0x00200000) A DataGrid dispatches the following events to a screen reader: EVENT_OBJECT_FOCUS (0x8005) EVENT_OBJECT_SELECTION (0x8006) EVENT_OBJECT_STATECHANGE (0x800A) EVENT_OBJECT_NAMECHANGE (0x800C)"/>
<page href="fl/accessibility/DataGridAccImpl.html#enableAccessibility()" title="DataGridAccImpl.enableAccessibility()" text="enableAccessibility Enables accessibility for a DataGrid component. This method is required for the compiler to activate the accessibility classes for a component."/>
<page href="fl/accessibility/SelectableListAccImpl.html" title="SelectableListAccImpl class" text="SelectableListAccImpl The SelectableListAccImpl class, also called the SelectableList Accessibility Implementation class, is used to make a SelectableList component accessible."/>
<page href="fl/accessibility/SelectableListAccImpl.html#enableAccessibility()" title="SelectableListAccImpl.enableAccessibility()" text="enableAccessibility Enables accessibility for a SelectableList component. This method is required for the compiler to activate the accessibility classes for a component."/>
<page href="fl/accessibility/UIComponentAccImpl.html" title="UIComponentAccImpl class" text="UIComponentAccImpl The UIComponentAccImpl class, also called the UIComponent Accessibility Implementation class, is used to make a UIComponent accessible. This class enables communication between a List-based component and a screen reader. Screen readers are used to translate screen content into synthesized speech or braille for visually impaired users. The ListAccImpl class supports system roles, object-based events, and states."/>
<page href="fl/accessibility/UIComponentAccImpl.html#enableAccessibility()" title="UIComponentAccImpl.enableAccessibility()" text="enableAccessibility Enables accessibility for a UIComponent component. This method is required for the compiler to activate the accessibility classes for a component."/>
<page href="fl/accessibility/LabelButtonAccImpl.html" title="LabelButtonAccImpl class" text="LabelButtonAccImpl The LabelButtonAccImpl class, also called the LabelButton Accessibility Implementation class, is used to make a LabelButton component accessible. This class enables communication between a LabelButton component and a screen reader. Screen readers are used to translate screen content into synthesized speech or braille for visually impaired users. The LabelButtonAccImpl class supports system roles, object-based events, and states. A LabelButton reports the role ROLE_SYSTEM_PUSHBUTTON (0x2B) to a screen reader. A LabelButton reports the following states to a screen reader: STATE_SYSTEM_NORMAL (0x00000000) STATE_SYSTEM_UNAVAILABLE (0x00000001) STATE_SYSTEM_FOCUSED (0x00000004) STATE_SYSTEM_PRESSED (0x00000008) STATE_SYSTEM_FOCUSABLE (0x00100000) A LabelButton dispatches the following events to a screen reader: EVENT_OBJECT_STATECHANGE (0x800A) EVENT_OBJECT_NAMECHANGE (0x800C)"/>
<page href="fl/accessibility/LabelButtonAccImpl.html#enableAccessibility()" title="LabelButtonAccImpl.enableAccessibility()" text="enableAccessibility Enables accessibility for a LabelButton component. This method is required for the compiler to activate the accessibility classes for a component."/>
<page href="fl/accessibility/TileListAccImpl.html" title="TileListAccImpl class" text="TileListAccImpl The TileListAccImpl class, also called the Tile List Accessibility Implementation class, is used to make a TileList component accessible. This class enables communication between a TileList component and a screen reader. Screen readers are used to translate screen content into synthesized speech or braille for visually impaired users. The TileListAccImpl class supports system roles, object-based events, and states. A TileList reports the role ROLE_SYSTEM_LIST (0x21) to a screen reader. Items of a TileList report the role ROLE_SYSTEM_LISTITEM (0x22). A TileList reports the following states to a screen reader: STATE_SYSTEM_NORMAL (0x00000000) STATE_SYSTEM_UNAVAILABLE (0x00000001) STATE_SYSTEM_FOCUSED (0x00000004) STATE_SYSTEM_FOCUSABLE (0x00100000) Additionally, items of a TileList report the following states: STATE_SYSTEM_SELECTED (0x00000002) STATE_SYSTEM_FOCUSED (0x00000004) STATE_SYSTEM_INVISIBLE (0x00008000) STATE_SYSTEM_OFFSCREEN (0x00010000) STATE_SYSTEM_SELECTABLE (0x00200000) A TileList dispatches the following events to a screen reader: EVENT_OBJECT_FOCUS (0x8005) EVENT_OBJECT_SELECTION (0x8006) EVENT_OBJECT_STATECHANGE (0x800A) EVENT_OBJECT_NAMECHANGE (0x800C)"/>
<page href="fl/accessibility/TileListAccImpl.html#enableAccessibility()" title="TileListAccImpl.enableAccessibility()" text="enableAccessibility Enables accessibility for a TileList component. This method is required for the compiler to activate the accessibility classes for a component."/>
<page href="fl/accessibility/RadioButtonAccImpl.html" title="RadioButtonAccImpl class" text="RadioButtonAccImpl The RadioButtonAccImpl class, also called the RadioButton Accessibility Implementation class, is used to make a RadioButton component accessible. This class enables communication between a RadioButton component and a screen reader. Screen readers are used to translate screen content into synthesized speech or braille for visually impaired users. The RadioButtonAccImpl class supports system roles, object-based events, and states. A RadioButton reports the role ROLE_SYSTEM_RADIOBUTTON (0x2D) to a screen reader. A RadioButton reports the following states to a screen reader: STATE_SYSTEM_NORMAL (0x00000000) STATE_SYSTEM_UNAVAILABLE (0x00000001) STATE_SYSTEM_FOCUSED (0x00000004) STATE_SYSTEM_PRESSED (0x00000008) STATE_SYSTEM_CHECKED (0x00000010) STATE_SYSTEM_FOCUSABLE (0x00100000) A RadioButton dispatches the following events to a screen reader: EVENT_OBJECT_STATECHANGE (0x800A) EVENT_OBJECT_NAMECHANGE (0x800C)"/>
<page href="fl/accessibility/RadioButtonAccImpl.html#enableAccessibility()" title="RadioButtonAccImpl.enableAccessibility()" text="enableAccessibility Enables accessibility for a RadioButton component. This method is required for the compiler to activate the accessibility classes for a component."/>
<page href="fl/accessibility/CheckBoxAccImpl.html" title="CheckBoxAccImpl class" text="CheckBoxAccImpl The CheckBoxAccImpl class, also called the CheckBox Accessibility Implementation class, is used to make a CheckBox component accessible. This class enables communication between a CheckBox component and a screen reader. Screen readers are used to translate screen content into synthesized speech or braille for visually impaired users. The CheckBoxAccImpl class supports system roles, object-based events, and states. A CheckBox reports the role ROLE_SYSTEM_CHECKBUTTON (0x2C) to a screen reader. A CheckBox reports the following states to a screen reader: STATE_SYSTEM_NORMAL (0x00000000) STATE_SYSTEM_UNAVAILABLE (0x00000001) STATE_SYSTEM_FOCUSED (0x00000004) STATE_SYSTEM_PRESSED (0x00000008) STATE_SYSTEM_CHECKED (0x00000010) STATE_SYSTEM_FOCUSABLE (0x00100000) A CheckBox dispatches the following events to a screen reader: EVENT_OBJECT_STATECHANGE (0x800A) EVENT_OBJECT_NAMECHANGE (0x800C) Screen reader users can activate a Checkbox component with the spacebar or the Enter key."/>
<page href="fl/accessibility/CheckBoxAccImpl.html#enableAccessibility()" title="CheckBoxAccImpl.enableAccessibility()" text="enableAccessibility Enables accessibility for a CheckBox component. This method is required for the compiler to activate the accessibility classes for a component."/>
<page href="fl/accessibility/ListAccImpl.html" title="ListAccImpl class" text="ListAccImpl The ListAccImpl class, also called the List Accessiblity Implementation class, is used to make a List component accessible. The ListAccImpl class supports system roles, object-based events, and states. A List reports the role ROLE_SYSTEM_LIST (0x21) to a screen reader. Items of a List report the role ROLE_SYSTEM_LISTITEM (0x22). A List reports the following states to a screen reader: STATE_SYSTEM_NORMAL (0x00000000) STATE_SYSTEM_UNAVAILABLE (0x00000001) STATE_SYSTEM_FOCUSED (0x00000004) STATE_SYSTEM_FOCUSABLE (0x00100000) Additionally, items of a List report the following states: STATE_SYSTEM_SELECTED (0x00000002) STATE_SYSTEM_FOCUSED (0x00000004) STATE_SYSTEM_INVISIBLE (0x00008000) STATE_SYSTEM_OFFSCREEN (0x00010000) STATE_SYSTEM_SELECTABLE (0x00200000) A List dispatches the following events to a screen reader: EVENT_OBJECT_FOCUS (0x8005) EVENT_OBJECT_SELECTION (0x8006) EVENT_OBJECT_STATECHANGE (0x800A) EVENT_OBJECT_NAMECHANGE (0x800C)"/>
<page href="fl/accessibility/ListAccImpl.html#enableAccessibility()" title="ListAccImpl.enableAccessibility()" text="enableAccessibility Enables accessibility for a List component. This method is required for the compiler to activate the accessibility classes for a component."/>
<page href="fl/accessibility/AccImpl.html" title="AccImpl class" text="AccImpl The AccImpl class, also called the Accessibility Implementation class, is the base class for the implementation of accessibility in components. This class enables communication between a component and a screen reader. Screen readers are used to translate screen content into synthesized speech or braille for visually impaired users."/>
<page href="fl/accessibility/AccImpl.html#enableAccessibility()" title="AccImpl.enableAccessibility()" text="enableAccessibility Enables accessibility for a component. This method is required for the compiler to activate the accessibility classes for a component."/>
<page href="fl/accessibility/ButtonAccImpl.html" title="ButtonAccImpl class" text="ButtonAccImpl The ButtonAccImpl class, also called the Button Accessibility Implementation class, enables communication between a Button component and a screen reader. Screen readers are used to translate screen content into synthesized speech or braille for visually impaired users. The ButtonAccImpl class supports system roles, object-based events, and states. A Button reports the role ROLE_SYSTEM_PUSHBUTTON (0x2B) to a screen reader. A Button reports the following states to a screen reader: STATE_SYSTEM_NORMAL (0x00000000) STATE_SYSTEM_UNAVAILABLE (0x00000001) STATE_SYSTEM_FOCUSED (0x00000004) STATE_SYSTEM_PRESSED (0x00000008) STATE_SYSTEM_FOCUSABLE (0x00100000) A Button dispatches the following events to a screen reader: EVENT_OBJECT_STATECHANGE (0x800A) EVENT_OBJECT_NAMECHANGE (0x800C) The user of a screen reader can activate a button component by using the spacebar or the Enter key."/>
<page href="fl/accessibility/ButtonAccImpl.html#enableAccessibility()" title="ButtonAccImpl.enableAccessibility()" text="enableAccessibility Enables accessibility for a Button component. This method is required for the compiler to activate the accessibility classes for a component."/>
<page href="fl/accessibility/ComboBoxAccImpl.html" title="ComboBoxAccImpl class" text="ComboBoxAccImpl The ComboBoxAccImpl class, also called the ComboBox Accessibility Implementation class, is used to make a ComboBox component accessible. The ComboBoxAccImpl class supports system roles, object-based events, and states. A ComboBox reports the role ROLE_SYSTEM_COMBOBOX (0x2E) to a screen reader. Items of a ComboBox report the role ROLE_SYSTEM_LISTITEM (0x22). A ComboBox reports the following states to a screen reader: STATE_SYSTEM_NORMAL (0x00000000) STATE_SYSTEM_UNAVAILABLE (0x00000001) STATE_SYSTEM_FOCUSED (0x00000004) STATE_SYSTEM_PRESSED (0x00000008) STATE_SYSTEM_CHECKED (0x00000010) STATE_SYSTEM_FOCUSABLE (0x00100000) Additionally, items of a ComboBox report the following states: STATE_SYSTEM_SELECTED (0x00000002) STATE_SYSTEM_SELECTABLE (0x00200000) A ComboBox dispatches the following events to a screen reader: EVENT_OBJECT_SELECTION (0x8006) EVENT_OBJECT_STATECHANGE (0x800A) EVENT_OBJECT_NAMECHANGE (0x800C) EVENT_OBJECT_VALUECHANGE (0x800E)"/>
<page href="fl/accessibility/ComboBoxAccImpl.html#enableAccessibility()" title="ComboBoxAccImpl.enableAccessibility()" text="enableAccessibility Enables accessibility for a ComboBox component. This method is required for the compiler to activate the accessibility classes for a component."/>
<page href="flash/accessibility/Accessibility.html" title="Accessibility class" text="Accessibility The Accessibility class manages communication with screen readers. Screen readers are a type of assistive technology for visually impaired users that provides an audio version of screen content. The methods of the Accessibility class are static—that is, you don't have to create an instance of the class to use its methods. To get and set accessible properties for a specific object, such as a button, movie clip, or text field, use the DisplayObject.accessibilityProperties property. To determine whether the player is running in an environment that supports accessibility aids, use the Capabilities.hasAccessibility property."/>
<page href="flash/accessibility/Accessibility.html#updateProperties()" title="Accessibility.updateProperties()" text="updateProperties Tells Flash Player to apply any accessibility changes made by using the DisplayObject.accessibilityProperties property. You need to call this method for your changes to take effect. If you modify the accessibility properties for multiple objects, only one call to the Accessibility.updateProperties() method is necessary; multiple calls can result in reduced performance and erroneous screen reader output. Accessibility is not supported in this version of Flash Player. Do not call the Accessibility.updateProperties() method if the flash.system.Capabilities.hasAccessibility property is false."/>
<page href="flash/accessibility/Accessibility.html#active" title="Accessibility.active" text="active Indicates whether a screen reader is currently active and the player is communicating with it. Use this method when you want your application to behave differently in the presence of a screen reader. Note: If you call this method within 1 or 2 seconds of the first appearance of the Flash® window in which your document is playing, you might get a return value of false even if there is an active accessibility client. This happens because of an asynchronous communication mechanism between Flash and accessibility clients. You can work around this limitation by ensuring a delay of 1 to 2 seconds after loading your document before calling this method. To determine whether the player is running in an environment that supports screen readers, use the Capabilities.hasAccessibility property."/>
<page href="flash/accessibility/AccessibilityProperties.html" title="AccessibilityProperties class" text="AccessibilityProperties The AccessibilityProperties class lets you control the presentation of Flash objects to accessibility aids, such as screen readers. You can attach an AccessibilityProperties object to any display object, but Flash Player will read your AccessibilityProperties object only for certain kinds of objects: entire SWF files (as represented by DisplayObject.root), container objects (DisplayObjectContainer and subclasses), buttons (SimpleButton and subclasses), and text (TextField and subclasses). The name property of these objects is the most important property to specify because accessibility aids provide the names of objects to users as a basic means of navigation. Do not confuse AccessibilityProperties.name with DisplayObject.name; these are separate and unrelated. The AccessibilityProperties.name property is a name that is read aloud by the accessibility aids, whereas DisplayObject.name is essentially a variable name visible only to ActionScript code. The properties of AccessibilityProperties objects override the corresponding settings available in the Accessibility panel during authoring. To determine whether Flash Player is running in an environment that supports accessibility aids, use the Capabilities.hasAccessibility property. If you modify AccessibilityProperties objects, you need to call the Accessibility.updateProperties() method for the changes to take effect."/>
<page href="flash/accessibility/AccessibilityProperties.html#AccessibilityProperties()" title="AccessibilityProperties.AccessibilityProperties()" text="AccessibilityProperties Creates a new AccessibilityProperties object."/>
<page href="flash/accessibility/AccessibilityProperties.html#description" title="AccessibilityProperties.description" text="description Provides a description for this display object in the accessible presentation. If you have a lot of information to present about the object, it is best to choose a concise name and put most of your content in the description property. Applies to whole SWF files, containers, buttons, and text. The default value is an empty string. Corresponds to the Description field in the Accessibility panel."/>
<page href="flash/accessibility/AccessibilityProperties.html#forceSimple" title="AccessibilityProperties.forceSimple" text="forceSimple If true, causes Flash Player to exclude child objects within this display object from the accessible presentation. The default is false. Applies to whole SWF files and containers."/>
<page href="flash/accessibility/AccessibilityProperties.html#name" title="AccessibilityProperties.name" text="name Provides a name for this display object in the accessible presentation. Applies to whole SWF files, containers, buttons, and text. Do not confuse with DisplayObject.name, which is unrelated. The default value is an empty string. Corresponds to the Name field in the Accessibility panel."/>
<page href="flash/accessibility/AccessibilityProperties.html#noAutoLabeling" title="AccessibilityProperties.noAutoLabeling" text="noAutoLabeling If true, disables the Flash Player default auto-labeling system. Auto-labeling causes text objects inside buttons to be treated as button names, and text objects near text fields to be treated as text field names. The default is false. Applies only to whole SWF files. The noAutoLabeling property value is ignored unless you specify it before the first time an accessibility aid examines your SWF file. If you plan to set noAutoLabeling to true, you should do so as early as possible in your code."/>
<page href="flash/accessibility/AccessibilityProperties.html#shortcut" title="AccessibilityProperties.shortcut" text="shortcut Indicates a keyboard shortcut associated with this display object. Supply this string only for UI controls that you have associated with a shortcut key. Applies to containers, buttons, and text. The default value is an empty string. Note: Assigning this property does not automatically assign the specified key combination to this object; you must do that yourself, for example, by listening for a KeyboardEvent. The syntax for this string uses long names for modifier keys, and the plus(+) character to indicate key combination. Examples of valid strings are &quot;Ctrl+F&quot;, &quot;Ctrl+Shift+Z&quot;, and so on."/>
<page href="flash/accessibility/AccessibilityProperties.html#silent" title="AccessibilityProperties.silent" text="silent If true, excludes this display object from accessible presentation. The default is false. Applies to whole SWF files, containers, buttons, and text."/>
<page href="package.html#Infinity" title="Infinity" text="Infinity A special value representing positive Infinity. The value of this constant is the same as Number.POSITIVE_INFINITY. The result of division by 0 is Infinity, but only when the divisor is a positive number. trace(0 / 0); // NaN trace(7 / 0); // Infinity trace(-7 / 0); // -Infinity"/>
<page href="package.html#-Infinity" title="-Infinity" text="-Infinity A special value representing negative Infinity. The value of this constant is the same as Number.NEGATIVE_INFINITY. The result of division by 0 is -Infinity, but only when the divisor is a negative number. trace(0 / 0); // NaN trace(7 / 0); // Infinity trace(-7 / 0); // -Infinity"/>
<page href="package.html#NaN" title="NaN" text="NaN A special member of the Number data type that represents a value that is &quot;not a number&quot; (NaN). When a mathematical expression results in a value that cannot be expressed as a number, the result is NaN. The following list describes common expressions that result in NaN. Division by 0 results in NaN only if the divisor is also 0. If the divisor is greater than 0, division by 0 results in Infinity. If the divisor is less than 0, division by 0 results in -Infinity; Square root of a negative number; The arcsine of a number outside the valid range of 0 to 1; Infinity subtracted from Infinity; Infinity or -Infinity divided by Infinity or -Infinity; Infinity or -Infinity multiplied by 0; The NaN value is not a member of the int or uint data types. The NaN value is not considered equal to any other value, including NaN, which makes it impossible to use the equality operator to test whether an expression is NaN. To determine whether a number is the NaN function, use isNaN()."/>
<page href="package.html#undefined" title="undefined" text="undefined A special value that applies to untyped variables that have not been initialized or dynamic object properties that are not initialized. In ActionScript 3.0, only variables that are untyped can hold the value undefined, which is not true in ActionScript 1.0 and ActionScript 2.0. For example, both of the following variables are undefined because they are untyped and unitialized: var foo; var bar:~~; The undefined value also applies to uninitialized or undefined properties of dynamic objects. For example, if an object is an instance of the Object class, the value of any dynamically added property is undefined until a value is assigned to that property. Results vary when undefined is used with various functions: The value returned by String(undefined) is &quot;undefined&quot; (undefined is converted to a string). The value returned by Number(undefined) is NaN. The value returned by int(undefined) and uint(undefined) is 0. The value returned by Object(undefined) is a new Object instance. When the value undefined is assigned to a typed variable, the value is converted to the default value of the data type. Do not confuse undefined with 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. In the following example, an untyped variable, myVar is declared but not initialized. The value of myVar is undefined because the variable is untyped. This is true whether the variable has no type annotation or uses the special (~~) untyped annotation (var myVar:~~;). // trace value of untyped and uninitialized variable var myVar; trace(myVar); // undefined"/>
<page href="flash/net/package.html#registerClassAlias()" title="registerClassAlias()" text="registerClassAlias Preserves the class (type) of an object when the object is encoded in Action Message Format (AMF). When you encode an object into AMF, this function saves the alias for its class, so that you can recover the class when decoding the object. If the encoding context did not register an alias for an object's class, the object is encoded as an anonymous object. Similarly, if the decoding context does not have the same alias registered, an anonymous object is created for the decoded data. LocalConnection, ByteArray, SharedObject, NetConnection and NetStream are all examples of classes that encode objects in AMF. The encoding and decoding contexts do not need to use the same class for an alias; they can intentionally change classes, provided that the destination class contains all of the members that the source class serializes. aliasName classObject The alias to use. The class associated with the given alias. This example uses the registerClassAlias() function to register an alias (com.example.eg) for the class ExampleClass. Because an alias is registered for the class, the object is able to be deserialized as an instance of ExampleClass, and the code outputs true. If the registerClassAlias() call were removed, the code would output false. package { import flash.display.Sprite; import flash.net.registerClassAlias; import flash.utils.ByteArray; public class RegisterClassAliasExample extends Sprite { public function RegisterClassAliasExample() { registerClassAlias(&quot;com.example.eg&quot;, ExampleClass); var eg1:ExampleClass = new ExampleClass(); var ba:ByteArray = new ByteArray(); ba.writeObject(eg1); ba.position = 0; var eg2:* = ba.readObject(); trace(eg2 is ExampleClass); // true } } } class ExampleClass {} If either parameter is null."/>
<page href="flash/net/package.html#getClassByAlias()" title="getClassByAlias()" text="getClassByAlias Looks up a class that previously had an alias registered through a call to the registerClassAlias() method. This method does not interact with the flash.utils.getDefinitionByName() method. aliasName The alias to find. The alias was not registered."/>
<page href="flash/net/package.html#navigateToURL()" title="navigateToURL()" text="navigateToURL Opens or replaces a window in the application that contains the Flash Player container (usually a browser). Note: For local content running in a browser, calls to the navigateToURL() function that specify a &quot;javascript:&quot; pseudo-protocol (for example, navigateToURL(&quot;javascript:someFunction()&quot;)) are only permitted if the SWF file and the containing web page (if there is one) are in the local-trusted security sandbox. For more information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper request window A URLRequest object that specifies the URL to navigate to. The browser window or HTML frame in which to display the document indicated by the request parameter. You can enter the name of a specific window or use one of the following values: &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. If you do not specify a value for this parameter, a new empty window is created. In the stand-alone player, you can either specify a new (&quot;_blank&quot;) window or a named window. The other values don't apply. Note: When code in a SWF file that is running in the local-with-filesystem sandbox calls the navigateToURL() function and specifies a custom window name for the window parameter, the window name is transfered into a random name. The name is in the form &quot;_flashXXXXXXXX&quot;, where each X represents a random hexadecimal digit. Within the same session (until you close the containing browser window), if you call the function again and specify the same name for the window parameter, the same random string is used. The following example opens the URL http://www.adobe.com in a new browser window and passes data about a user session, captured in a URLVariables object, to the web server. package { import flash.display.Sprite; import flash.net.navigateToURL; import flash.net.URLRequest; import flash.net.URLVariables; public class NavigateToURLExample extends Sprite { public function NavigateToURLExample() { var url:String = &quot;http://www.adobe.com&quot;; var variables:URLVariables = new URLVariables(); variables.exampleSessionId = new Date().getTime(); variables.exampleUserLabel = &quot;Your Name&quot;; var request:URLRequest = new URLRequest(url); request.data = variables; try { navigateToURL(request); } catch (e:Error) { // handle error here } } } } This error is thrown in the following situations: Local untrusted SWF files may not communicate with the Internet. You can avoid this situation by reclassifying this SWF file as local-with-networking or trusted. A navigate operation attempted to evaluate a scripting pseudo-URL, but the containing document (usually an HTML document in a browser) is from a sandbox to which you do not have access. You can avoid this situation by specifying allowScriptAccess=&quot;always&quot; in the containing document. You cannot navigate the special windows &quot;_self&quot;, &quot;_top&quot;, or &quot;_parent&quot; if your SWF file is contained by an HTML page that has set the allowScriptAccess to &quot;none&quot;, or to &quot;sameDomain&quot; when the domains of the HTML file and the SWF file do not match. You cannot navigate a window with a nondefault name from within a SWF file that is in the local-with-filesystem sandbox."/>
<page href="flash/net/package.html#sendToURL()" title="sendToURL()" text="sendToURL Sends a URL request to a server, but ignores any response. To examine the server response, use the URLLoader.load() method instead. For Flash Player 9 and later, 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. For more information, see the Flash Player 9 Security white paper at http://www.adobe.com/go/fp9_0_security. request A URLRequest object specifying the URL to send data to. The following example passes data about a user session, captured in a URLVariables object, to the application at http://www.yourDomain.com/application.jsp. package { import flash.display.Sprite; import flash.net.URLRequest; import flash.net.URLVariables; import flash.net.sendToURL; public class SendToURLExample extends Sprite { public function SendToURLExample() { var url:String = &quot;http://www.yourDomain.com/application.jsp&quot;; var variables:URLVariables = new URLVariables(); variables.sessionId = new Date().getTime(); variables.userLabel = &quot;Your Name&quot;; var request:URLRequest = new URLRequest(url); request.data = variables; trace(&quot;sendToURL: &quot; + request.url + &quot;?&quot; + request.data); try { sendToURL(request); } catch (e:Error) { // handle error here } } } } Local untrusted SWF files cannot communicate with the Internet. You can avoid this situation by reclassifying this SWF file as local-with-networking or trusted."/>
<page href="package.html#trace()" title="trace()" text="trace Displays expressions, or writes to log files, while debugging. A single trace statement can support multiple arguments. If any argument in a trace statement includes a data type other than a String, the trace function invokes the associated toString() method for that data type. For example, if the argument is a Boolean value the trace function invokes Boolean.toString() and displays the return value. arguments One or more (comma separated) expressions to evaluate. For multiple expressions, a space is inserted between each expression in the output. The following example uses the class TraceExample to show how the trace() method can be used to print a simple string. Generally, the message will be printed to a &quot;Debug&quot; console. package { import flash.display.Sprite; public class TraceExample extends Sprite { public function TraceExample() { trace(&quot;Hello World&quot;); } } }"/>
<page href="package.html#Array()" title="Array()" text="Array Creates a new array. The array can be of length zero or more, or an array populated by a list of specified elements, possibly of different data types. The number and data type of the arguments you use determine the contents of the returned array. Calling Array() with no arguments returns an empty array. Calling Array() with a single integer argument returns an array of the specified length, but whose elements have undefined values. Calling Array() with a list of specific values returns an array with elements that contain each of the specified values. Using the Array() function is similar to creating an array with the Array class constructor. Use the as operator for explicit type conversion, or type casting, when the argument is not a primitive value. For more information, see the Example section of this entry. args You can pass no arguments for an empty array, a single integer argument for an array of a specific length, or a series of comma-separated values of various types for an array populated with those values. The following example demonstrates the behavior of the Array() function when an argument is not a primitive value. A common use case of casting to an array is the conversion of an Object instance that stores its values in array format. If Array() is called with an argument of type Object, or any other non-primitive data type, a reference to the object is stored in an element of the new array. In other words, if the only argument passed is an object, a reference to that object becomes the first element of the new array. var obj:Object = [ &quot;a&quot;, &quot;b&quot;, &quot;c&quot; ]; var newArray:Array = Array( obj ); trace(newArray == obj); // false trace(newArray[0] == obj); // true trace(newArray[0][0]) // a trace(newArray[0][1]) // b trace(newArray[0][2]) // c"/>
<page href="package.html#Boolean()" title="Boolean()" text="Boolean Converts the expression parameter to a Boolean value and returns the value. The return value depends on the data type and value of the argument, as described in the following table: Input Value Example Return Value 0 Boolean(0) false NaN Boolean(NaN) false Number (not 0 or NaN) Boolean(4) true Empty string Boolean(&quot;&quot;) false Non-empty string Boolean(&quot;6&quot;) true null Boolean(null) false undefined Boolean(undefined) false Instance of Object class Boolean(new Object()) true No argument Boolean() false Unlike previous versions of ActionScript, the Boolean() function returns the same results as does the Boolean class constructor. expression An expression or object to convert to Boolean."/>
<page href="package.html#Date()" title="Date()" text="Date Returns a String representation of the current day, date, time, and timezone. The date format for the output is: Day Mon Date HH:MM:SS TZD YYYY For example: Wed Apr 12 15:30:17 GMT-0700 2006 To cast a value to type Date use x as Date instead of Date(x)."/>
<page href="package.html#decodeURI()" title="decodeURI()" text="decodeURI Decodes an encoded URI into a string. Returns a string in which all characters previously encoded by the encodeURI function are restored to their unencoded representation. The following table shows the set of escape sequences that are not decoded to characters by the decodeURI function. Use decodeURIComponent() to decode the escape sequences in this table. Escape sequences not decoded Character equivalents %23 # %24 $ %26 &amp; %2B + %2C , %2F / %3A : %3B ; %3D = %3F ? %40 @ uri A string encoded with the encodeURI function. package { import flash.display.Sprite; public class DecodeURIExample extends Sprite { public function DecodeURIExample() { var uri:String = &quot;http://www.example.com/application.jsp?user=&lt;user name='some user'&gt;&lt;/user&gt;&quot;; var encoded:String = encodeURI(uri); var decoded:String = decodeURI(encoded); trace(uri); // http://www.example.com/application.jsp?user=&lt;user name='some user'&gt;&lt;/user&gt; trace(encoded); // http://www.example.com/application.jsp?user=%3Cuser%20name='some%20user'%3E%3C/user%3E trace(decoded); // http://www.example.com/application.jsp?user=&lt;user name='some user'&gt;&lt;/user&gt; } } }"/>
<page href="package.html#decodeURIComponent()" title="decodeURIComponent()" text="decodeURIComponent Decodes an encoded URI component into a string. Returns a string in which all characters previously escaped by the encodeURIComponent function are restored to their uncoded representation. This function differs from the decodeURI() function in that it is intended for use only with a part of a URI string, called a URI component. A URI component is any text that appears between special characters called component separators (: / ; and ? ). Common examples of a URI component are &quot;http&quot; and &quot;www.adobe.com&quot;. Another important difference between this function and decodeURI() is that because this function assumes that it is processing a URI component it treats the escape sequences that represent special separator characters (; / ? : @ &amp; = + $ , #) as regular text that should be decoded. uri A string encoded with the encodeURIComponent function."/>
<page href="package.html#encodeURI()" title="encodeURI()" text="encodeURI Encodes a string into a valid URI (Uniform Resource Identifier). Converts a complete URI into a string in which all characters are encoded as UTF-8 escape sequences unless a character belongs to a small group of basic characters. The following table shows the entire set of basic characters that are not converted to UTF-8 escape sequences by the encodeURI function. Characters not encoded 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ; / ? : @ &amp; = + $ , # - _ . ! ~ ~~ ' ( ) uri A string representing a complete URI. package { import flash.display.Sprite; public class EncodeURIExample extends Sprite { public function EncodeURIExample() { var uri:String = &quot;http://www.example.com/application.jsp?user=&lt;user name='some user'&gt;&lt;/user&gt;&quot;; var encoded:String = encodeURI(uri); var decoded:String = decodeURI(encoded); trace(uri); // http://www.example.com/application.jsp?user=&lt;user name='some user'&gt;&lt;/user&gt; trace(encoded); // http://www.example.com/application.jsp?user=%3Cuser%20name='some%20user'%3E%3C/user%3E trace(decoded); // http://www.example.com/application.jsp?user=&lt;user name='some user'&gt;&lt;/user&gt; } } }"/>
<page href="package.html#encodeURIComponent()" title="encodeURIComponent()" text="encodeURIComponent Encodes a string into a valid URI component. Converts a substring of a URI into a string in which all characters are encoded as UTF-8 escape sequences unless a character belongs to a very small group of basic characters. The encodeURIComponent() function differs from the encodeURI() function in that it is intended for use only with a part of a URI string, called a URI component. A URI component is any text that appears between special characters called component separators (: / ; and ? ). Common examples of a URI component are &quot;http&quot; and &quot;www.adobe.com&quot;. Another important difference between this function and encodeURI() is that because this function assumes that it is processing a URI component it treats the special separator characters (; / ? : @ &amp; = + $ , #) as regular text that should be encoded. The following table shows all characters that are not converted to UTF-8 escape sequences by the encodeURIComponent function. Characters not encoded 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z - _ . ! ~ ~~ ' ( ) uri A string representing a complete URI."/>
<page href="package.html#escape()" title="escape()" text="escape Converts the parameter to a string and encodes it in a URL-encoded format, where most 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 (%). The following table shows all characters that are not converted to escape sequences by the escape() function. Characters not encoded 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z @ - _ . ~~ + / str The expression to convert into a string and encode in a URL-encoded format."/>
<page href="package.html#int()" title="int()" text="int Converts a given numeric value to an integer value. Decimal values are truncated at the decimal point. value A value to be converted to an integer."/>
<page href="package.html#isFinite()" title="isFinite()" text="isFinite Returns true if the value is a finite number, or false if the value is Infinity or -Infinity. The presence of Infinity or -Infinity indicates a mathematical error condition such as division by 0. num A number to evaluate as finite or infinite."/>
<page href="package.html#isNaN()" title="isNaN()" text="isNaN Returns true if the value is NaN(not a number). The isNaN() function is useful for checking whether a mathematical expression evaluates successfully to a number. The NaN value is a special member of the Number data type that represents a value that is &quot;not a number.&quot; Note: The NaN value is not a member of the int or uint data types. The following table describes the return value of isNaN() on various input types and values. Input Type/Value Example Return Value 0 divided by 0 isNaN(0/0) true Non-zero number divided by 0 isNaN(5/0) false Square root of a negative number isNaN(Math.sqrt(-1)) true Arcsine of number greater than 1 or less than 0 isNaN(Math.asin(2)) true String that can be converted to Number isNaN(&quot;5&quot;) false String that cannot be converted to Number isNaN(&quot;5a&quot;) true num A numeric value or mathematical expression to evaluate."/>
<page href="package.html#isXMLName()" title="isXMLName()" text="isXMLName Determines whether the specified string is a valid name for an XML element or attribute. str A string to evaluate."/>
<page href="package.html#Number()" title="Number()" text="Number Converts a given value to a Number value. The following table shows the result of various input types: Input Type/Value Example Return Value undefined Number(undefined) NaN null Number(null) 0 true Number(true) 1 false Number(false) 0 NaN Number(NaN) NaN Empty string Number(&quot;&quot;) 0 String that converts to Number Number(&quot;5&quot;) The number (e.g. 5) String that does not convert to Number Number(&quot;5a&quot;) NaN expression A value to be converted to a number."/>
<page href="package.html#Object()" title="Object()" text="Object Every value in ActionScript 3.0 is an object, which means that calling Object() on a value returns that value. value An object or a number, string, or Boolean value to convert."/>
<page href="package.html#parseInt()" title="parseInt()" text="parseInt Converts 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. Unlike in previous versions of ActionScript, integers beginning with 0 are not interpreted as octal numbers. You must specify a radix of 8 for octal numbers. White space and zeroes preceding valid integers are ignored, as are trailing nonnumeric characters. str radix A string to convert to an integer. An integer representing the radix (base) of the number to parse. Legal values are from 2 to 36."/>
<page href="package.html#parseFloat()" title="parseFloat()" text="parseFloat Converts 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. str The string to read and convert to a floating-point number."/>
<page href="package.html#String()" title="String()" text="String Returns a string representation of the specified parameter. The following table shows the result of various input types: Input Type/Value Return Value undefined undefined null &quot;null&quot; true &quot;true&quot; false &quot;false&quot; NaN &quot;NaN&quot; String String Object Object.toString() Number String representation of the number expression An expression to convert to a string."/>
<page href="package.html#unescape()" title="unescape()" text="unescape Evaluates the parameter str as a string, decodes the string from URL-encoded format (converting all hexadecimal sequences to ASCII characters), and returns the string. str A string with hexadecimal sequences to escape."/>
<page href="package.html#uint()" title="uint()" text="uint Converts a given numeric value to an unsigned integer value. Decimal values are truncated at the decimal point. The following table describes the return value of uint() on various input types and values. Input Type/Value Example Return Value undefined uint(undefined) 0 null uint(null) 0 0 uint(0) 0 NaN uint(NaN) 0 Positive floating-point number uint(5.31) Truncated unsigned integer (e.g. 5) Negative floating-point number uint(-5.78) Truncates to integer then applies rule for negative integers Negative integer uint(-5) Sum of uint.MAX_VALUE and the negative integer (for example, uint.MAX_VALUE + (-5)) true uint(true) 1 false uint(false) 0 Empty String uint(&quot;&quot;) 0 String that converts to Number uint(&quot;5&quot;) The number String that does not convert to Number uint(&quot;5a&quot;) 0 value A value to be converted to an integer."/>
<page href="package.html#XML()" title="XML()" text="XML Converts an object to an XML object. The following table describes return values for various input types. Parameter Type Return Value Boolean Value is first converted to a string, then converted to an XML object. Null A runtime error occurs (TypeError exception). Number Value is first converted to a string, then converted to an XML object. Object Converts to XML only if the value is a String, Number or Boolean value. Otherwise a runtime error occurs (TypeError exception). String Value is converted to XML. Undefined A runtime error occurs (TypeError exception). XML Input value is returned unchanged. XMLList Returns an XML object only if the XMLList object contains only one property of type XML. Otherwise a runtime error occurs (TypeError exception). expression Object to be converted to XML."/>
<page href="package.html#XMLList()" title="XMLList()" text="XMLList Converts an object to an XMLList object. The following table describes return values for various input types. Parameter Type Return Value Boolean Value is first converted to a string, then converted to an XMLList object. Null A runtime error occurs (TypeError exception). Number Value is first converted to a string, then converted to an XMLList object. Object Converts to XMLList only if the value is a String, Number or Boolean value. Otherwise a runtime error occurs (TypeError exception). String Value is converted to an XMLList object. Undefined A runtime error occurs (TypeError exception). XML Value is converted to an XMLList object. XMLList Input value is returned unchanged. expression Object to be converted into an XMLList object."/>
<page href="flash/utils/package.html#describeType()" title="describeType()" text="describeType Produces an XML object that describes the ActionScript object named as the parameter of the method. This method implements the programming concept of reflection for the ActionScript language. If the value parameter is an instance of a type, the returned XML object includes all the instance properties of that type, but does not include any static properties. You can check for this condition when you parse the XML object by examining the value of the &lt;type&gt; tag's isStatic attribute, which is false when the value parameter is an instance of a type. To obtain the static properties of a type, pass the type itself for the value parameter. The returned XML object includes not only the type's static properties, but also all of its instance properties. The instance properties are nested inside a tag named &lt;factory&gt; to distinguish them from the static properties. In this case, the isStatic attribute of the &lt;type&gt; tag is true. Note: If you need only to traverse an object's inheritance hierarchy and do not need the other information provided by describeType(), use the getQualifiedClassName() and getQualifiedSuperclassName() functions instead. The following table describes some of the tags and attributes of the XML object generated by describeType(): TagAttributeDescription &lt;type&gt; The root tag of the XML object.  nameThe name of the ActionScript object's data type.  baseThe immediate superclass of the ActionScript object's defining class. If the ActionScript object is a class object, the value is Class.  isDynamictrue if the ActionScript object's defining class is dynamic; false otherwise. If the ActionScript object is a class object, the value is true because the Class class is dynamic.  isFinaltrue if the ActionScript object's defining class is final; false otherwise.  isStatictrue if the ActionScript object is a class object or constructor function; false otherwise. This attribute is named isStatic because if it is true, any tags that are not nested inside the factory tag are static. &lt;extendsClass&gt; There is a separate extendsClass tag for each superclass of the ActionScript object's defining class.  typeThe name of a superclass that the ActionScript object's defining class extends. &lt;implementsInterface&gt; There is a separate implementsInterface tag for each interface implemented by the ActionScript object's defining class or any of its superclasses.  typeThe name of an interface that the ActionScript object's defining class implements. &lt;accessor&gt; An accessor is a property defined by getter and setter functions.  nameThe name of the accessor.  accessThe access rights of the property. Possible values include readonly, writeonly, and readwrite.  typeThe data type of the property.  declaredByThe class that contains the associated getter or setter functions. &lt;constant&gt; A constant is a property defined with the const statement.  nameThe name of the constant.  typeThe data type of the constant. &lt;method&gt; A method is a function declared as part of a class definition.  nameThe name of the method.  declaredByThe class that contains the method definition.  returnTypeThe data type of the method's return value. &lt;parameter&gt; There is a separate parameter tag for each parameter that a method defines. This tag is always nested inside a &lt;method&gt; tag.  indexA number corresponding to the order in which the parameter appears in the method's parameter list. The first parameter has a value of 1.  typeThe data type of the parameter.  optionaltrue if the parameter is optional; false otherwise. &lt;variable&gt; A variable is a property defined with the var statement.  nameThe name of the variable.  typeThe data type of the variable. &lt;factory&gt; If the ActionScript object is a class object or constructor function, all instance properties and methods are nested inside this tag. If the isStatic attribute of the &lt;type&gt; tag is true, all properties and methods that are not nested within the &lt;factory&gt; tag are static. This tag appears only if the ActionScript object is a class object or constructor function. value The object for which a type description is desired. Any ActionScript value may be passed to this method including all available ActionScript types, object instances, primitive types such as uint, and class objects. package { import flash.display.Sprite; import flash.utils.describeType; public class DescribeTypeExample extends Sprite { public function DescribeTypeExample() { var child:Sprite = new Sprite(); var description:XML = describeType(child); trace(description..accessor.@name.toXMLString()); } } }"/>
<page href="flash/utils/package.html#getQualifiedClassName()" title="getQualifiedClassName()" text="getQualifiedClassName Returns the fully qualified class name of an object. value The object for which a fully qualified class name is desired. Any ActionScript value may be passed to this method including all available ActionScript types, object instances, primitive types such as uint, and class objects."/>
<page href="flash/utils/package.html#getDefinitionByName()" title="getDefinitionByName()" text="getDefinitionByName Returns a reference to the class object of the class specified by the name parameter. name The name of a class. The following example uses the class GetDefinitionByNameExample to create an orange square on the stage. This is accomplished using the following steps: Variables for the background color of orange and size of 80 pixels are declared, which will later be used in drawing the square. Within the constructor, a variable ClassReference of type Class is assigned to Sprite. An instance of ClassReference called instance is instantiated. Since instance is, by reference, a Sprite object, a square can be drawn and added to the display list using the methods available to Sprite. package { import flash.display.DisplayObject; import flash.display.Sprite; import flash.utils.getDefinitionByName; public class GetDefinitionByNameExample extends Sprite { private var bgColor:uint = 0xFFCC00; private var size:uint = 80; public function GetDefinitionByNameExample() { var ClassReference:Class = getDefinitionByName(&quot;flash.display.Sprite&quot;) as Class; var instance:Object = new ClassReference(); instance.graphics.beginFill(bgColor); instance.graphics.drawRect(0, 0, size, size); instance.graphics.endFill(); addChild(DisplayObject(instance)); } } } No public definition exists with the specified name."/>
<page href="flash/utils/package.html#getQualifiedSuperclassName()" title="getQualifiedSuperclassName()" text="getQualifiedSuperclassName Returns the fully qualified class name of the base class of the object specified by the value parameter. This function provides a quicker way of retrieving the base class name than describeType(), but also doesn't provide all the information describeType() does. After you retrieve the name of a class with this function, you can convert the class name to a class reference with the getDefinitionByName() function. Note: This function restricts itself to instance hierarchies, whereas the describeType() function uses class object hierarchies if the value parameter is a data type. Calling describeType() on a data type returns the superclass based on the class object hierarchy, in which all class objects inherit from Class. The getQualifiedSuperclassName() function, however, ignores the class object hierarchy and returns the superclass based on the more familiar instance hierarchy. For example, calling getQualifiedSuperclassName(String) returns Object although technically the String class object inherits from Class. In other words, the results are the same whether you use an instance of a type or the type itself. value Any value."/>
<page href="flash/utils/package.html#getTimer()" title="getTimer()" text="getTimer Returns the number of milliseconds that have elapsed since Flash Player was initialized, and is used to compute relative time. For a calendar date (timestamp), see the Date object. The following example uses the class GetTimerExample to get and print the number of milliseconds since the Flash Player started playing. package { import flash.utils.getTimer; import flash.display.Sprite; public class GetTimerExample extends Sprite { public function GetTimerExample() { var duration:uint = getTimer(); trace(&quot;duration: &quot; + duration); } } }"/>
<page href="flash/utils/package.html#escapeMultiByte()" title="escapeMultiByte()" text="escapeMultiByte Returns an escaped copy of the input string encoded as either UTF-8 or system code page, depending on the value of System.useCodePage. Use of System.useCodePage allows legacy content encoded in local code pages to be accessed by the player, but only on systems using that legacy code page. For example, Japanese data encoded as Shift-JIS will only be escaped and unescaped properly on an OS using a Japanese default code page. value The string to be escaped."/>
<page href="flash/utils/package.html#unescapeMultiByte()" title="unescapeMultiByte()" text="unescapeMultiByte Returns an unescaped copy of the input string, which is decoded from either system code page page or UTF-8 depending on the value of System.useCodePage. Use of System.useCodePage allows legacy content encoded in local code pages to be accessed by the player, but only on systems using that legacy code page. For example, Japanese data encoded as Shift-JIS will only be escaped and unescaped properly on an OS using a Japanese default code page. value The escaped string to be unescaped."/>
<page href="flash/utils/package.html#setInterval()" title="setInterval()" text="setInterval Runs a function at a specified interval (in milliseconds). Although you can use this method, it will generate a compiler warning. Instead of using the setInterval() method, consider creating a Timer object, with the specified interval, using 0 as the repeatCount parameter (which sets the timer to repeat indefinitely). If you intend to use the clearInterval() method to cancel the setInterval() call, be sure to assign the setInterval() call to a variable (which the setInterval() method will later reference), as in the following: closure delay arguments The name of the function to execute. Do not include quotation marks or parentheses, and do not specify parameters of the function to call. For example, use functionName, not functionName() or functionName(param). The interval, in milliseconds. An optional list of arguments that are passed to the closure function. The following example uses the setInterval() method to create a timed interval, calling the myRepeatingFunction() method after regular intervals of one second. package { import flash.display.Sprite; import flash.utils.*; public class SetIntervalExample extends Sprite { private var intervalDuration:Number = 1000; // duration between intervals, in milliseconds public function SetIntervalExample() { var intervalId:uint = setInterval(myRepeatingFunction, intervalDuration, &quot;Hello&quot;, &quot;World&quot;); } public function myRepeatingFunction():void { trace(arguments[0] + &quot; &quot; + arguments[1]); } } }"/>
<page href="flash/utils/package.html#setTimeout()" title="setTimeout()" text="setTimeout Runs a specified function after a specified delay (in milliseconds). Instead of using this method, consider creating a Timer object, with the specified interval, using 1 as the repeatCount parameter (which sets the timer to run only once). If you intend to use the clearTimeout() method to cancel the setTimeout() call, be sure to assign the setTimeout() call to a variable (which the clearTimeout() method will later reference) closure delay arguments The name of the function to execute. Do not include quotation marks or parentheses, and do not specify parameters of the function to call. For example, use functionName, not functionName() or functionName(param). The delay, in milliseconds, until the function is executed. An optional list of arguments that are passed to the closure function. The following example uses the setTimeout() method to call another method following a specified delay period. package { import flash.display.Sprite; import flash.utils.*; public class SetTimeoutExample extends Sprite { private var delay:Number = 1000; // delay before calling myDelayedFunction public function SetTimeoutExample() { var intervalId:uint = setTimeout(myDelayedFunction, delay, &quot;Hello&quot;, &quot;World&quot;); } public function myDelayedFunction():void { trace(arguments[0] + &quot; &quot; + arguments[1]); } } }"/>
<page href="flash/utils/package.html#clearInterval()" title="clearInterval()" text="clearInterval Cancels a specified setInterval() call. id The ID of the setInterval() call, which you set to a variable, as in the following: The following example uses the setInterval() method to create a timed interval, calling the myRepeatingFunction() method after regular intervals of one second. Each call of the myRepeatingFunction method increments the counter property, and when it equals the stopCount property, the clearInterval() method is called with the property intervalId which is a reference id to the interval that was created earlier. package { import flash.display.Sprite; import flash.utils.*; public class ClearIntervalExample extends Sprite { private var intervalDuration:Number = 1000; // duration between intervals, in milliseconds private var intervalId:uint; private var counter:uint = 0; private var stopCount:uint = 3; public function ClearIntervalExample() { intervalId = setInterval(myRepeatingFunction, intervalDuration, &quot;Hello&quot;, &quot;World&quot;); } public function myRepeatingFunction():void { trace(arguments[0] + &quot; &quot; + arguments[1]); counter++; if(counter == stopCount) { trace(&quot;Clearing Interval&quot;); clearInterval(intervalId); } } } }"/>
<page href="flash/utils/package.html#clearTimeout()" title="clearTimeout()" text="clearTimeout Cancels a specified setTimeout() call. id The ID of the setTimeout() call, which you set to a variable, as in the following: The following example uses the setTimeout() method to call another method following a specified delay period. A loop is created to count to one million. If the computer can process this request faster than a second can expire, clearTimeout() will remove the setTimeout() request, and myDelayedFunction() will not be called. package { import flash.display.Sprite; import flash.utils.*; public class ClearTimeoutExample extends Sprite { private var delay:Number = 1000; // delay before calling myDelayedFunction private var intervalId:uint; private var count:uint = 1000000; public function ClearTimeoutExample() { intervalId = setTimeout(myDelayedFunction, delay); startCounting(); } public function startCounting():void { var i:uint = 0; do { if(i == count-1) { clearTimeout(intervalId); trace(&quot;Your computer can count to &quot; + count + &quot; in less than &quot; + delay/1000 + &quot; seconds.&quot;); } i++; } while(i &lt; count) } public function myDelayedFunction():void { trace(&quot;Time expired.&quot;); } } }"/>
<page href="adobe/utils/package.html#MMExecute()" title="MMExecute()" text="MMExecute Lets you issue Flash JavaScript API (JSAPI) commands from ActionScript. In Flash CS3, the MMExecute() function can be called only by a movie that is used as a Flash Panel, by an XMLtoUI dialog box, or by the Custom UI of a component. JSAPI commands have no effect in the player, in test movie mode, or outside the authoring environment. The Flash JSAPI provides several objects, methods, and properties to duplicate or emulate commands that a user can enter in the authoring environment. Using the JSAPI, you can write scripts that extend Flash in several ways: adding commands to menus, manipulating objects on the Stage, repeating sequences of commands, and so on. In general, a user runs a JSAPI script by selecting Commands &gt; Run Command. However, you can use this function in an ActionScript script to call a JSAPI command directly. If you use MMExecute() in a script on Frame 1 of your file, the command executes when the SWF file is loaded. For more information on the JSAPI, see &quot;Extending Flash&quot; at http://www.adobe.com/go/jsapi_info_en. name A string passed to MMExecute(). MMExecute() parses the string and executes any JavaScript commands. You can assign the string a variable and then pass the variable to MMExecute(). You can also separate your JavaScript function into smaller strings; MMExecute() returns the value of the last function called."/>
<page href="flash/system/package.html#fscommand()" title="fscommand()" text="fscommand Lets the SWF file communicate with either Flash Player or the program hosting Flash Player, such as a web browser. You can also use the fscommand() function to pass messages to Director or to Visual Basic, Visual C++, and other programs that can host ActiveX controls. The fscommand() function lets a SWF file communicate with a script in a web page. However, script access is controlled by the web page's allowScriptAccess setting. (You set this attribute in the HTML code that embeds the SWF file—for example, in the PARAM tag for Internet Explorer or the EMBED tag for Netscape.) When allowScriptAccess is set to &quot;never&quot;, a SWF file cannot access web page scripts. With Flash Player 7 and later, when allowScriptAccess is set to &quot;always&quot;, a SWF file can always access web page scripts. When allowScriptAccess is set to &quot;sameDomain&quot;, scripting is allowed only from SWF files that are in the same domain as the web page; scripting is always allowed with previous versions of Flash Player. If allowScriptAccess is not specified in an HTML page, the attribute is set by default to &quot;sameDomain&quot; for SWF files of version 8 and later, and to &quot;always&quot; for SWF files of version 7 and earlier. 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. For more security-related information, see the following: The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The security chapter in the Programming ActionScript 3.0 book and the latest comments on LiveDocs The Flash Player 9 Security white paper Usage 1: To use fscommand() to send a message to Flash Player, you must use predefined commands and parameters. The following table shows the values that you can specify for the fscommand() function's command and args parameters. These values control SWF files that are playing in Flash Player, including projectors. (A projector is a SWF file saved in a format that can run as a stand-alone application—that is, without Flash Player.) Command Parameter (args) Purpose quit None Closes the projector. fullscreen true or false Specifying true sets Flash Player to full-screen mode. Specifying false returns the player to normal menu view. allowscale true or false Specifying false sets the player so that the SWF file is always drawn at its original size and never scaled. Specifying true forces the SWF file to scale to 100% of the player. showmenu true or false Specifying true enables the full set of context menu items. Specifying false hides all of the context menu items except About Flash Player and Settings. exec Path to application Executes an application from within the projector. trapallkeys true or false Specifying true sends all key events, including accelerator keys, to the onClipEvent(keyDown/keyUp) handler in Flash Player. Not all of the commands listed in the table are available in all applications: None of the commands are available in web players. All of the commands are available in stand-alone applications, such as projectors. Only allowscale and exec are available in test-movie players. The exec command can contain only the characters A-Z, a-z, 0-9, period (.), and underscore (_). The exec command runs in the subdirectory fscommand only. In other words, if you use the exec command to call an application, the application must reside in a subdirectory named fscommand. The exec command works only from within a Flash projector file. Usage 2: To use fscommand() to send a message to a scripting language such as JavaScript in a web browser, you can pass any two parameters in the command and args parameters. These parameters can be strings or expressions, and they are used in a JavaScript function that handles, or catches, the fscommand() function. In a web browser, fscommand() calls the JavaScript function moviename_DoFScommand, which resides in the web page that contains the SWF file. For moviename, supply the name of the Flash object that you used for the NAME attribute of the EMBED tag or the ID property of the OBJECT tag. If you assign the SWF file the name &quot;myMovie&quot;, the JavaScript function myMovie_DoFScommand is called. In the web page that contains the SWF file, set the allowScriptAccess attribute to allow or deny the SWF file's ability to access the web page. (You set this attribute in the HTML code that embeds the SWF file—for example, in the PARAM tag for Internet Explorer or the EMBED tag for Netscape.) When allowScriptAccess is set to &quot;never&quot;, outbound scripting always fails. When allowScriptAccess is set to &quot;always&quot;, outbound scripting always succeeds. When it is set to &quot;sameDomain&quot;, scripting is allowed only from SWF files that are in the same domain as the web page. If allowScriptAccess is not specified in a web page, it is set by default to &quot;sameDomain&quot; for Flash Player 8, and to &quot;always&quot; for previous versions of Flash Player. When using this function, consider the Flash Player security model. For Flash Player 9, the fscommand() function is not allowed if the calling SWF file is in the local-with-file-system or local-with-network sandbox and the containing HTML page is in an untrusted sandbox. For more information, see the Flash Player 9 Security white paper at http://www.adobe.com/go/fp9_0_security. Usage 3: The fscommand() function can send messages to Director (Macromedia Director from Adobe). These messages are interpreted by Lingo (the Director scripting language) as strings, events, or executable Lingo code. If a message is a string or an event, you must write the Lingo code to receive the message from the fscommand() function and carry out an action in Director. For more information, see the Director Support Center at www.adobe.com/support/director/. Usage 4: In VisualBasic, Visual C++, and other programs that can host ActiveX controls, fscommand() sends a VB event with two strings that can be handled in the environment's programming language. For more information, use the keywords &quot;Flash method&quot; to search the Flash Support Center at www.adobe.com/support/flash/. Note: If you are publishing for Flash Player 8 or later, the ExternalInterface class provides better functionality for communication between JavaScript and ActionScript (Usage 2) and between ActionScript and VisualBasic, Visual C++, or other programs that can host ActiveX controls (Usage 4). You should continue to use fscommand() for sending messages to Flash Player (Usage 1) and Director (Usage 3). command args A string passed to the host application for any use, or a command passed to Flash Player. A string passed to the host application for any use, or a value passed to Flash Player. The following example shows how fscommand() can be used to direct Flash Player to go into full screen mode and not allow scaling. An orange box is then added to the stage using draw(). In draw(), a click event listener is added named clickHandler(), which responds to click events by directing Flash Player to exit using another call to fscommand(). Note: this example should be executed in the standalone Flash Player and not within a web browser. package { import flash.display.Sprite; import flash.text.TextField; import flash.system.fscommand; import flash.events.MouseEvent; public class FSCommandExample extends Sprite { private var bgColor:uint = 0xFFCC00; private var size:uint = 100; public function FSCommandExample() { fscommand(&quot;fullscreen&quot;, &quot;true&quot;); fscommand(&quot;allowscale&quot;, &quot;false&quot;); draw(); } private function clickHandler(event:MouseEvent):void { fscommand(&quot;quit&quot;); trace(&quot;clickHandler&quot;); } private function draw():void { var child:Sprite = new Sprite(); child.graphics.beginFill(bgColor); child.graphics.drawRect(0, 0, size, size); child.graphics.endFill(); child.buttonMode = true; addEventListener(MouseEvent.CLICK, clickHandler); var label:TextField = new TextField(); label.text = &quot;quit&quot;; label.selectable = false; label.mouseEnabled = false; child.addChild(label); addChild(child); } } }"/>
<page href="flash/profiler/package.html#showRedrawRegions()" title="showRedrawRegions()" text="showRedrawRegions Shows or hides redraw regions. Enables the debugger version of Flash® Player to outline the regions of the screen that are being redrawn (that is regions that are being updated). on color Specifies whether to show or hide redraw regions. When set to true, the redraw rectangles are shown. When set to false, the redraw rectangles are hidden. Sets the color of the rectangles. If you do not specify this parameter, 0xFF0000 is used."/>
	<page href="operators.html" title="operators" text="operators Symbolic operators are characters that specify how to combine, compare, or modify the values of an expression."/>
<page href="operators.html#addition" title="addition" text="addition Adds numeric expressions. 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. If one expression is a string, all other expressions are converted to strings and concatenated instead of summed. Otherwise, if an expression is not a number, Flash&amp;#xAE; Player converts it to a number. A value to be added. This statement adds the integers 2 and 3: trace(2 + 3); // 5 This statement adds the floating-point numbers 2.5 and 3.25: trace(2.5 + 3.25); // 5.75 This example shows that if one expression is a string, all other expressions are converted to strings and concatenated: trace(&quot;Number &quot; + 8 + 0); // Number 80 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 of type String, the script concatenates (combines to form one string) the variable values rather than summing them. var oldBalance:Number = 1345.23; var currentBalance = deposit_txt.text + oldBalance; trace(currentBalance); For example, if a user enters 475 in the deposit text field, the trace() statement sends the value 4751345.23 to the Output panel. To correct this, use the Number() function to convert the string to a number, as shown here: var oldBalance:Number = 1345.23; var currentBalance:Number = Number(deposit_txt.text) + oldBalance; trace(currentBalance);"/>
<page href="operators.html#addition_assignment" title="addition assignment" text="addition assignment Assigns expression1 the value of  expression1 + expression2. For example, the following two statements have the same result: x += y; x = x + y; All the rules of the addition (+) operator apply to the addition assignment (+=) operator. A number. The following example shows a numeric use of the addition assignment (+=) operator: var x:Number = 5; var y:Number = 10; x += y; trace(x); // 15"/>
<page href="operators.html#array_access" title="array access" text="array access 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.*/ 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 trace() statement finds the third element (index 2) of the second array (index 1). var ticTacToe:Array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; trace(ticTacToe[1][2]); // 6  Usage 3: You can use the array access operator to dynamically set and retrieve values for a property of an object: var obj:Object = new Object(); obj.prop1 = &quot;foo&quot;; trace(obj[&quot;prop&quot; + 1]); // foo obj.prop2 = &quot;bar&quot;; for (j in obj) { trace(obj[j]); } /* Output of for loop: foo bar */  The name of an array. The 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 with three elements and changes the third element in the array. var employee_array = [&quot;Barbara&quot;, &quot;George&quot;, &quot;Mary&quot;]; trace(employee_array); // Barbara,George,Mary employee_array[2] = &quot;Sam&quot;; trace(employee_array); // Barbara,George,Sam 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 the obj object: var obj:Object = new Object(); obj.prop1 = &quot;foo&quot;; obj.prop2 = &quot;bar&quot;; for (var i:int = 1;i &amp;lt; 3;i++) { trace(obj[&quot;prop&quot;+i]); } /* Output of for loop: foo bar */"/>
<page href="operators.html#as" title="as" text="as Evaluates whether an expression specified by the first operand is a member of the data type specified by the second operand. If the first operand is a member of the data type, the result is the first operand. Otherwise, the result is the value null. The expression used for the second operand must evaluate to a data type. The value to check against the data type specified. The following example creates a simple array named myArray and uses the as operator with various data types. public var myArray:Array = [&quot;one&quot;, &quot;two&quot;, &quot;three&quot;]; trace(myArray as Array); // one,two,three trace(myArray as Number); // null trace(myArray as int); // null"/>
<page href="operators.html#assignment" title="assignment" text="assignment Assigns the value of expression2 (the operand 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 expression2 is a primitive value, which means that its data type is either Boolean, Number, int, uint, or String. Assignment by reference stores a reference to expression2 in expression1. Assignment by reference is commonly used with the new operator. The new operator creates an object in memory, and a reference to that location in memory is assigned to a variable. Note: In ActionScript 3.0 all values (including primitive values) are objects, and all assignment is done by reference, but primitive objects have special operators that allow them to behave as if they are assigned by value. A variable, element of an array, or property of an object. The following example uses assignment by value to assign the value of 5 to the variable z. var z:Number = 5; The following example uses assignment by value to assign the value &quot;hello&quot; to the variable z: 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); // 3030 The following example builds on 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's properties. You can then change the diameter property to use kilometers instead of miles: var merkur:Object = mercury; merkur.diameter = 4878; // in kilometers trace(mercury.diameter); // 4878"/>
<page href="operators.html#attribute_identifier" title="attribute identifier" text="attribute identifier Identifies attributes of an XML or XMLList object. For example, myXML.&amp;#064;id identifies attributes named id for the myXML XML object. You can also use the following syntax to access attributes: myXML.attribute(&quot;id&quot;), myXML[&quot;&amp;#064;id&quot;], and myXML.&amp;#064;[&quot;id&quot;]. The syntax myXML.&amp;#064;id is recommended. To return an XMLList object of all attribute names, use &amp;#064;~~. To return an attribute with a name that matches an ActionScript reserved word, use the attribute() method instead of the &amp;#064; operator. The name of the attribute. The first example shows how to use the &amp;#064; (at sign) operator to identify an attribute of an element: var myXML:XML = &amp;lt;item id = &quot;42&quot;&amp;gt; &amp;lt;catalogName&amp;gt;Presta tube&amp;lt;/catalogName&amp;gt; &amp;lt;price&amp;gt;3.99&amp;lt;/price&amp;gt; &amp;lt;/item&amp;gt;; trace(myXML.&amp;#064;id); // 42 The next example returns all attribute names: var xml:XML =&amp;lt;example id='123' color='blue'/&amp;gt; var xml2:XMLList = xml.&amp;#064;~~; trace(xml2 is XMLList); // true trace(xml2.length()); // 2 for (var i:int = 0; i &amp;lt; xml2.length(); i++) { trace(typeof(xml2[i])); // xml trace(xml2[i].nodeKind()); // attribute trace(xml2[i].name()); // id and color } The next example returns an attribute with a name that matches a reserved word in ActionScript. You cannot use the syntax xml.&amp;#064;class (since class is a reserved word in ActionScript). You need to use the syntax xml.attribute(&quot;class&quot;): var xml:XML = &amp;lt;example class='123'/&amp;gt; trace(xml.attribute(&quot;class&quot;));"/>
<page href="operators.html#bitwise_AND" title="bitwise AND" text="bitwise AND Converts 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. A positive integer is converted to an unsigned hexadecimal value with a maximum value of 4294967295 or 0xFFFFFFFF; a value larger than the maximum has its most significant digits discarded when it is converted so the value is still 32-bit. A negative number is converted to an unsigned hexadecimal value using the two's complement notation, with a minimum value of -2147483648 or 0x800000000; a number less than the minimum is converted to two's complement with greater precision before the most significant digits are discarded.  The result is interpreted as a 32-bit two's complement number, so the result is an integer in the range -2147483648 to 2147483647.  A number or expression that evaluates to a number. The following example performs a bitwise AND of 13 (binary 1101) and 11 (binary 1011) by comparing the bit representations of the numbers. The resulting integer is composed of a sequence of bits, each of which is set to 1 only if the bits of both operands at the same position are 1. var insert:Number = 13; var update:Number = 11; trace(insert &amp;amp; update); // 9 (or 1001 binary) The bitwise AND of 13 (binary 1101) and 11 (binary 1011) is 9 because only the first and last positions in both numbers have the number 1. 1101 &amp;amp; 1011 ---- 1001 The following examples show the behavior of the return value conversion: trace(0xFFFFFFFF); // 4294967295 trace(0xFFFFFFFF &amp;amp; 0xFFFFFFFF); // -1 trace(0xFFFFFFFF &amp;amp; -1); // -1 trace(4294967295 &amp;amp; -1); // -1 trace(4294967295 &amp;amp; 4294967295); // -1"/>
<page href="operators.html#bitwise_AND_assignment" title="bitwise AND assignment" text="bitwise AND assignment Assigns expression1 the value of expression1 &amp;amp; expression2. For example, the following two expressions are equivalent: x &amp;amp;= y; x = x &amp;amp; y;  A number or expression that evaluates to a number. The following example assigns the value 9 to x: var x:Number = 15; var y:Number = 9; trace(x &amp;amp;= y); // 9"/>
<page href="operators.html#bitwise_left_shift" title="bitwise left shift" text="bitwise left shift Converts expression1 and shiftCount 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 shiftCount. 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. A floating-point number is converted to an integer by discarding any digits after the decimal point. A positive integer is converted to an unsigned hexadecimal value with a maximum value of 4294967295 or 0xFFFFFFFF; a value larger than the maximum has its most significant digits discarded when it is converted so the value is still 32-bit. A negative number is converted to an unsigned hexadecimal value using the two's complement notation, with a minimum value of -2147483648 or 0x800000000; a number less than the minimum is converted to two's complement with greater precision before the most significant digits are discarded.  The result is interpreted as a 32-bit two's complement number, so the result is an integer in the range -2147483648 to 2147483647.  If the result is a negative integer, a runtime error occurs if you attempt to assign the result to a variable of type uint. Although ActionScript has no &quot;unsigned bitwise left shift&quot; operator, you can achieve the same effect, and avoid the runtime error, by using uint(expression1 &amp;lt;&amp;lt; shiftCount):  var num1:uint = 0xFF; var num2:uint = uint(num1 &amp;lt;&amp;lt; 24); // uint() prevents runtime error A number or expression to be shifted left. In the following example, the integer 1 is shifted 10 bits to the left: x = 1 &amp;lt;&amp;lt; 10 The result of the bitwise left shift operation is 1024. This is because 1 decimal equals 1 binary, 1 binary shifted left by 10 is 10000000000 binary, and 10000000000 binary is 1024 decimal: 00000000001 binary &amp;lt;&amp;lt; 10 decimal -------------- 10000000000 binary equals 1024 decimal In the following example, the integer 7 is shifted 8 bits to the left: x = 7 &amp;lt;&amp;lt; 8 The result of the bitwise left shift operation is 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: 00000000111 binary &amp;lt;&amp;lt; 8 decimal -------------- 11100000000 binary equals 1792 decimal The following trace statement shows that the bits have been pushed three positions to the left: // 1 binary == 0001 // 8 binary == 1000 trace(1 &amp;lt;&amp;lt; 3); // 8"/>
<page href="operators.html#bitwise_left_shift_and_assignment" title="bitwise left shift and assignment" text="bitwise left shift and assignment Performs a bitwise left shift (&amp;lt;&amp;lt;=) operation and stores the contents as a result in expression1. The following two expressions are equivalent: A &amp;lt;&amp;lt;= B A = (A &amp;lt;&amp;lt; B) A number or expression to be shifted left. The following example uses the bitwise left shift and assignment (&amp;lt;&amp;lt;=) operator to shift all bits one position to the left: var x:Number = 4; // Shift all bits one slot to the left. x &amp;lt;&amp;lt;= 1; trace(x); // 8 // 4 decimal = 0100 binary // 8 decimal = 1000 binary"/>
<page href="operators.html#bitwise_NOT" title="bitwise NOT" text="bitwise NOT Converts expression to a 32-bit signed integer, and then applies a bitwise one'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. This operator is also known as the one's complement operator or the bitwise complement operator. For example, the hexadecimal value 0x7777 is represented as this binary number: 0111011101110111 The bitwise negation of that hexadecimal value, ~0x7777, is this binary number: 1000100010001000 In 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).  A floating-point number is converted to an integer by discarding any digits after the decimal point. A positive integer is converted to an unsigned hexadecimal value with a maximum value of 4294967295 or 0xFFFFFFFF; a value larger than the maximum has its most significant digits discarded when it is converted so the value is still 32-bit. A negative number is converted to an unsigned hexadecimal value using the two's complement notation, with a minimum value of -2147483648 or 0x800000000; a number less than the minimum is converted to two's complement with greater precision before the most significant digits are discarded.  The result is interpreted as a 32-bit two's complement number, so the result is an integer in the range -2147483648 to 2147483647.  A number to be converted. The following example demonstrates a use of the bitwise NOT (~) operator with flag bits: var ReadOnlyFlag:int = 0x0001; // defines bit 0 as the read-only flag var flags:int = 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;amp;= ~ReadOnlyFlag; trace(flags); // 0 1 0"/>
<page href="operators.html#bitwise_OR" title="bitwise OR" text="bitwise OR Converts expression1 and expression2 to 32-bit unsigned integers, and places a 1 in each bit position where the corresponding bits of either expression1  or expression2 are 1. A floating-point number is converted to an integer by discarding any digits after the decimal point. A positive integer is converted to an unsigned hexadecimal value with a maximum value of 4294967295 or 0xFFFFFFFF; a value larger than the maximum has its most significant digits discarded when it is converted so the value is still 32-bit. A negative number is converted to an unsigned hexadecimal value using the two's complement notation, with a minimum value of -2147483648 or 0x800000000; a number less than the minimum is converted to two's complement with greater precision before the most significant digits are discarded.  The result is interpreted as a 32-bit two's complement number, so the result is an integer in the range -2147483648 to 2147483647.  A number. The following is an example of a bitwise OR (|) operation: // 15 decimal = 1111 binary var a:Number = 15; // 9 decimal = 1001 binary var b:Number = 9; // 1111 | 1001 = 1111 trace(a | b); // returns 15 decimal (1111 binary) Don't confuse the single | (bitwise OR) with || (logical OR)."/>
<page href="operators.html#bitwise_OR_assignment" title="bitwise OR assignment" text="bitwise OR assignment Assigns expression1 the value of expression1 | expression2. For example, the following two statements are equivalent: x |= y; x = x | y;  A number to be converted. The following example uses the bitwise OR assignment (|=) operator: // 15 decimal = 1111 binary var a:Number = 15; // 9 decimal = 1001 binary var b:Number = 9; // 1111 |= 1001 = 1111 trace(a |= b); // returns 15 decimal (1111 binary)"/>
<page href="operators.html#bitwise_right_shift" title="bitwise right shift" text="bitwise right shift Converts expression and shiftCount to 32-bit integers, and shifts all the bits in expression to the right by the number of places specified by the integer that results from the conversion of shiftCount. 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 expression 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. A floating-point number is converted to an integer by discarding any digits after the decimal point. A positive integer is converted to an unsigned hexadecimal value with a maximum value of 4294967295 or 0xFFFFFFFF; a value larger than the maximum has its most significant digits discarded when it is converted so the value is still 32-bit. A negative number is converted to an unsigned hexadecimal value using the two's complement notation, with a minimum value of -2147483648 or 0x800000000; a number less than the minimum is converted to two's complement with greater precision before the most significant digits are discarded.  The result is interpreted as a 32-bit two's complement number, so the result is an integer in the range -2147483648 to 2147483647.  A number or expression to be shifted right. The following example converts 65535 to a 32-bit integer and shifts it 8 bits to the right, resulting in a decimal value of 255: var a:Number = 65535 &amp;gt;&amp;gt; 8; trace(a); // 255 This is because 65535 decimal equals 00000000000000001111111111111111 binary (sixteen 0s followed by sixteen 1s); shifting right by 8 bits causes the 8 least significant bits (the bits farthest to the right) to be discarded. Because 65535 is positive, the bit position made available by the shift (the 8 bit positions farthest on the left) are filled in with 0s. The result is 00000000000000000000000011111111 (twenty-four 0s followed by eight 1s) binary, which represents the 32-bit integer 255. 00000000000000001111111111111111 binary (65535 decimal) &amp;gt;&amp;gt; 8 decimal -------------------- 00000000000000000000000011111111 binary (255 decimal) The following example converts -8 to a 32-bit integer and shifts it 1 bit to the right, resulting in a decimal value of -4: var a:Number = -8 &amp;gt;&amp;gt; 1; trace(a); // -4 This is because -8 decimal equals 11111111111111111111111111111000 binary (twenty-nine 1s followed by three 0s); shifting right by one bit causes the least significant bit (the bit farthest to the right) to be discarded. Because -8 is negative, the bit position made available by the shift (the 1 bit position farthest on the left) is filled in with 1. The result is 11111111111111111111111111111100 (thirty 1s followed by two 0s) binary, which represents the 32-bit integer -4. 11111111111111111111111111111000 binary (-8 decimal) &amp;gt;&amp;gt; 1 decimal -------------------- 11111111111111111111111111111100 binary (-4 decimal)"/>
<page href="operators.html#bitwise_right_shift_and_assignment" title="bitwise right shift and assignment" text="bitwise right shift and assignment Performs a bitwise right-shift operation and stores the result in expression.  The following two statements are equivalent:  A &amp;gt;&amp;gt;= B; A = (A &amp;gt;&amp;gt; B); A number or expression to be shifted right. The following code uses the bitwise right shift and assignment (&amp;gt;&amp;gt;=) operator: function convertToBinary(numberToConvert:Number):String { var result:String = &quot;&quot;; for (var i = 0; i &amp;lt; 32; i++) { // Extract least significant bit using bitwise AND. var lsb:Number = numberToConvert &amp;amp; 1; // Add this bit to the result. result = (lsb ? &quot;1&quot; : &quot;0&quot;)+result; // Shift numberToConvert right by one bit, to see next bit. numberToConvert &amp;gt;&amp;gt;= 1; } return result; } trace(convertToBinary(479)); // Returns the string 00000000000000000000000111011111. // This string is the binary representation of the decimal number 479."/>
<page href="operators.html#bitwise_unsigned_right_shift" title="bitwise unsigned right shift" text="bitwise unsigned right shift The same as the bitwise right shift (&amp;gt;&amp;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. A floating-point number is converted to an integer by discarding any digits after the decimal point. A positive integer is converted to an unsigned hexadecimal value with a maximum value of 4294967295 or 0xFFFFFFFF; a value larger than the maximum has its most significant digits discarded when it is converted so the value is still 32-bit. A negative number is converted to an unsigned hexadecimal value using the two's complement notation, with a minimum value of -2147483648 or 0x800000000; a number less than the minimum is converted to two's complement with greater precision before the most significant digits are discarded.  The result is interpreted as a 32-bit unsigned integer, so the result is an integer in the range 0 to 4294967295.  Note:  ActionScript has no complementary &quot;bitwise unsigned left shift&quot; operator, but you can achieve the same effect by using uint(expression &amp;lt;&amp;lt; shiftCount). A number or expression to be shifted right. The following example converts -1 to a 32-bit integer and shifts it 1 bit to the right: var a:Number = -1 &amp;gt;&amp;gt;&amp;gt; 1; trace(a); // 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."/>
<page href="operators.html#bitwise_unsigned_right_shift_and_assignment" title="bitwise unsigned right shift and assignment" text="bitwise unsigned right shift and assignment Performs an unsigned bitwise right-shift operation and stores the result in expression. The following two statements are equivalent: A &amp;gt;&amp;gt;&amp;gt;= B; A = (A &amp;gt;&amp;gt;&amp;gt; B);  A number or expression to be shifted right. The following example converts -1 to a 32-bit integer and shifts it 1 bit to the right: var a:Number = -1; a &amp;gt;&amp;gt;&amp;gt;= 1; trace(a); // 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."/>
<page href="operators.html#bitwise_XOR" title="bitwise XOR" text="bitwise XOR Converts expression1 and expression2 to 32-bit unsigned integers, and places a 1 in each bit position where the corresponding bits in expression1 or expression2, but not both, are 1. A floating-point number is converted to an integer by discarding any digits after the decimal point. A positive integer is converted to an unsigned hexadecimal value with a maximum value of 4294967295 or 0xFFFFFFFF; a value larger than the maximum has its most significant digits discarded when it is converted so the value is still 32-bit. A negative number is converted to an unsigned hexadecimal value using the two's complement notation, with a minimum value of -2147483648 or 0x800000000; a number less than the minimum is converted to two's complement with greater precision before the most significant digits are discarded.  The result is interpreted as a 32-bit two's complement number, so the result is an integer in the range -2147483648 to 2147483647.  A number or expression that evaluates to a number. The following example uses the bitwise XOR operator on the decimals 15 and 9, and assigns the result to the variable a: // 15 decimal = 1111 binary // 9 decimal = 1001 binary var a:Number = 15 ^ 9; trace(a); // 1111 ^ 1001 = 0110 // returns 6 decimal (0110 binary)"/>
<page href="operators.html#bitwise_XOR_assignment" title="bitwise XOR assignment" text="bitwise XOR assignment Assigns expression1 the value of  expression1 ^ expression2. For example, the following two statements are equivalent: x ^= y x = x ^ y  A number or expression that evaluates to a number. The following example shows a bitwise XOR assignment (^=) operation: // 15 decimal = 1111 binary var a:Number = 15; // 9 decimal = 1001 binary var b:Number = 9; trace(a ^= b); // returns 6 decimal (0110 binary)"/>
<page href="operators.html#block_comment_delimiter" title="block comment delimiter" text="block comment delimiter Delimits one or more lines of script comments. Characters that appear between the opening delimiter (/*) and the closing delimiter (*/) are interpreted as a comment and ignored by the ActionScript compiler. Use these delimiters to identify comments on multiple successive lines; for single-line comments, use the // delimiter. You will receive an error message if you omit the closing block comment delimiter (*/), or if you attempt to nest comments. After an opening delimiter (/*) is used, the first closing delimiter (*/) ends the comment, regardless of the number of opening delimiters placed before it. Any characters. The following script uses block 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 results 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 */"/>
<page href="operators.html#braces_(XML)" title="braces (XML)" text="braces (XML) Evaluates an expression that is used in an XML or XMLList initializer. An XML or XMLList initializer is a literal value that is assigned to a variable of type XML or XMLList. An expression that is delimited by the XML { and } operators can be used in an XML or XMLList initializer instead of literal names or values. An expression can be used in place of tagName, attributeName, attributeValue, and content. An XML or XMLList object. The following example shows how to use the { and } operators when defining an XML literal: var tagname:String = &quot;item&quot;; var attributename:String = &quot;id&quot;; var attributevalue:String = &quot;5&quot;; var content:String = &quot;Chicken&quot;; var x:XML = &amp;lt;{tagname} {attributename}={attributevalue}&amp;gt;{content}&amp;lt;/{tagname}&amp;gt;; trace(x.toXMLString()); // &amp;lt;item id=&quot;5&quot;&amp;gt;Chicken&amp;lt;/item&amp;gt;"/>
<page href="operators.html#brackets_(XML)" title="brackets (XML)" text="brackets (XML) Accesses a property or attribute of an XML or XMLList object. The brackets operator allows you to access property names that are not accessible with the dot (.) operator. An XML or XMLList object. The following example shows how to use the [ and ] operators to access an XML property that is not accessible with the dot operator because of the hyphen in the tag name: var myXML:XML = &amp;lt;a&amp;gt;&amp;lt;foo-bar&amp;gt;44&amp;lt;/foo-bar&amp;gt;&amp;lt;/a&amp;gt;; trace(myXML[&quot;foo-bar&quot;]);"/>
<page href="operators.html#comma" title="comma" text="comma 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. An expression to be evaluated. The following example uses the comma (,) operator in a for loop: for (i = 0, j = 0; i &amp;lt; 3 &amp;amp;&amp;amp; j &amp;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 to show that the comma operator is of lower precedence than the assignment (=) operator: var v:Number = 0; v = 4, 5, 6; trace(v); // 4 The following example uses the comma operator with parentheses and illustrates that the comma operator returns the value of the last expression: var v:Number = 0; v = (4, 5, 6); trace(v); // 6 The following example uses the comma operator without parentheses and illustrates that the comma operator causes all of the expressions to be evaluated sequentially. The first expression, v + 4, is assigned to the variable v because the assignment (=) operator is of higher precedence than the comma operator. 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); // 4 trace(z); // 1 The following example is identical to the previous example except for the addition of parentheses, which changes the order of operations such that the comma operator is evaluated before the assignment (=) operator: var v:Number = 0; var z:Number = 0; v = (v + 4, z++, v + 6); trace(v); // 6 trace(z); // 1"/>
<page href="operators.html#concatenation" title="concatenation" text="concatenation Concatenates (combines) strings. If one expression is a string, all other expressions are converted to strings and concatenated. If both expressions are numbers, this operator behaves as an addition operator. A string to be concatenated. The following example concatenates two strings. var lastName:String = &quot;Cola&quot;; var instrument:String = &quot;Drums&quot;; trace(lastName + &quot; plays &quot; + instrument); // Cola plays Drums This example shows that if one expression is a string, all other expressions are converted to strings and concatenated: trace(&quot;Number &quot; + 8 + 0); // Number 80 The following example shows how numeric sums to the right of a string expression are not calculated because they are converted to strings: var a:String = 3 + 10 + &quot;asdf&quot;; trace(a); // 13asdf var b:String = &quot;asdf&quot; + 3 + 10; trace(b); // asdf310"/>
<page href="operators.html#concatenation_(XMLList)" title="concatenation (XMLList)" text="concatenation (XMLList) Concatenates (combines) XML or XMLList values into an XMLList object. An XMLList object results only if both operands are XML or XMLList values. An XML or XMLList value. The following example shows how to use the XMLList (+) (concatenation) operator: var x1:XML = &amp;lt;employee id = &quot;42&quot;&amp;gt; &amp;lt;firstName&amp;gt;Joe&amp;lt;/firstName&amp;gt; &amp;lt;lastName&amp;gt;Smith&amp;lt;/lastName&amp;gt; &amp;lt;/employee&amp;gt;; var x2:XML = &amp;lt;employee id = &quot;43&quot;&amp;gt; &amp;lt;firstName&amp;gt;Susan&amp;lt;/firstName&amp;gt; &amp;lt;lastName&amp;gt;Jones&amp;lt;/lastName&amp;gt; &amp;lt;/employee&amp;gt;; var myXMLList:XMLList = x1 + x2; trace(myXMLList.toXMLString()); The trace statement produces the following output: &amp;lt;employee id = &quot;42&quot;&amp;gt; &amp;lt;firstName&amp;gt;Joe&amp;lt;/firstName&amp;gt; &amp;lt;lastName&amp;gt;Smith&amp;lt;/lastName&amp;gt; &amp;lt;/employee&amp;gt; &amp;lt;employee id = &quot;43&quot;&amp;gt; &amp;lt;firstName&amp;gt;Susan&amp;lt;/firstName&amp;gt; &amp;lt;lastName&amp;gt;Jones&amp;lt;/lastName&amp;gt; &amp;lt;/employee&amp;gt;"/>
<page href="operators.html#concatenation_assignment" title="concatenation assignment" text="concatenation assignment Assigns expression1 the value of expression1 + expression2. For example, the following two statements have the same result: x += y; x = x + y;All the rules of the concatenation (+) operator apply to the concatenation assignment (+=) operator. Note that using concatenation assignment for the text property of a TextField (i.e. someTextField.text += moreText is much less efficient than TextField.appendText(), particularly with a TextField that contains a significant amount of content. A string. This example uses the += operator with a string expression: var x1:String = &quot;My name is &quot;; x1 += &quot;Gilbert&quot;; trace(x1); // My name is Gilbert"/>
<page href="operators.html#concatenation_assignment_(XMLList)" title="concatenation assignment (XMLList)" text="concatenation assignment (XMLList) Assigns expression1, which is an XMLList object, the value of expression1 + expression2. For example, the following two statements have the same result: x += y; x = x + y; All the rules of the XMLList concatenation (+) operator apply to the XMLList concatenation assignment (+=) operator. The XMLList object to which you are adding a new value. The following example shows how to use the XMLList concatenation assignment (+=) operator: var x1:XML = &amp;lt;location&amp;gt;Athens&amp;lt;/location&amp;gt;; var x2:XML = &amp;lt;location&amp;gt;Paris&amp;lt;/location&amp;gt;; myXMLList = x1 + x2; var x3:XML = &amp;lt;location&amp;gt;Springfield&amp;lt;/location&amp;gt;; myXMLList += x3; trace(myXMLList.toXMLString()); The trace statement produces the following output: &amp;lt;location&amp;gt;Athens&amp;lt;/location&amp;gt; &amp;lt;location&amp;gt;Paris&amp;lt;/location&amp;gt; &amp;lt;location&amp;gt;Springfield&amp;lt;/location&amp;gt;"/>
<page href="operators.html#conditional" title="conditional" text="conditional Evaluates expression1, and if the value of expression1 is true, the result is the value of expression2; otherwise the result is the value of expression3. An expression that evaluates to a Boolean value; usually a comparison expression, such as x &amp;lt; 5. The following statement assigns the value of variable x to variable z because the first expression evaluates to true: var x:Number = 5; var y:Number = 10; var z = (x &amp;lt; 6) ? x: y; trace(z); // returns 5 The following example shows a conditional statement written in shorthand: var timecode:String = (new Date().getHours() &amp;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() &amp;lt; 11) { var timecode:String = &quot;AM&quot;; } else { var timecode:String = &quot;PM&quot;; } trace(timecode);"/>
<page href="operators.html#decrement" title="decrement" text="decrement Subtracts 1 from the operand. The operand 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 expression and returns the initial value of expression (the value prior to the subtraction). A number or a variable that evaluates to a number. The 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); } 0; i--) { trace(i); }"/>
<page href="operators.html#delete" title="delete" text="delete Destroys the object property specified by reference; the result is true if the property does not exist after the operation completes, and false otherwise. The delete operator returns true if it is called on a nonexistent property or a dynamic property not defined in a class. The delete operator can fail and return false if the reference parameter cannot be deleted. You cannot delete fixed properties or variables that are declared with the var statement. A fixed property is a variable or method defined in a class definition.  The delete operator cannot be used to destroy a property of a class, unless that class is a dynamic class added at runtime. Properties of sealed classes cannot be destroyed using delete. Set the property to null instead. Note: You cannot delete an object, but you can make an object eligible for garbage collection by removing all references to the object. The most common reference to an object is a variable that points to it. You can remove such a reference by setting the variable to null. The garbage collector removes any object that has no references. The name of the property to eliminate. 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; trace(account.name); // undefined // delete a nonexistent property var fooDeleted:Boolean = delete account.foo; trace(fooDeleted); // true The following example deletes the value of an array element, but the value of the length property is not changed: 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); // 3 trace(my_array); // abc,def, The following example shows how the returned Boolean from delete can be used as a condition for future code execution. Note that if an item has already been deleted, calling delete on the item again will return false. var my_array:Array = [ &quot;abc&quot;, &quot;def&quot;, &quot;ghi&quot; ]; var deleteWasSuccessful:Boolean deleteWasSuccessful = delete my_array[0]; if(deleteWasSuccessful) delete my_array[1]; deleteWasSuccessful = delete my_array[0]; if(deleteWasSuccessful) delete my_array[2]; trace(my_array) // outputs: undefined,undefined,ghi"/>
<page href="operators.html#delete_(XML)" title="delete (XML)" text="delete (XML) Deletes the XML elements or attributes specified by reference. When used with an XMLList operand, the result of the delete operator is always true because the XMLList operand always refers to a valid (though possibly empty) XMLList object. An XMLList object that specifies the XML elements or attributes to delete. The following example shows how to delete an attribute, then delete a single element, then delete multiple elements: var x1:XML = &amp;lt;x1&amp;gt; &amp;lt;a id = &quot;52&quot;&amp;gt;AYY&amp;lt;/a&amp;gt; &amp;lt;a&amp;gt;AYY 2 &amp;lt;/a&amp;gt; &amp;lt;b&amp;gt;BEE&amp;lt;/b&amp;gt; &amp;lt;c&amp;gt;CEE&amp;lt;/c&amp;gt; &amp;lt;/x1&amp;gt;; trace(x1.toXMLString()); trace(&quot;___________&quot;); delete x1.a.@id; trace(x1.toXMLString()); trace(&quot;___________&quot;); delete x1.b; trace(x1.toXMLString()); trace(&quot;___________&quot;); delete x1.a; trace(x1.toXMLString()); The output is as follows: &amp;lt;x1&amp;gt; &amp;lt;a id=&quot;52&quot;&amp;gt;AYY&amp;lt;/a&amp;gt; &amp;lt;a&amp;gt;AYY 2&amp;lt;/a&amp;gt; &amp;lt;b&amp;gt;BEE&amp;lt;/b&amp;gt; &amp;lt;c&amp;gt;CEE&amp;lt;/c&amp;gt; &amp;lt;/x1&amp;gt; ___________ &amp;lt;x1&amp;gt; &amp;lt;a&amp;gt;AYY&amp;lt;/a&amp;gt; &amp;lt;a&amp;gt;AYY 2&amp;lt;/a&amp;gt; &amp;lt;b&amp;gt;BEE&amp;lt;/b&amp;gt; &amp;lt;c&amp;gt;CEE&amp;lt;/c&amp;gt; &amp;lt;/x1&amp;gt; ___________ &amp;lt;x1&amp;gt; &amp;lt;a&amp;gt;AYY&amp;lt;/a&amp;gt; &amp;lt;a&amp;gt;AYY 2&amp;lt;/a&amp;gt; &amp;lt;c&amp;gt;CEE&amp;lt;/c&amp;gt; &amp;lt;/x1&amp;gt; ___________ &amp;lt;x1&amp;gt; &amp;lt;c&amp;gt;CEE&amp;lt;/c&amp;gt; &amp;lt;/x1&amp;gt;"/>
<page href="operators.html#descendant_accessor" title="descendant accessor" text="descendant accessor Navigates to descendant elements of an XML or XMLList object, or (combined with the @ operator) finds matching attributes of descendants. The matching elements or attributes need not be direct children of the XML or XMLList object; they can be lower in the tree (for example, grandchildren). The result is an XMLList object, because more than one child element or attribute can match. The order of nodes in the XMLList object returned is the result of a depth-first traversal. For example, consider the following: var myXML:XML = &amp;lt;a&amp;gt; &amp;lt;b&amp;gt;one &amp;lt;c&amp;gt; &amp;lt;b&amp;gt;two&amp;lt;/b&amp;gt; &amp;lt;/c&amp;gt; &amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;three&amp;lt;/b&amp;gt; &amp;lt;/a&amp;gt;; trace(myXML..b[0].toXMLString()); trace(&quot;______________&quot;); trace(myXML..b[1].toXMLString()); trace(&quot;______________&quot;); trace(myXML..b[2].toXMLString()); The following output would result: &amp;lt;b&amp;gt; one &amp;lt;c&amp;gt; &amp;lt;b&amp;gt;two&amp;lt;/b&amp;gt; &amp;lt;/c&amp;gt; &amp;lt;/b&amp;gt; ______________ &amp;lt;b&amp;gt;two&amp;lt;/b&amp;gt; ______________ &amp;lt;b&amp;gt;three&amp;lt;/b&amp;gt;  To return descendants with names that match ActionScript reserved words, use the XML.descendants() method instead of the descendant (..) operator, as the following example shows:   var xml:XML = &amp;lt;enrollees&amp;gt; &amp;lt;student id=&quot;239&quot;&amp;gt; &amp;lt;class name=&quot;Algebra&quot; /&amp;gt; &amp;lt;class name=&quot;Spanish 2&quot;/&amp;gt; &amp;lt;/student&amp;gt; &amp;lt;student id=&quot;206&quot;&amp;gt; &amp;lt;class name=&quot;Trigonometry&quot; /&amp;gt; &amp;lt;class name=&quot;Spanish 2&quot; /&amp;gt; &amp;lt;/student&amp;gt; &amp;lt;/enrollees&amp;gt;; trace(xml.descendants(&quot;class&quot;));  The XML or XMLList object. The following example shows how to use the descendant accessor (..) operator to return descendant elements of an XML object and to return an attribute of an element: var myXML:XML = &amp;lt;employees&amp;gt; &amp;lt;employee id = &quot;42&quot;&amp;gt; &amp;lt;firstName&amp;gt;Billy&amp;lt;/firstName&amp;gt; &amp;lt;lastName&amp;gt;Einstein&amp;lt;/lastName&amp;gt; &amp;lt;/employee&amp;gt; &amp;lt;employee id = &quot;43&quot;&amp;gt; &amp;lt;firstName&amp;gt;Sally&amp;lt;/firstName&amp;gt; &amp;lt;lastName&amp;gt;Shostakovich&amp;lt;/lastName&amp;gt; &amp;lt;/employee&amp;gt; &amp;lt;/employees&amp;gt; trace(myXML..firstName); // &amp;lt;firstName&amp;gt;Billy&amp;lt;/firstName&amp;gt; // &amp;lt;firstName&amp;gt;Sally&amp;lt;/firstName&amp;gt; trace(myXML..@id); //4243"/>
<page href="operators.html#division" title="division" text="division Divides expression1 by expression2. The result of the division operation is a double-precision floating-point number. A number or a variable that evaluates to a number. The following example shows that the results of dividing by 0 differs if the dividend is positive, negative or 0. trace(3/0); // Infinity trace(-3/0); // -Infinity trace(0/0); // NaN"/>
<page href="operators.html#division_assignment" title="division assignment" text="division assignment Assigns expression1 the value of  expression1 / expression2. For example, the following two statements are equivalent: x /= y; x = x / y; A number or a variable that evaluates to a number. The following code shows the division assignment (/=) operator used with variables and numbers: var a:Number = 10; var b:Number = 2; a /= b; trace(a); // 5"/>
<page href="operators.html#dot" title="dot" text="dot Accesses class variables and methods, gets and sets object properties, and delimits imported packages or classes. An instance of a class. The object can be an instance of any of the built-in ActionScript classes or a class you define. This operand is always to the left of the dot (.) operator. The following example uses the dot operator as a delimiter when importing the Timer class. import flash.utils.Timer; The following example creates a generic object and uses the dot operator to add a new property. var obj:Object = new Object(); obj.propertyA = &quot;hello&quot;; trace(obj.propertyA); // hello"/>
<page href="operators.html#dot_(XML)" title="dot (XML)" text="dot (XML) Navigates to child elements of an XML or XMLList object, or (combined with the @ operator) returns attributes of an XML or XMLList object. The object returned is an XMLList, because more than one child element or attribute can match. To return elements with names that match ActionScript reserved words, use the XML.elements() method or the XML.descendants() method instead of the XML dot (.) operator, as the following example shows:   var xml:XML = &amp;lt;student id=&quot;206&quot;&gt; &amp;lt;class name=&quot;Trigonometry&quot; /&amp;gt; &amp;lt;class name=&quot;Spanish 2&quot; /&amp;gt; &amp;lt;/student&amp;gt;; trace(xml.elements(&quot;class&quot;)); trace(xml.descendants(&quot;class&quot;));  &amp;lt;class name=&quot;Trigonometry&quot; /&amp;gt; &amp;lt;class name=&quot;Spanish 2&quot; /&amp;gt; &amp;lt;/student&amp;gt;; trace(xml.elements(&quot;class&quot;)); trace(xml.descendants(&quot;class&quot;));  The XML or XMLList object. The following example shows how to use the dot (.) operator to return to a child element of an XML object and to return an attribute of an element: var myXML:XML = &amp;lt;employee id = &quot;42&quot;&amp;gt; &amp;lt;firstName&amp;gt;Billy&amp;lt;/firstName&amp;gt; &amp;lt;lastName&amp;gt;Einstein&amp;lt;/lastName&amp;gt; &amp;lt;/employee&amp;gt;; trace(myXML.firstName); // Billy trace(myXML.@id); // 42"/>
<page href="operators.html#equality" title="equality" text="equality Tests two expressions for equality. The result is true if the expressions are equal. If the data types of the two operands match, the definition of equal depends on the data type of the operands:  Values of type int, uint, and Boolean are considered equal if they have the same value. Numbers with matching values are considered equal, unless they are both NaN. If the value of both operands is null or undefined, they are considered equal. String expressions are equal if they have the same number of characters and the characters are identical. For XML objects:  If one operand is a text or attribute node and the other has simple content, both operands are converted to strings with the toString() method and are considered equal if the resulting strings match.  Otherwise, objects are considered equal only if the qualified name, attributes, and child properties for both objects match.   XMLList objects are considered equal if they have the same number of properties and both the order and values of the properties match. For Namespace objects, values are considered equal if the uri properties of both objects match. For QName objects, values are considered equal if the uri properties of both objects match and the localName properties of both objects match. 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.  If the data types of the operands do not match, the result is false except in the following circumstances:  The operands' values are undefined and null, in which case the result is true. Automatic data type conversion converts the data types of String, Boolean, int, uint, and Number values to compatible types and the converted values are equal, in which case operands are considered equal. One operand is of type XML with simple content (hasSimpleContent() == true), and after both operands are converted to strings with the toString() method, the resulting strings match. One operand is of type XMLList, and either of the following conditions is true:  The length property of the XMLList object is 0, and the other object is undefined. The length property of the XMLList object is 1, and one element of the XMLList object matches the other operand.    A number, string, Boolean value, variable, object, array, or expression. The following example uses the equality (==) operator with an if statement: var a:String = &quot;David&quot; var b:String = &quot;David&quot;; if (a == b) { trace(&quot;David is David&quot;); } The following examples show how the equality operator does automatic type conversion when comparing by value. String values are converted to numbers: var a:Number = 5; var b:String = &quot;5&quot;; trace(a == b); // true Boolean values are converted to numbers, where true is converted to 1 and false is converted to 0: var c:Number = 1; var d:Boolean = true; trace(c == d); // true var e:Number = 0; var f:Boolean = false; trace(e == f); // true However, string values are not converted to Boolean values, so the following returns false: var g:String = &quot;true&quot;; var h:Boolean = true; trace(g == h); // false The following examples show comparison by reference. The first example compares two arrays with identical length and elements. The equality operator returns false for these two arrays. Although the arrays appear equal, comparison by reference requires that both firstArray and secondArray refer to the same array. The second example creates the thirdArray variable, which points to the same array as firstArray. The equality operator returns 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); // false /* Arrays are only considered equal if the variables refer to the same array. */ var thirdArray:Array = firstArray; trace(firstArray == thirdArray); // true"/>
<page href="operators.html#greater_than" title="greater than" text="greater than Compares two expressions and determines whether expression1 is greater than expression2; if it is, the result is true. If expression1 is less than or equal to expression2, the result is false. If both operands are of type String, the operands are compared using alphabetical order; all capital letters come before lowercase letters. Otherwise, operands are first converted to numbers, then compared. A string, integer, or floating-point number. The following example shows that strings are compared alphabetically, with capital letters before lowercase letters: var a:String = &quot;first&quot;; var b:String = &quot;First&quot;; trace(a &gt; b); // true b); // true The following example shows how String and Boolean values are converted to numbers: var c:Number = 5; var d:String = &quot;4&quot;; trace(c &gt; d); // true var e: Number = 2; var f:Boolean = true; trace(e &gt; f); // true d); // true var e: Number = 2; var f:Boolean = true; trace(e &gt; f); // true f); // true"/>
<page href="operators.html#greater_than_or_equal_to" title="greater than or equal to" text="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). A string, integer, or floating-point number. In the following example, the greater than or equal to (&amp;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;); }= 12) { trace(&quot;good afternoon&quot;); } else { trace(&quot;good morning&quot;); }"/>
<page href="operators.html#in" title="in" text="in Evaluates whether a property is part of a specific object. To use the in operator, specify a property name as the first operand and an object as the second operand. If the object you specify contains such a property, the result is true; otherwise the result is false. If the specified object is an Array object, you can use the in operator to check whether a particular index number is valid. If you pass an integer as the first operand, the result is true if the index is within the valid range of index numbers, and false otherwise. The following example uses the in operator to show that PI is a property of the Math object, but that myProperty is not. trace(&quot;PI&quot; in Math); // true trace(&quot;myProperty&quot; in Math); // false The following example uses the in operator to show that the numbers 0, 1, and 2 are valid index numbers in the myArray object, but that the number 3 is not. public var myArray:Array = [&quot;zero&quot;, &quot;one&quot;, &quot;two&quot;]; trace(0 in myArray); // true trace(1 in myArray); // true trace(2 in myArray); // true trace(3 in myArray); // false"/>
<page href="operators.html#increment" title="increment" text="increment Adds 1 to an expression. The expression can be a variable, an element in an array, or a 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). A number or a variable that evaluates to a number. The following example uses ++ as a pre-increment operator in a while loop to show that the value added to the array is the value that has been incremented: var preInc:Array = new Array(); var i:int = 0; while (i &amp;lt; 10) { preInc.push(++i); } trace(preInc); // 1,2,3,4,5,6,7,8,9,10 The following example uses ++ as a post-increment operator in a whileloop to show that the value added to the array is the initial value: var postInc:Array = new Array(); var i:int = 0; while (i &amp;lt; 10) { postInc.push(i++); } trace(postInc); // 0,1,2,3,4,5,6,7,8,9 The following example uses ++ as a post-increment operator to make a whileloop run five times: var i:int = 0; while (i++ &amp;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 */"/>
<page href="operators.html#inequality" title="inequality" text="inequality 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. If the data types of the two operands match, the definition of equal depends on the data type of the operands:  Values of type int, uint, and Boolean are considered equal if they have the same value. Numbers with matching values are considered equal, unless they are both NaN. If the value of both operands is null or undefined, they are considered equal. String expressions are equal if they have the same number of characters and the characters are identical. For XML objects:  If one operand is a text or attribute node and the other has simple content, both operands are converted to strings with the toString() method and are considered equal if the resulting strings match.  Otherwise, objects are considered equal only if the qualified name, attributes, and child properties for both objects match.   XMLList objects are considered equal if they have the same number of properties and both the order and values of the properties match. For Namespace objects, values are considered equal if the uri properties of both objects match. For QName objects, values are considered equal if the uri properties of both objects match and the localName properties of both objects match. 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.  If the data types of the operands do not match, the inequality operator (!=) returns true except in the following circumstances:  The operands' values are undefined and null, in which case the result is true. Automatic data type conversion converts the data types of String, Boolean, int, uint, and Number values to compatible types and the converted values are equal, in which case operands are considered equal. One operand is of type XML with simple content (hasSimpleContent() == true), and after both operands are converted to strings with the toString() method the resulting strings match. One operand is of type XMLList, and either of the following conditions is true:  The length property of the XMLList object is 0, and the other object is undefined. The length property of the XMLList object is 1, and one element of the XMLList object matches the other operand.    A number, string, Boolean value, variable, object, array, or function. The following example illustrates the result of the inequality (!=) operator: trace(5 != 8); // true trace(5 != 5); // 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 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"/>
<page href="operators.html#instanceof" title="instanceof" text="instanceof Evaluates whether an expression's prototype chain includes the prototype object for function. The instanceof operator is included for backward compatibility with ECMAScript edition 3, and may be useful for advanced programmers who choose to use prototype-based inheritance with constructor functions instead of classes. To check whether an object is a member of a specific data type, use the is operator. When used with classes, the instanceof operator is similar to the is operator because a class's prototype chain includes all of its superclasses. Interfaces, however, are not included on prototype chains, so the instanceof operator always results in false when used with interfaces, whereas the is operator results in true if an object belongs to a class that implements the specified interface. Note: The ActionScript is operator is the equivalent of the Java instanceof operator. The object that contains the prototype chain to evaluate. The following example creates an instance of the Sprite class named mySprite and uses the instanceof operator to test whether the prototype chain of mySprite includes the prototype objects of the Sprite and DisplayObject classes. The result is true with the Sprite class and the DisplayObject class because the prototype objects for Sprite and DisplayObject are on the prototype chain of mySprite. var mySprite:Sprite = new Sprite(); trace(mySprite instanceof Sprite); // true trace(mySprite instanceof DisplayObject); // true The following example uses the IBitmapDrawable interface to show that the instanceof operator does not work with interfaces. The is operator results in true because the DisplayObject class, which is a superclass of the Sprite class, implements the IBitmapDrawable interface. var mySprite:Sprite = new Sprite(); trace(mySprite instanceof IBitmapDrawable); // false trace(mySprite is IBitmapDrawable); // true"/>
<page href="operators.html#is" title="is" text="is Evaluates whether an object is compatible with a specific data type, class, or interface. Use the is operator instead of the instanceof operator for type comparisons. You can also use the is operator to check whether an object implements an interface. The following example creates an instance of the Sprite class named mySprite and uses the is operator to test whether mySprite is an instance of the Sprite and DisplayObject classes, and whether it implements the IEventDispatcher interface. import flash.display.*; import flash.events.IEventDispatcher; var mySprite:Sprite = new Sprite(); trace(mySprite is Sprite); // true trace(mySprite is DisplayObject); // true trace(mySprite is IEventDispatcher); // true"/>
<page href="operators.html#less_than" title="less than" text="less than Compares two expressions and determines whether expression1 is less than expression2; if so, the result is true. If expression1 is greater than or equal to expression2, the result is false. If both operands are of type String, the operands are compared using alphabetical order; all capital letters come before lowercase letters. Otherwise, operands are first converted to numbers, then compared. A string, integer, or floating-point number. The following examples show true and false results for both numeric and string comparisons: trace(5 &amp;lt; 10); // true trace(2 &amp;lt; 2); // false trace(10 &amp;lt; 3); // false trace(&quot;Allen&quot; &amp;lt; &quot;Jack&quot;); // true trace(&quot;Jack&quot; &amp;lt; &quot;Allen&quot;); // false trace(&quot;11&quot; &amp;lt; &quot;3&quot;); // true trace(&quot;11&quot; &amp;lt; 3); // false (numeric comparison) trace(&quot;C&quot; &amp;lt; &quot;abc&quot;); // true trace(&quot;A&quot; &amp;lt; &quot;a&quot;); // true"/>
<page href="operators.html#less_than_or_equal_to" title="less than or equal to" text="less than or equal to Compares two expressions and determines whether expression1 is less than or equal to expression2; if it is, the result is true. If  expression1 is greater than expression2, the result is false. If both operands are of type String, the operands are compared using alphabetical order; all capital letters come before lowercase letters. Otherwise, operands are first converted to numbers, then compared. A string, integer, or floating-point number. The following examples show true and false results for both numeric and string comparisons: trace(5 &amp;lt;= 10); // true trace(2 &amp;lt;= 2); // true trace(10 &amp;lt;= 3); // false trace(&quot;Allen&quot; &amp;lt;= &quot;Jack&quot;); // true trace(&quot;Jack&quot; &amp;lt;= &quot;Allen&quot;); // false trace(&quot;11&quot; &amp;lt;= &quot;3&quot;); // true trace(&quot;11&quot; &amp;lt;= 3); // false (numeric comparison) trace(&quot;C&quot; &amp;lt;= &quot;abc&quot;); // true trace(&quot;A&quot; &amp;lt;= &quot;a&quot;); // true"/>
<page href="operators.html#line_comment_delimiter" title="line comment delimiter" text="line comment delimiter Indicates the beginning of a script comment. Characters that appear between the comment delimiter (//) and the end-of-line character are interpreted as a comment and are ignored. Use this delimiter for single-line comments; for comments on multiple successive lines, use the /* and */ delimiters. Any characters. The following example shows a single-line comment: // Any text following a line comment delimiter is ignored during compilation"/>
<page href="operators.html#logical_AND" title="logical AND" text="logical AND Returns expression1 if it is false or can be converted to false, and expression2 otherwise. Examples of values that can be converted to false are 0, NaN, null, and undefined. If you use a function call as expression2, the function is not called if expression1 evaluates to false. If both operands are of type Boolean, the result is true only if both operands are true, as shown in the following table:   Expression  Evaluates    true &amp;amp;&amp;amp; true  true   true &amp;amp;&amp;amp; false  false   false &amp;amp;&amp;amp; false  false   false &amp;amp;&amp;amp; true  false   A value or expression of any type. The following example uses the logical AND (&amp;amp;&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 outputs &quot;You Win the Game!&quot; when the player's score reaches 75 or higher in three or fewer turns. var turns:Number = 2; var score:Number = 77; if ((turns &amp;lt;= 3) &amp;amp;&amp;amp; (score &amp;gt;= 75)) { trace(&quot;You Win the Game!&quot;); } else { trace(&quot;Try Again!&quot;); }"/>
<page href="operators.html#logical_AND_assignment" title="logical AND assignment" text="logical AND assignment Assigns expression1 the value of expression1 &amp;amp;&amp;amp; expression2. For example, the following two statements are equivalent: x &amp;amp;&amp;amp;= y; x = x &amp;amp;&amp;amp; y;  A value of any type. The following example modifies a variable named myTag if the variable does not evaluate to false. This technique takes advantage of the fact that the logical AND (&amp;amp;&amp;amp;) operator returns the value of expression1 if expression1 evaluates to false and otherwise returns the value of expression2. If myTag already contains a value that evaluates to true, myVar is modified to resemble an XML tag. However, if myVar contains a value that evaluates to false, such as the values null, &quot;&quot;(empty string), and undefined among others, myVar is unchanged. var myVar:String = 'tag'; myVar &amp;amp;&amp;amp;= &quot;&amp;lt;&quot; + myVar + &quot;/&amp;gt;&quot;; trace (myVar); // output: &amp;lt;tag/&amp;gt; The same effect can be achieved with an if statement, as shown in the following example: var myVar:String = 'tag'; if (myVar != '') { myVar = &quot;&amp;lt;&quot; + myVar + &quot;/&amp;gt;&quot;; } trace (myVar); // output: &amp;lt;tag/&amp;gt; The advantage of using an if statement is that the code is easier to read, whereas the advantage of using the logical AND assignment (&amp;amp;&amp;amp;=) operator is that it you need not specify the exact default value for a given data type."/>
<page href="operators.html#logical_NOT" title="logical NOT" text="logical NOT Inverts 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;&amp;amp; y evaluates to false, the expression !(x &amp;amp;&amp;amp; y) evaluates to true.  The following expressions illustrate the result of using the logical NOT (!) operator:  !true returns false. !false returns true. An expression or a variable that evaluates to a Boolean value. In 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 outputs a string. var happy:Boolean = false; if (!happy) { trace(&quot;don't worry, be happy&quot;); // don't worry, be happy } The trace statement executes because !false equals true."/>
<page href="operators.html#logical_OR" title="logical OR" text="logical OR Returns expression1 if it is true or can be converted to true, and expression2 otherwise. If you use a function call as expression2, the function is not called if expression1 evaluates to true. If both operands are of type Boolean, the result is true if either or both expressions are true; the result is false only if both expressions are false, as shown in the following table:    Expression  Evaluates    true || true  true   true || false  true   false || false  false   false || true  true   A value of any type. The following example uses the logical OR (||) operator in an if statement. The second expression evaluates to true, so the final result is true: var a:Number = 10; var b:Number = 250; var start:Boolean = false; if ((a &amp;gt; 25) || (b &amp;gt; 200) || (start)) { trace(&quot;the logical OR test passed&quot;); // the logical OR test passed } The message &quot;the logical OR test passed&quot; appears because one of the conditions in the if statement is true (b &gt; 200 200). The following example demonstrates how using a function call as the second operand 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;); }"/>
<page href="operators.html#logical_OR_assignment" title="logical OR assignment" text="logical OR assignment Assigns expression1 the value of expression1 || expression2. For example, the following two statements are equivalent: x ||= y; x = x || y;  A value of any type. The following example assigns a default value to a previously declared variable named myVar. This technique takes advantage of the fact that the logical OR (||) operator returns the value of expression1 if expression1 evaluates to true and otherwise returns the value of expression2. If myVar already contains a value that evaluates to true, myVar is unchanged. However, if myVar contains a value that evaluates to false, such as the values null, &quot;&quot;(empty string), and undefined among others, myVar is assigned the value &quot;default&quot;. myVar ||= &quot;default&quot;;"/>
<page href="operators.html#modulo" title="modulo" text="modulo Calculates the remainder of expression1 divided by expression2. If either operand is non-numeric, the modulo (%) operator attempts to convert it to a number. The sign of the modulo result matches the sign of the dividend (the first number). For example, -4 % 3 and -4 % -3 both evaluate to -1. A number or expression that evaluates to a number. A string that contains only numeric characters evaluates to a number. The following numeric example uses the modulo (%) operator: trace(12 % 5); // 2 trace(4.3 % 2.1); // 0.0999999999999996 trace(4 % 4); // 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."/>
<page href="operators.html#modulo_assignment" title="modulo assignment" text="modulo assignment Assigns expression1 the value of expression1 % expression2. The following two statements are equivalent: x %= y; x = x % y;  A number or expression that evaluates to a number. The following example assigns the value 4 to the variable a: var a:Number = 14; var b:Number = 5; a %= b; trace(a); // 4"/>
<page href="operators.html#multiplication" title="multiplication" text="multiplication Multiplies 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. A number or expression that evaluates to a number. The following statement multiplies the integers 2 and 3, resulting in the integer 6: trace(2*3); // 6 This statement multiplies the floating-point numbers 2.0 and 3.1416, resulting in 6.2832, which is a floating-point number: trace(2.0 * 3.1416); // 6.2832"/>
<page href="operators.html#multiplication_assignment" title="multiplication assignment" text="multiplication assignment Assigns expression1 the value of  expression1 * expression2. For example, the following two expressions are equivalent: x *= y x = x * y  A number or expression that evaluates to a number. The following example assigns the value 50 to the variable a: var a:Number = 5; var b:Number = 10; trace(a *= b); // 50 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 c and d: var i:Number = 5; var c:Number = 4 - 6; var d:Number = i + 2; trace(c *= d); // -14"/>
<page href="operators.html#name_qualifier" title="name qualifier" text="name qualifier Identifies the namespace of a property, a method, an XML property, or an XML attribute. The identifying namespace. The following example uses the :: operator to identify two methods that have the same name in two different namespaces: public class NamespaceExample extends Sprite { public namespace French; public namespace Hawaiian; public function NamespaceExample() { trace(Hawaiian::hello()); // aloha trace(French::hello()); // bonjour } Hawaiian function hello():String { return &quot;aloha&quot;; } French function hello():String { return &quot;bonjour&quot;; } } The following example uses the :: operator to identify XML properties with specified namespaces: var soap:Namespace = new Namespace(&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot;); var w:Namespace = new Namespace(&quot;http://weather.example.org/forecast&quot;); var myXML:XML = &amp;lt;soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot;&amp;gt; &amp;lt;soap:Body&amp;gt; &amp;lt;w:forecast xmlns:w=&quot;http://weather.example.org/forecast&quot;&amp;gt; &amp;lt;w:city&amp;gt;Quito&amp;lt;/w:city&amp;gt; &amp;lt;w:country&amp;gt;Ecuador&amp;lt;/w:country&amp;gt; &amp;lt;date&amp;gt;2006-01-14&amp;lt;/date&amp;gt; &amp;lt;/w:forecast&amp;gt; &amp;lt;/soap:Body&amp;gt; &amp;lt;/soap:Envelope&amp;gt;; trace(myXML.soap::Body.w::forecast.w::city); // Quito"/>
<page href="operators.html#new" title="new" text="new Instantiates a class instance. The new operator can be used with a class or a variable of type Class to create an instance of a class. The new operator is commonly used with a class object to create an instance of a class. For example, the statement new Sprite() creates an instance of the Sprite class. The new operator can also be used to associate a class with an embedded asset, which is an external object such as an image, sound, or font that is compiled into a SWF file. Each embedded asset is represented by a unique embedded asset class. To access an embedded asset, you must use the new operator to instantiate its associated class. Subsequently, you can call the appropriate methods and properties of the embedded asset class to manipulate the embedded asset. If you prefer to define classes with Function objects instead of the class keyword, you can use the new operator to create objects based on constructor functions. Do not confuse constructor functions with constructor methods of a class. A constructor function is a Function object that is defined with the function keyword, but that is not part of a class definition. If you use constructor functions to create objects, you must use prototype inheritance instead of class inheritance. A class, a function, or a variable that holds a value of type Class. The following example creates the Book class and uses the new operator to create the objects book1 and book2. class Book { var bName:String; var bPrice:Number; public function Book(nameParam:String, priceParam:Number){ bName = nameParam; bPrice = priceParam; } } var book1:Book = new Book(&quot;Confederacy of Dunces&quot;, 19.95); var book2:Book = new Book(&quot;The Floating Opera&quot;, 10.95); trace(book1); // [object Book] The following example uses the new operator to create an instance of the Array class with 18 elements: var golfCourse:Array = new Array(18);"/>
<page href="operators.html#object_initializer" title="object initializer" text="object initializer 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.  The object to create. The 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;Adobe Systems, Inc.&quot;, address:&quot;601 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 code uses the information in the previous example and produces the same result using a constructor function: 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;;"/>
<page href="operators.html#parentheses" title="parentheses" text="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 arguments to a function that precedes the parentheses. Usage 1: Controls the order in which the operators execute. 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 to the function that precedes the parentheses. An expression, which can include numbers, strings, variables, or text. Usage 1: The following statements show the use of parentheses to control the order in which expressions are executed: trace((2 + 3) * (4 + 5)); // 45 trace(2 + (3 * (4 + 5))); // 29 trace(2 + (3 * 4) + 5); // 19 trace(2 + (3 * 4) + 5); // 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)); // 23 Usage 3: The following example shows the use of parentheses with functions: var today:Date = new Date(); trace(today.getFullYear()); // outputs current year function traceParameter(param):void { trace(param); } traceParameter(2 * 2); // 4"/>
<page href="operators.html#parentheses_(XML)" title="parentheses (XML)" text="parentheses (XML) Evaluates an expression in an ECMAScript for XML (E4X) XML construct. For example, myXML.(lastName == &quot;Smith&quot;) identifies XML elements with the name lastName and the value &quot;Smith&quot;. The result is an XMLList object. An XML or XMLList object. The following example shows how parentheses are used to identify elements and attributes: var myXML:XML = &amp;lt;employees&amp;gt; &amp;lt;employee id = &quot;42&quot;&amp;gt; &amp;lt;firstName&amp;gt;Joe&amp;lt;/firstName&amp;gt; &amp;lt;lastName&amp;gt;Smith&amp;lt;/lastName&amp;gt; &amp;lt;/employee&amp;gt; &amp;lt;employee id = &quot;43&quot;&amp;gt; &amp;lt;firstName&amp;gt;Susan&amp;lt;/firstName&amp;gt; &amp;lt;lastName&amp;gt;Jones&amp;lt;/lastName&amp;gt; &amp;lt;/employee&amp;gt; &amp;lt;employee id = &quot;44&quot;&amp;gt; &amp;lt;firstName&amp;gt;Anne&amp;lt;/firstName&amp;gt; &amp;lt;lastName&amp;gt;Smith&amp;lt;/lastName&amp;gt; &amp;lt;/employee&amp;gt; &amp;lt;/employees&amp;gt;; trace(myXML.employee.(lastName == &quot;Smith&quot;).@id.toXMLString()); // 42 // 44 trace(myXML.employee.(Number(@id) &gt; 42).@id.toXMLString()); // 43 // 44 42).@id.toXMLString()); // 43 // 44"/>
<page href="operators.html#RegExp_delimiter" title="RegExp delimiter" text="RegExp delimiter When used before and after characters, indicates that the characters have a literal value and are considered a regular expression (RegExp), not a variable, string, or other ActionScript element. Note, however, that two sequential forward slash characters (//) indicate the beginning of a comment. A sequence of one or more characters, defining the pattern of the regular expression. The following example uses forward slash characters (/) to set the value of a variable of type RegExp (the i flag is set, to ignore case sensitivity when matching): var myRegExp:RegExp = /foo-\d+/i; trace(myRegExp.exec(&quot;ABC Foo-32 def.&quot;)); // Foo-32"/>
<page href="operators.html#strict_equality" title="strict equality" text="strict equality Tests two expressions for equality, but does not perform automatic data conversion. The result is true if both expressions, including their data types, are equal. The strict equality (===) operator is the same as the equality (==) operator in three ways:  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.  The strict equality (===) operator differs from the equality (==) operator in only two ways:  The strict equality operator performs automatic data conversion only for the number types (Number, int, and uint), whereas the equality operator performs automatic data conversion for all primitive data types. When comparing null and undefined, the strict equality operator returns false.  The strict equality operator generates different results in ActionScript 3.0 than it did in ActionScript 2.0 in two situations involving primitive values (for example, var x:Number = 1) with primitive objects (for example, var x:Number = new Number(1)). This is because ActionScript 3.0 removes the distinction between primitive values and primitive wrapper objects. First, comparisons between primitive values and primitive objects that contain the same value return true in ActionScript 3.0, but false in earlier versions. In earlier versions, the data type of a primitive value is either Boolean, Number, or String, whereas the data type of a primitive object is always Object rather than Boolean, Number or String. The practical effect of this difference is that the following code results in false in previous versions of ActionScript because the data types of the operands do not match, but the result is true in ActionScript 3.0 because primitive values are typed as either Boolean, Number, int, uint, or String, whether they are wrapped in an object or not.  var num1:Number = 1; var num2:Number = new Number(1); trace(num1 === num2); // true in ActionScript 3.0, false in ActionScript 2.0  Second, comparisons between two primitive objects that contain the same value result in true in ActionScript 3.0, but false in previous versions.  var num1:Number = new Number(1); var num2:Number = new Number(1); trace(num1 == num2); // true in ActionScript 3.0, false in ActionScript 2.0 trace(num1 === num2); // true in ActionScript 3.0, false in ActionScript 2.0 This is because in previous versions of ActionScript, both variables belong to the data type Object, so they are compared by reference and the result is false for both the equality and strict equality operations. In ActionScript 3.0, however, both variables belong to the data type Number, so they are compared by value and the result is true for both the equality and strict equality operators. A number, string, Boolean value, variable, object, array, or function. The following example shows that strict equality (===) is the same as equality (==) when both the value and data types match: var string1:String = &quot;5&quot;; var string2:String = &quot;5&quot;; trace(string1 == string2); // true trace(string1 === string2); // true The following example shows that the strict equality operator does not convert the String data type to Number, but the equality (==) operator does: // The equality (==) operator converts 5 to &quot;5&quot;, but the strict equality operator does not var string1:String = &quot;5&quot;; var num:Number = 5; trace(string1 == num); // true trace(string1 === num); // false The following example shows that the strict equality operator does not convert Boolean values to numbers, but the equality operator does: var num:Number = 1; var bool:Boolean = true; trace(num == bool); // true trace(num === bool); // false The following example shows that the strict equality operator does convert int and uint data types: var num1:Number = 1; var num2:int = 1; var num3:uint = 1; trace(num1 === num2); // true trace(num1 === num3); // true The following example shows that the strict equality operator considers null and undefined not equal, but the equality operator considers them equal: trace(null == undefined); // true trace(null === undefined); // false"/>
<page href="operators.html#strict_inequality" title="strict inequality" text="strict inequality Tests for the exact opposite of the strict equality (===) operator. The strict inequality operator performs the same as the inequality operator except that only the int and uint data types are converted. If expression1 is equal to expression2, and their data types are equal, the result is false. The strict inequality (!==) operator is the same as the inequality (!=) operator in three ways:  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.  The strict inequality operator differs from the inequality (!=) operator in only two ways:  The strict inequality (!==) operator performs automatic data conversion only for the number types, Number, int, and uint, whereas the inequality (!=) operator performs automatic data conversion for all primitive data types. When comparing null and undefined, the strict inequality (!==) operator returns true.  A number, string, Boolean value, variable, object, array, or function. The 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"/>
<page href="operators.html#string_delimiter" title="string delimiter" text="string delimiter When used before and after characters, indicates that the characters have a literal value and are considered a string, not a variable, numerical value, or other ActionScript element. A sequence of zero or more characters. The 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. var yourGuess:String = &quot;Prince Edward Island&quot;; submit_btn.onRelease = function() { trace(yourGuess); }; // Prince Edward Island"/>
<page href="operators.html#subtraction" title="subtraction" text="subtraction Used for negating or subtracting.  Usage 1: When used for negating, the operator reverses the sign of a numerical expression. Usage 2: When used for subtracting, the operator 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. A number or expression that evaluates to a number. Usage 1: The following statement reverses the sign of the expression 2 + 3: trace(-(2 + 3)); // -5 Usage 2: The following statement subtracts the integer 2 from the integer 5: trace(5 - 2); // 3 The result, 3, is an integer. The following statement subtracts the floating-point number 1.5 from the floating-point number 3.25: trace(3.25 - 1.5); // 1.75 The result, 1.75, is a floating-point number."/>
<page href="operators.html#subtraction_assignment" title="subtraction assignment" text="subtraction assignment Assigns 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, the result is NaN (not a number). A number or expression that evaluates to a number. The 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); // -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); // -5"/>
<page href="operators.html#type" title="type" text="type Used for assigning a data type; 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's type; when used in a function declaration or definition, this operator specifies the function's return type; when used with a function parameter in a function definition, this operator specifies the variable type expected for that parameter. Type checking always occurs at run time. However, when the compiler is set to strict mode, all types are also 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. Types that you can use include all native object types, classes and interfaces that you define, and void. The recognized native types are Boolean, Number, int, uint, and String. All built-in classes are also supported as native types. If you do not assign a data type, the variable, function return value, or function parameter is considered untyped, which means that the value can be of any data type. If you wish to make clear your intent to use an untyped value, you can use the asterisk (~~) character as the type annotation. When used as a type annotation, the asterisk character is equivalent to leaving a variable, function return type, or function parameter untyped. An identifier for a variable. Usage 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's return type by defining a function named randomInt() that specifies its return type as int: function randomInt(integer:int):int { 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));"/>
<page href="operators.html#typeof" title="typeof" text="typeof Evaluates expression and returns a string specifying the expression's data type. The result is limited to six possible string values: boolean, function, number, object, string, and xml. If you apply this operator to an instance of a user-defined class, the result is the string object. The typeof operator is included for backward compatibility. Use the is operator to check type compatibility. An object to evaluate. The following example shows the result of using typeof on various objects and values. trace(typeof Array); // object trace(typeof Date); // object trace(typeof 3); // number The following example shows that in ActionScript 3.0, the data type of a primitive object is the same whether you assign a literal value or use the new operator to create an object. This differs from previous versions of ActionScript in which the typeof operator returns object for variable b: var a:String = &quot;sample&quot;; var b:String = new String(&quot;sample&quot;); trace(typeof a); // string trace(typeof b); // string"/>
<page href="operators.html#void" title="void" text="void Evaluates an expression and then discards its value, returning undefined. The void operator is often used in comparisons that use the == operator to test for undefined values. An expression to be evaluated."/>
<page href="operators.html#XML_literal_tag_delimiter" title="XML literal tag delimiter" text="XML literal tag delimiter Defines an XML tag in an XML literal. Use the forward slash / to define the closing tag. An XML or XMLList object. The following example shows how to use the &amp;lt; and &amp;gt; operators when defining an XML literal: var x:XML = &amp;lt;item id= &quot;324&quot;&amp;gt;cola&amp;lt;/item&amp;gt;;"/>

	<page href="statements.html" title="statements" text="statements Statements are language elements that perform or specify an action at runtime. For example, the return statement returns a result value for 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. Attribute keywords alter the meaning of definitions, and can be applied to class, variable, function, and namespace definitions. Definition keywords are used to define entities such as variables, functions, classes, and interfaces. Primary expression keywords represent literal values. For a list of reserved words, see Programming ActionScript 3.0. Directives include statements and definitions and can have an effect at compile time or runtime. Directives that are neither statements nor definitions are labeled as directives in the following table."/>
<page href="statements.html#..._(rest)_parameter" title="... (rest) parameter" text="... (rest) parameter Specifies that a function will accept any number of comma-delimited arguments. The list of arguments becomes an array that is available throughout the function body. The name of the array is specified after the ... characters in the parameter declaration. The parameter can have any name that is not a reserved word. If used with other parameters, the ... (rest) parameter declaration must be the last parameter specified. The ... (rest) parameter array is populated only if the number of arguments passed to the function exceeds the number of other parameters. Each argument in the comma-delimited list of arguments is placed into an element of the array. If you pass an instance of the Array class, the entire array is placed into a single element of the ... (rest) parameter array. Use of this parameter makes the arguments object unavailable. Although the ... (rest) parameter gives you the same functionality as the arguments array and arguments.length property, it does not provide functionality similar to that provided by arguments.callee. Make sure you do not need to use arguments.callee before using the ... (rest) parameter. rest An identifier that represents the name of the array of arguments passed in to the function. The parameter does not need to be called rest; it can have any name that is not a keyword. You can specify the data type of the ... (rest) parameter as Array, but this could cause confusion because the parameter accepts a comma-delimited list of values, which is not identical to an instance of the Array class. The following example uses the ... (rest) parameter in two different functions. The first function, traceParams, simply calls the trace() function on each of the arguments in the rest array. The second function, average(), takes the list of arguments and returns the average. The second function also uses a different name, args, for the parameter. package { import flash.display.MovieClip; public class RestParamExample extends MovieClip { public function RestParamExample() { traceParams(100, 130, &quot;two&quot;); // Output: 100,130,two trace(average(4, 7, 13)); // Output: 8 } } } function traceParams(... rest) { trace(rest); } function average(... args) : Number{ var sum:Number = 0; for (var i:uint = 0; i &amp;lt; args.length; i++) { sum += args[i]; } return (sum / args.length); }"/>
<page href="statements.html#AS3" title="AS3" text="AS3 Defines methods and properties of the core ActionScript classes that are fixed properties instead of prototype properties. When you set the &quot;-as3&quot; compiler option to true (which is the default setting in Flex Builder 2), the AS3 namespace is automatically opened for all the core classes. This means that an instance of a core class will use fixed properties and methods instead of the versions of those same properties and methods that are attached to the class's prototype object. The use of fixed properties usually provides better performance, but at the cost of backward compatibility with the ECMAScript edition 3 language specification (ECMA-262)."/>
<page href="statements.html#break" title="break" text="break Appears within a loop (for, for..in, for each..in, do..while, or while) or within a block of statements associated with a particular case in 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 that follows the enclosing switch statement. In nested loops, break only skips the rest of the immediate loop and does not break out of the entire series of nested loops. To break out of an entire series of nested loops, use label or try..catch..finally. The break statement can have an optional label that must match an outer labeled statement. Use of a label that does not match the label of an outer statement is a syntax error. Labeled break statements can be used to break out of multiple levels of nested loop statements, switch statements, or block statements. For an example, see the entry for the label statement. label The name of a label associated with a statement. The following example uses break to exit an otherwise infinite loop: var i:int = 0; while (true) { trace(i); if (i &gt;= 10) { break; // this will terminate/exit the loop } i++; } /* output: 0 1 2 3 4 5 6 7 8 9 10*/= 10) { break; // this will terminate/exit the loop } i++; } /* output: 0 1 2 3 4 5 6 7 8 9 10*/"/>
<page href="statements.html#case" title="case" text="case Defines a jump target for the switch statement. If the jumpTarget parameter equals the expression parameter of the switch statement using strict equality (===), Flash Player executes the statements in the statements 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't compile. Note: Always end the statements parameter with a break statement. If you omit the break statement from the statements parameter, it continues executing with the next case statement instead of exiting the switch statement. jumpTarget Any expression. The following example defines jump targets for the switch statement thisMonth. If thisMonth equals the expression in the case statement, the statement executes. var thisMonth:int = 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;); }"/>
<page href="statements.html#class" title="class" text="class Defines a 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. Each ActionScript source file can contain only one class that is visible to other source files or scripts. The externally visible class can be a public or internal class, and must be defined inside a package statement. If you include other classes in the same file, the classes must be placed outside of the package statement and at the end of the file.  The name of the externally visible class must match the name of the ActionScript source file that contains the class. The name of the source 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. You cannot nest class definitions; that is, you cannot define additional classes within a class definition. You can define a constructor method, which is a method that is executed whenever a new instance of the class is created. The name of the constructor method must match the name of the class. If you do not define a constructor method, a default constructor is created for you. 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  className The fully qualified name of the class. The following example creates a class called Plant. The Plant constructor takes two parameters. // Filename Plant.as package { public class Plant { // Define property names and types private var _leafType:String; private var _bloomSeason:String; // Following line is constructor // because it has the same name as the class public function Plant(param_leafType:String, param_bloomSeason:String) { // Assign passed values to properties when new Plant object is created _leafType = param_leafType; _bloomSeason = param_bloomSeason; } // Create methods to return property values, because best practice // recommends against directly referencing a property of a class public function get leafType():String { return _leafType; } public function get bloomSeason():String { return _bloomSeason; } } } In your script, 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.leafType); trace(pineTree.bloomSeason);"/>
<page href="statements.html#const" title="const" text="const Specifies a constant, which is a variable that can be assigned a value only once. You can strictly type a constant by appending a colon (:) character followed by the data type. identifier An identifier for the constant. The following example shows that an error occurs if you attempt to assign a value to a constant more than once. const MIN_AGE:int = 21; MIN_AGE = 18; // error The following example shows that if the constant is an array, you can still call Array class methods, including Array.push(). However, you cannot assign a new array literal. const product_array:Array = new Array(&quot;Studio&quot;, &quot;Dreamweaver&quot;, &quot;Flash&quot;, &quot;ColdFusion&quot;, &quot;Contribute&quot;, &quot;Breeze&quot;); product_array.push(&quot;Flex&quot;); // array operations are allowed product_array = [&quot;Other&quot;]; // assignment is an error trace(product_array);"/>
<page href="statements.html#continue" title="continue" text="continue Jumps past all remaining statements in the innermost loop and starts the next iteration of the loop as if control had passed to the end of the loop normally. The continue statement has no effect outside a loop. In nested loops, use the optional label parameter to skip more than just the innermost loop. The continue statement can have an optional label that must match an outer labeled statement. Use of a label that does not match the label of an outer statement is a syntax error. Labeled continue statements can be used to skip multiple levels of nested loop statements. In the following while loop, the continue statement is used to skip the rest of the loop body whenever a multiple of 3 is encountered and jump to the top of the loop, where the condition is tested: var i:int = 0; while (i &amp;lt; 10) { if (i % 3 == 0) { i++; continue; } trace(i); i++; } In a for loop, the continue statement can also be used to skip the rest of the loop body. In the following example, if the i % 3 equals 0, the trace(i) statement is skipped: for (var i:int = 0; i &amp;lt; 10; i++) { if (i % 3 == 0) { continue; } trace(i); }"/>
<page href="statements.html#default" title="default" text="default Defines the default case for a switch statement. The statements execute if the expression parameter of the switch statement doesn't equal (using the strict equality [===] operation) any of the expression parameters that follow the case keywords for a given switch statement. A switch statement does not require 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't compile. statements Any statements. In the following example, if the day of the week is Saturday or Sunday, none of the case statements apply, so execution moves to the default statement. var dayOfWeek:int = 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;); }"/>
<page href="statements.html#default_xml_namespace" title="default xml namespace" text="default xml namespace The default xml namespace directive sets the default namespace to use for XML objects. If you do not set default xml namespace, the default namespace is the unnamed namespace (with the URI set to an empty string). The scope of a default xml namespace declaration is within a function block, like the scope of a variable.  The following example shows that the scope of default xml namespace is a function block: var nsDefault1:Namespace = new Namespace(&quot;http://www.example.com/namespaces/&quot;); default xml namespace = nsDefault1; var x1:XML = &amp;lt;test1 /&amp;gt;; trace(&quot;x1 ns: &quot; + x1.namespace()); scopeCheck(); var x2:XML = &amp;lt;test2 /&amp;gt;; trace(&quot;x2 ns: &quot; + x2.namespace()); function scopeCheck(): void { var x3:XML = &amp;lt;test3 /&amp;gt;; trace(&quot;x3 ns: &quot; + x3.namespace()); var nsDefault2:Namespace = new Namespace(&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;); default xml namespace = nsDefault2; var x4:XML = &amp;lt;test4 /&amp;gt;; trace(&quot;x4 ns: &quot; + x4.namespace()); } The trace() output for this example is the following: x1 ns: http://www.example.com/namespaces/ x3 ns: x4 ns: http://schemas.xmlsoap.org/soap/envelope/ x2 ns: http://www.example.com/namespaces/ The following example uses default xml namespace to assign the default namespace. The second XML object (x2) does not use this setting because x2 defines its own default namespace: var nsDefault:Namespace = new Namespace(&quot;http://www.example.com/namespaces/&quot;); default xml namespace = nsDefault; var x1:XML = &amp;lt;test1 /&amp;gt;; trace(x1.namespace()); // http://www.example.com/namespaces/ var x2:XML = &amp;lt;test2 xmlns = &quot;http://www.w3.org/1999/XSL/Transform/&quot; /&amp;gt;; trace(x2.namespace()); // http://www.w3.org/1999/XSL/Transform/ var x3:XML = &amp;lt;test3 xmlns:soap-env=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; /&amp;gt;; trace(x3.namespace()); // http://www.example.com/namespaces/"/>
<page href="statements.html#do..while" title="do..while" text="do..while 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 you can also do this 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, 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. condition The condition to evaluate. The statement(s) within the do block of code will execute as long as the condition parameter evaluates to true . The following example uses a do..while loop to evaluate whether a condition is true, and traces myVar until myVar is 5 or greater. When myVar is 5 or greater, the loop ends. var myVar:Number = 0; do { trace(myVar); myVar++; } while (myVar &amp;lt; 5); /* output: 0 1 2 3 4 */"/>
<page href="statements.html#dynamic" title="dynamic" text="dynamic Specifies that instances of a class may possess dynamic properties added at runtime. If you use the dynamic attribute on a class, you can add properties to instances of that class at runtime. Classes that are not marked as dynamic are considered sealed, which means that properties cannot be added to instances of the class. If a class is sealed (not dynamic), attempts to get or set properties on class instances result in an error. If you have your compiler set to strict mode and you specify the data type when you create instances, attempts to add properties to sealed objects generate a compiler error; otherwise, a runtime error occurs. The dynamic attribute is not inherited by subclasses. If you extend a dynamic class, the subclass is dynamic only if you declare the subclass with the dynamic attribute. Note: This keyword is supported only when used in external script files, not in scripts written in the Actions panel. The following example creates two classes, one dynamic class named Expando and one sealed class named Sealed, that are used in subsequent examples. package { dynamic class Expando { } class Sealed { } } The following code creates an instance of the Expando class and shows that you can add properties to the instance. var myExpando:Expando = new Expando(); myExpando.prop1 = &quot;new&quot;; trace(myExpando.prop1); // output: new The following code creates an instance of the Sealed class and shows that attempts to add a property result in an error. var mySealed:Sealed = new Sealed(); mySealed.prop1 = &quot;newer&quot;; // error"/>
<page href="statements.html#else" title="else" text="else Specifies the statements to run if the condition in the if statement returns false. The curly braces ({}) that enclose the statements to be executed by the else statement are not necessary if only one statement will execute. condition An expression that evaluates to true or false. In 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&amp;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&amp;gt;18) { trace(&quot;welcome, user&quot;); } else trace(&quot;sorry, junior&quot;); The following example uses a combination of the if and else statements to compare score_txtto a specified value: if (score_txt.text&amp;gt;90) { trace(&quot;A&quot;); } else if (score_txt.text&amp;gt;75) { trace(&quot;B&quot;); } else if (score_txt.text&amp;gt;60) { trace(&quot;C&quot;); } else { trace(&quot;F&quot;); }"/>
<page href="statements.html#extends" title="extends" text="extends Defines a class that is a subclass of another class. The subclass inherits all the methods, properties, functions, and so on that are defined in the superclass. Classes that are marked as final cannot be extended. You can also use the extends keyword to extend an interface. An interface that extends another interface includes all the original interface's method declarations. 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's Publish Settings dialog box. This keyword is supported only when used in external script files, not in scripts written in the Actions panel. className The name of the class you are defining. In 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: package { class Vehicle { var numDoors:Number; var color:String; public function Vehicle(param_numDoors:Number = 2, param_color:String = null) { numDoors = param_numDoors; color = param_color; } public function start():void { trace(&quot;[Vehicle] start&quot;); } public function stop():void { trace(&quot;[Vehicle] stop&quot;); } public function reverse():void { trace(&quot;[Vehicle] reverse&quot;); } } } The following example shows a second ActionScript 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's antitheft alarm. Third, it overrides the stop() function to add the fact that the Car class uses an antilock braking system to stop. package { public class Car extends Vehicle { var fullSizeSpare:Boolean; public function Car(param_numDoors:Number, param_color:String, param_fullSizeSpare:Boolean) { numDoors = param_numDoors; color = param_color; fullSizeSpare = param_fullSizeSpare; } public function activateCarAlarm():void { trace(&quot;[Car] activateCarAlarm&quot;); } public override function stop():void { trace(&quot;[Car] stop with antilock 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] activateCarAlarm You could also write a subclass of the Vehicle class using the super statement, which the subclass can use to access the constructor of the superclass. The following example shows a third ActionScript file, called Truck.as, again in the same directory. The Truck class uses super in the constructor and in the overridden reverse() method. package { class Truck extends Vehicle { var numWheels:Number; public function Truck(param_numDoors:Number, param_color:String, param_numWheels:Number) { super(param_numDoors, param_color); numWheels = param_numWheels; } public override function reverse():void { beep(); super.reverse(); } public 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] stop"/>
<page href="statements.html#false" title="false" text="false A Boolean value representing false. A Boolean value is either true or false; the opposite of false is 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;. Note: The string &quot;false&quot; converts to the Boolean value true. This 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 0 trace(1 + bool1); // outputs 1 // converts it to a string trace(&quot;String: &quot; + bool1); // outputs String: false The following example shows that the string &quot;false&quot; converts to the Boolean value true: trace(Boolean(&quot;false&quot;)); // output: true if (&quot;false&quot;) { trace(&quot;condition expression evaluated to true&quot;); } else { trace(&quot;condition expression evaluated to false&quot;); } // output: condition expression evaluated to true"/>
<page href="statements.html#final" title="final" text="final Specifies that a method cannot be overridden or that a class cannot be extended. An attempt to override a method, or extend a class, marked as final results in an error. methodName The name of the method that cannot be overridden."/>
<page href="statements.html#flash_proxy" title="flash_proxy" text="flash_proxy Defines methods of the Proxy class. The Proxy class methods are in their own namespace to avoid name conflicts in situations where your Proxy subclass contains instance method names that match any of the Proxy class method names."/>
<page href="statements.html#for" title="for" text="for 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 next is evaluated. The looping sequence then begins again with the evaluation of the condition expression. The curly braces ({}) that enclose the block of statements to be executed by the for statement are not necessary if only one statement will execute. init An optional expression to evaluate before beginning the looping sequence; usually an assignment expression. A var statement is also permitted for this parameter. The following example uses for to add the elements in an array: var my_array:Array = new Array(); for (var i:Number = 0; i &amp;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 &amp;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 &amp;lt;= 100; i++) sum += i; trace(sum); // output: 5050"/>
<page href="statements.html#for..in" title="for..in" text="for..in Iterates over the dynamic properties of an object or elements in an array and executes statement for each property or element. Object properties are not kept in any particular order, so properties may appear in a seemingly random order. Fixed properties, such as variables and methods defined in a class, are not enumerated by the for..in statement. To get a list of fixed properties, use the describeType() function, which is in the flash.utils package. variableIterant The name of a variable to act as the iterant, referencing each property of an object or element in an array. The following example uses 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 uses the typeof operator with for..in to iterate over a particular type of child: var myObject:Object = {firstName:&quot;Tara&quot;, age:27, city:&quot;San Francisco&quot;}; for (var name in myObject) { if (typeof (myObject[name]) == &quot;string&quot;) { trace(&quot;I have a string property named &quot;+name); } } /* output: I have a string property named city I have a string property named firstName */"/>
<page href="statements.html#for_each..in" title="for each..in" text="for each..in Iterates over the items of a collection and executes statement for each item. Introduced as a part of the E4X language extensions, the for each..in statement can be used not only for XML objects, but also for objects and arrays. The for each..in statement iterates only through the dynamic properties of an object, not the fixed properties. A fixed property is a property that is defined as part of a class definition. To use the for each..in statement with an instance of a user-defined class, you must declare the class with the dynamic attribute. Unlike the for..in statement, the for each..in statement iterates over the values of an object's properties, rather than the property names. variableIterant The name of a variable to act as the iterant, referencing the item in a collection. The following example uses for each..in to iterate over the values held by the properties of an object: var myObject:Object = {firstName:&quot;Tara&quot;, age:27, city:&quot;San Francisco&quot;}; for each (var item in myObject) { trace(item); } /* output: Tara 27 San Francisco */ The following example uses for each..in to iterate over the elements of an array: var myArray:Array = new Array(&quot;one&quot;, &quot;two&quot;, &quot;three&quot;); for each(var item in myArray) trace(item); /* output: one two three */ The following example uses the is operator with for each..in to iterate over a particular type of child: var myObject:Object = {firstName:&quot;Tara&quot;, age:27, city:&quot;San Francisco&quot;}; for each (var item in myObject) { if (item is String) { trace(&quot;I have a string property with value &quot; + item); } } /* output: I have a string property with value Tara I have a string property with value San Francisco */ The following example shows using for each..in to iterate over the properties in an XMLList object (doc.p): var doc:XML = &amp;lt;body&amp;gt; &amp;lt;p&amp;gt;Hello&amp;lt;/p&amp;gt; &amp;lt;p&amp;gt;Hola&amp;lt;/p&amp;gt; &amp;lt;hr /&amp;gt; &amp;lt;p&amp;gt;Bonjour&amp;lt;/p&amp;gt; &amp;lt;/body&amp;gt;; for each (var item in doc.p) { trace(item); } /* output: Hello Hola Bonjour */"/>
<page href="statements.html#function" title="function" text="function 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 the function in different situations. Use the return statement in a function's statement(s) block to cause a function to generate, or return, a value. Usage 1: You can use the function keyword to define a function with the specified function name, parameters, and statements. When a script calls a function, the statements in the function'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.  Usage 2: You can also use function 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. The arguments object is commonly used to create a function that accepts a variable number of parameters and to create a recursive anonymous function. functionName The name of the new function. The following example defines the function sqr, which returns the value of a number squared: function sqr(xNum:Number) { return Math.pow(xNum, 2); } var yNum:Number = sqr(3); trace(yNum); // output: 9 If the function is defined and used in the same script, the function definition can appear after the function is used: var yNum:Number = sqr(3); trace(yNum); // output: 9 function sqr(xNum:Number) { return Math.pow(xNum, 2); }"/>
<page href="statements.html#get" title="get" text="get Defines a getter, which is a method that can be read like a property. A getter is a special function that returns the value of a property declared with the var or const keyword. Unlike other methods, a getter is called without parentheses (()), which makes the getter appear to be a variable. Getters allow you to apply the principle of information hiding by letting you create a public interface for a private property. The advantage of information hiding is that the public interface remains the same even if the underlying implementation of the private property changes. Another advantage of getters is that they can be overridden in subclasses, whereas properties declared with var or const cannot. A getter can be combined with a setter to create a read-write property. To create a read-only property, create a getter without a corresponding setter. To create a write-only property, create a setter without a corresponding getter. 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's Publish Settings dialog box. This keyword is supported only when used in external script files, not in scripts written in the Actions panel. property The identifier for the property that get accesses; this value must be the same as the value used in the corresponding set command. The following example defines a Team class. The Team class includes getter and setter methods that let you retrieve and set properties within the class: package { public class Team { var teamName:String; var teamCode:String; var teamPlayers:Array = new Array(); public function Team(param_name:String, param_code:String) { teamName = param_name; teamCode = param_code; } public function get name():String { return teamName; } public function set name(param_name:String):void { teamName = param_name; } } } Enter the following code in your script: 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 a getter method to return the value of the property."/>
<page href="statements.html#if" title="if" text="if Evaluates a condition to determine the next statement to execute. If the condition is true, Flash Player runs the statements that follow the condition inside curly braces ({}). If the condition is false, Flash Player skips the statements inside the curly braces and runs the statements following the curly braces. Use the if statement along with the else statement to create branching logic in your scripts. The curly braces ({}) that enclose the statements to be executed by the if statement are not necessary if only one statement will execute. condition An expression that evaluates to true or false."/>
<page href="statements.html#implements" title="implements" text="implements Specifies that a class implements one or more interfaces. When a class implements an interface, the class must define all the methods declared in the interface. Any instance of a class that implements an interface is considered a member of the data type defined by the interface. As a result, the is operator returns true when the class instance is the first operand and the interface is the second; in addition, type coercions to and from the data type defined by the interface work. 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's Publish Settings dialog box. This keyword is supported only when used in external script files, not in scripts written in the Actions panel."/>
<page href="statements.html#import" title="import" text="import Makes externally defined classes and packages available to your code. For example, if you want to use the flash.display.Sprite class in a script, you must import it. This requirement is different from previous versions of ActionScript, in which the import directive was optional. After using the import directive, you can use the full class name, which includes the package name, or just the name of the class.  import flash.display.Sprite; // name of class only var mySprite:Sprite = new Sprite(); // full class name var mySprite:flash.display.Sprite = new flash.display.Sprite();  If there are several classes in the package that you want to access, you can import them all in a single statement, as shown in the following example: import flash.display.*; The import directive imports only the classes, functions, and variables that reside at the top level of the imported package. Nested packages must be explicitly imported. If you import a class but do not use it in your script, the class is not 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. One disadvantage of importing classes that you do not need is that you increase the likelihood of name collisions. The import directive applies only to the current script (frame or object) in which it's called. For example, suppose on Frame 1 of a Flash document you import all the classes in the adobe.example package. On that frame, you can reference classes in that package by their simple names:  // On Frame 1 of a FLA: import adobe.example.*; 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 adobe.example.foo();) or add an import directive to the other frame that imports the classes in that package.  packageName The name of a package you have defined in a separate class file."/>
<page href="statements.html#include" title="include" text="include 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 included file, you must save the file and recompile any SWF files that use it."/>
<page href="statements.html#interface" title="interface" text="interface Defines an interface. Interfaces are data types that define a set of methods; the methods must be defined by any class that implements the 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. Interface method definitions cannot have any attribute such as public or private, but implemented methods must be marked as public in the definition of the class that implements the interface. Multiple interfaces can be inherited by an interface by means of the extends statement, or by a class through the implements statement.  Unlike ActionScript 2.0, ActionScript 3.0 allows the use of getter and setter methods in interface definitions. 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's Publish Settings dialog box. This keyword is supported only when used in external script files, not in scripts written in the Actions panel."/>
<page href="statements.html#internal" title="internal" text="internal Specifies that a class, variable, constant, or function is available to any caller within the same package. Classes, properties, and methods belong to the internal namespace by default. className The name of the class that you want to specify as internal."/>
<page href="statements.html#label" title="label" text="label Associates a statement with an identifier that can be referenced by break or continue. In nested loops, a break or continue statement that does not reference a label can skip only the rest of the immediate loop and does not skip the entire series of loops. However, if the statement that defines the entire series of loops has an associated label, a break or continue statement can skip the entire series of loops by referring to that label. Labels also allow you to break out of a block statement. You cannot place a break statement that does not reference a label inside a block statement unless the block statement is part of a loop. If the block statement has an associated label, you can place a break statement that refers to that label inside the block statement. label A valid identifier to associate with a statement. The following example shows how to use a label with a nested loop to break out of the entire series of loops. The code uses a nested loop to generate a list of numbers from 0 to 99. The break statement occurs just before the count reaches 80. If the break statement did not use the outerLoop label, the code would skip only the rest of the immediate loop and the code would continue to output the numbers from 90 to 99. However, because the outerLoop label is used, the break statement skips the rest of the entire series of loops and the last number output is 79. outerLoop: for (var i:int = 0; i &amp;lt; 10; i++) { for (var j:int = 0; j &amp;lt; 10; j++) { if ( (i == 8) &amp;amp;&amp;amp; (j == 0)) { break outerLoop; } trace(10 * i + j); } } /* output: 1 2 ... 79 */ The following example shows how to use a label with a block statement. In the following example, a block statement is labeled foo, which allows the break statement to skip the final statement in the block: foo: { trace(&quot;a&quot;); break foo; trace(&quot;b&quot;); } // output: a"/>
<page href="statements.html#namespace" title="namespace" text="namespace Allows you to control the visibility of definitions. Predefined namespaces include public, private, protected, and internal (these specific namespaces are also referred to as &quot;access control specifiers&quot; and discussed in documentation on &quot;Class property attributes&quot; as well). If the predefined namespaces do not suit your needs, you can define a custom namespace. The following steps show how to create, apply, and reference a custom namespace:  First, define the custom namespace using the namespace keyword. For example, the code namespace version1 creates a namespace called version1. Second, apply the namespace to a property or method by using your custom namespace in the property or method declaration. For example, the code version1 myProperty:String creates a property named myProperty that belongs to the version1 namespace Third, reference the namespace by using the use keyword or by prefixing an identifier with the namespace. For example, the code use namespace version1; references the version1 namespace for subsequent lines of code, and the code version1::myProperty references the version1 namespace for the myProperty property.  name The name of the namespace, which can be any legal identifier."/>
<page href="statements.html#native" title="native" text="native Specifies that a function or method is implemented by Flash Player in native code. Flash Player uses the native keyword internally to declare functions and methods in the ActionScript application programming interface (API). This keyword cannot be used in your own code.  "/>
<page href="statements.html#null" title="null" text="null A 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.  The value null should not be confused with the special value undefined. 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. The following example checks the first six values of an indexed array and outputs a message if no value is set (if the value == null): var testArray:Array = new Array(); testArray[0] = &quot;fee&quot;; testArray[1] = &quot;fi&quot;; testArray[4] = &quot;foo&quot;; for (i = 0; i &amp;lt; 6; i++) { if (testArray[i] == null) { trace(&quot;testArray[&quot; + i + &quot;] == null&quot;); } } /* output: testArray[2] == null testArray[3] == null testArray[5] == null */"/>
<page href="statements.html#object_proxy" title="object_proxy" text="object_proxy Defines methods of the ObjectProxy class. The ObjectProxy class methods are in their own namespace to avoid name conflicts in situations where a Proxy subclass contains instance method names that match any of the Proxy class method names."/>
<page href="statements.html#override" title="override" text="override Specifies that a method replaces an inherited method. To override an inherited method, you must use the override attribute and ensure that the name, number, type of parameters, and the return type match exactly. It is an error to attempt to override a method without using the override attribute. Likewise, it is an error to use the override attribute if the method does not have a matching inherited method. You cannot use the override attribute on any of the following:  Variables Constants Static methods Methods that are not inherited Methods that implement an interface method Inherited methods that are marked as final in the superclass  Although you cannot override a property declared with var or const, you can achieve similar functionality by making the base class property a getter-setter and overriding the methods defined with get and set. name The name of the method to override."/>
<page href="statements.html#package" title="package" text="package Allows you to organize your code into discrete groups that can be imported by other scripts. You must use the package keyword to indicate that a class is a member of a package. packageName The name of the package."/>
<page href="statements.html#private" title="private" text="private Specifies that a variable, constant, or method is available only to the class that declares or defines it. Unlike in ActionScript 2.0, in ActionScript 3.0 private no longer provides access to subclasses. Moreover, private restricts access at both compile time and runtime. By default, a variable or function is available to any caller in the same package. 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. You cannot apply private to a class or to any other package-level definitions. varName The name of the variable that you want to specify as private. You can apply the private attribute only if the variable is inside a class. The following example demonstrates how you can hide certain properties within a class using the private keyword. class A { private var alpha:String = &quot;visible only inside class A&quot;; public var beta:String = &quot;visible everywhere&quot;; } class B extends A { function B() { alpha = &quot;Access attempt from subclass&quot;; // error } } Because alpha is a private variable, you cannot access it from outside the A class, even from subclass B. Attempts to access the private variable generate an error."/>
<page href="statements.html#protected" title="protected" text="protected Specifies that a variable, constant, method, or namespace is available only to the class that defines it and to any subclasses of that class. The definition of protected in ActionScript 3.0 is similar to the definition of the ActionScript 2.0 version of private, except that protected restricts access at both compile time and runtime. By default, a variable or function is available to any caller within the same package. 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. You cannot apply private to a class, or to any other package-level definitions. The definition of protected in ActionScript 3.0 is more restrictive than that of protected in the Java programming language. In ActionScript 3.0 protected limits access strictly to subclasses, whereas in Java protected also allows access to any class in the same package. For example, if a class named Base contains a property marked as protected, in ActionScript 3.0 only classes that extend Base can access the protected property. In Java, any class in the same package as Base has access to the protected property even if the class is not a subclass of Base. varName The name of the variable that you want to specify as protected. You can apply the protected attribute only if the variable is inside a class. The following example creates a protected class variable in class A, and successfully accesses that variable in class B because class B is a subclass of class A. class A { private var alpha:String = &quot;visible only inside class A&quot;; protected var beta:String = &quot;visible inside class A and its subclasses&quot;; } class B extends A { public function B() { beta = &quot;Access attempt from subclass succeeded&quot;; trace(beta); // output: Access attempt from subclass succeeded } }"/>
<page href="statements.html#public" title="public" text="public Specifies that a class, variable, constant, or method is available to any caller. Classes, variables, and methods are internal by default, which means that they are visible only within the current package. To make a class, variable, or method visible to all callers, you must use the public attribute. className The name of the class that you want to specify as public. The following example shows how you can use public variables in a class file: class User { public var age:Number; public var fname:String; } // end of class User definition var jimmy:User = new User(); jimmy.age = 27; jimmy.fname = &quot;jimmy&quot;; trace(jimmy.age, jimmy.fname); // output: 27 jimmy If you change one of the public variables in the User class to a private variable, any attempt to access that variable outside the User class generates a compile-time error."/>
<page href="statements.html#return" title="return" text="return Causes execution to return immediately to the calling function. If the return statement is followed by an expression, the expression is evaluated and the result is returned. If a function definition includes a return type, the return statement must be followed by an expression. If no return type is specified and the return statement is used alone, it returns undefined. You cannot 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, use an array or object instead. expression An expression to evaluate and return as a value of the function. This parameter is optional. The 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: 114"/>
<page href="statements.html#set" title="set" text="set Defines a setter, which is a method that appears in the public interface as a property. A setter is a special method that sets the value of a property declared with the var keyword. Unlike other methods, a setter is called without parentheses (()), which makes the setter appear to be a variable. Setters allow you to apply the principle of information hiding by letting you create a public interface for a private property. The advantage of information hiding is that the public interface remains the same even if the underlying implementation of the private property changes. Another advantage of setters is that they can be overridden in subclasses, whereas properties declared with var cannot. The return type of a setter must be either void or not specified. A setter can be combined with a getter to create a read-write property. To create a read-only property, create a getter without a corresponding setter. To create a write-only property, create a setter without a corresponding getter. Note: This keyword is supported only when used in external script files, not in scripts written in the Actions panel. property The identifier for the property that set modifies; this value must be the same as the value used in the corresponding get command. The following example creates a read-write property named age by defining a getter-setter. package { class User { private var userAge:Number; public function get age():Number { return userAge; } public function set age(x:Number):void { userAge = x; } } } Enter the following code in your script: var myUser:User = new User(); myUser.age = 25; trace(myUser.age); // output: 25"/>
<page href="statements.html#static" title="static" text="static Specifies that a variable, constant, or method belongs to the class, rather than to instances of the class. To access a static class member, use the name of the class instead of the name of an instance. For example, the Date class has a static method named parse(), which can only be called using the following syntax: Date.parse() The parse() method cannot be called on an instance of the Date class. For example, the following code generates an error: var myDate:Date = new Date(); myDate.parse(&quot;Jan 01 00:00:00 2006&quot;); // error You can use static in class definitions only, not in interface definitions. Static class members are not inherited. You cannot refer to a static class member using the name of a subclass, as you can in Java or C++. You can, however, refer to a static variable or method within a class or subclass, without using any qualifier. See the example below. You cannot use the super statement or the this keyword inside a static method. Note: This keyword is supported only when used in external script files, not in scripts written in the Actions panel. varName The name of the variable that you want to specify as static. The 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 ActionScript 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; } } Enter the following code in your script: trace(Users.instances); var user1:Users = new Users(); trace(Users.instances); var user2:Users = new Users(); trace(Users.instances); The following example extends the Users class to show that static variables and methods are not inherited but can be referenced in subclasses. class PowerUsers extends Users{ function PowerUsers() { instances++; // unqualified reference to static property Users.instances is legal } } trace(PowerUsers.instances); // error, cannot access static property using PowerUsers class"/>
<page href="statements.html#super" title="super" text="super Invokes the superclass or parent version of a method or constructor. When used within the body of a class constructor, the super() statement invokes the superclass version of the constructor. The call to the superclass constructor must have the correct number of arguments. Note that the superclass constructor is always called, whether or not you call it explicitly. If you do not explicitly call it, a call with no arguments is automatically inserted before the first statement in the subclass constructor body. This means that if you define a constructor function in a subclass, and the superclass constructor takes one or more arguments, you must explicitly call the superclass constructor with the correct number of arguments or an error will occur. The call to the superclass constructor, however, does not need to be the first statement in your subclass constructor, as was required in ActionScript 2.0. When used in the body of an instance method, super can be used with the dot (.) operator to invoke the superclass version of a method and can optionally pass arguments (arg1 ... argN) to the superclass method. This is useful for creating subclass methods that not only add additional behavior to superclass methods, but also invoke the superclass methods to perform their original behavior. You cannot use the super statement in a static method. method The method to invoke in the superclass."/>
<page href="statements.html#switch" title="switch" text="switch Causes control to transfer to one of several statements, depending on the value of an expression. All switch statements should include a default case that will execute if none of the case statements match the expression. Each case statement should end with a break statement, which prevents a fall-through error. When a case falls through, it executes the code in the next case statement, even though that case may not match the test expression. expression Any expression. The following example defines a switch statement that falls through to the default case: var switchExpression:int = 3; switch (switchExpression) { case 0: trace(0); break; case 1: trace(1); break; case 2: trace(2); break; default: trace(&quot;Not 0, 1, or 2&quot;); } // output: Not 0, 1, or 2"/>
<page href="statements.html#this" title="this" text="this A reference to a method's containing object. When a script executes, the this keyword references the object that contains the script. Inside a method body, the this keyword references the class instance that contains the called method. 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() { func(); } } */ // correct version of Simple.as dynamic class Simple { function callfunc() { this.func(); } } Add the following code to your script: var simpleObj:Simple = new Simple(); simpleObj.func = function() { trace(&quot;hello there&quot;); } simpleObj.callfunc(); The preceding code works when you use this in the callfunc() method. However, you would get a syntax error if you used the incorrect version of Simple.as, which was commented out in the above example."/>
<page href="statements.html#throw" title="throw" text="throw Generates, 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. If an exception is not caught by a catch or finally block, the string representation of the thrown value is sent to the log file. Typically, you throw instances of the Error class or its subclasses (see the Example section). expression An ActionScript expression or object. In 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 same function, checkEmail(), within a try code block. If the e-mail string does not contain a valid e-mail address, the error message is output by the trace statement. try { checkEmail(&quot;Joe Smith&quot;); } catch (e) { trace(e); } // output: Error: Invalid email address. 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 class InvalidEmailAddress extends Error { public function InvalidEmailAddress() { message = &quot;Invalid email address.&quot;; } } Enter the following code in your script: import InvalidEmailAddress; function checkEmail(email:String) { if (email.indexOf(&quot;@&quot;) == -1) { throw new InvalidEmailAddress(); } } try { checkEmail(&quot;Joe Smith&quot;); } catch (e) { trace(e); } // output: Error: Invalid email address."/>
<page href="statements.html#true" title="true" text="true A Boolean value representing true. A Boolean value is either true or false; the opposite of true is 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;. The 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: 2"/>
<page href="statements.html#try..catch..finally" title="try..catch..finally" text="try..catch..finally Encloses a block of code in which an error can occur, and then responds to the error. Exception handling, which is implemented using the try..catch..finally statements, is the primary mechanism for handling runtime error conditions in ActionScript 3.0. When a runtime error occurs, Flash Player throws an exception, which means that Flash Player suspends normal execution and creates a special object of type Error. Flash Player then passes, or throws, the error object to the first available catch block. If no catch blocks are available, the exception is considered to be an uncaught exception. Uncaught exceptions cause the script to terminate. You can use the throw statement to explicitly throw exceptions in your code. You can throw any value, but the best practice is to throw an object because it provides flexibility and matches the behavior of Flash Player. To catch an exception, whether it is thrown by Flash Player or by your own code, place the code that may throw the exception in a try block. If any code in the try block throws an exception, control passes to the catch block, if one exists, and then to the finally block, if one exists. The finally block always executes, regardless of whether an exception was thrown. If code within the try block does not throw an exception (that is, if the try block completes normally), the code in the catch block is ignored, but 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 parameter can also be typed. When used with multiple catch blocks, typed parameters let you catch multiple types of error objects 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, Flash Player 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. error The expression thrown from a throw statement, typically an instance of the Error class or one of its subclasses. The following example demonstrates a try..catch statement. The code within the try block includes an illegal operation. A sprite cannot add itself as a child. As a result, Flash Player throws an exception, and passes an object of type ArgumentError to the corresponding catch block. import flash.display.Sprite; var spr:Sprite = new Sprite(); try { spr.addChild(spr); } catch (e:ArgumentError) { trace(e); // output: ArgumentError: Error #2024: An object may not be added as a child of itself. } In the following example, the RecordSetException and MalformedRecord objects are subclasses of the Error class. class RecordSetException extends Error { public function RecordSetException () { message = &quot;Record set exception occurred.&quot;; } } class MalformedRecord extends Error { public function MalformedRecord { message = &quot;Malformed record exception occurred.&quot;; } } Within the RecordSet class'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 { public function sortRows() { var returnVal:Number = randomNum(); if (returnVal == 1) { throw new RecordSetException(); } else if (returnVal == 2) { throw new MalformedRecord(); } } public function randomNum():Number { return Math.round(Math.random() * 10) % 3; } } Finally, the following code invokes the sortRows() method on an instance of the RecordSet class. It defines catch blocks for each type of error object 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()); }"/>
<page href="statements.html#use_namespace" title="use namespace" text="use namespace Causes the specified namespaces to be added to the set of open namespaces. The specified namespaces are removed from the set of open namespaces when the current code block is exited. The use namespace directive can appear at the top level of a program, package definition, or class definition. nsN One or more namespaces to add to the set of open namespaces."/>
<page href="statements.html#var" title="var" text="var Specifies a variable. 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. If you declare variables outside a function, the variables are available throughout the timeline containing the statement. You cannot declare a variable that is in the scope of another object as a local variable. my_array.length = 25; // ok var my_array.length = 25; // syntax error  You can assign a data type to a variable by appending a colon character followed by the data type. 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;; variableName An identifier. The following ActionScript creates a new array of product names. Array.push adds an element onto the end of the array. var product_array:Array = new Array(&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: Studio,Dreamweaver,Flash,ColdFusion,Contribute,Breeze,Flex"/>
<page href="statements.html#while" title="while" text="while Evaluates a condition and if the condition evaluates to true, executes one or more statements before looping back to evaluate the condition again. After the condition evaluates to false, the statements are 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 tested 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). If a continue statement is encountered, skip the remaining statements and go to step 1. If a break statement is encountered, the while statement is completed and execution resumes at the next statement after the while loop. 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 ({}) that enclose the statements to be executed by the while statement are not necessary if only one statement will execute. condition An expression that evaluates to true or false. In 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 &amp;lt; 20) { trace(i); i += 3; } /* output: 0 3 6 9 12 15 18 */"/>
<page href="statements.html#with" title="with" text="with Establishes a default object to be used for the execution of a statement or statements, potentially reducing the amount of code that needs to be written. 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 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 the script calls a function that holds the local variables called in the function) The object 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't already exist, the new value will be set on the Timeline from which the with statement was called. object An instance of an ActionScript object or movie clip. The 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(3); The 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); /* output: area = 28.2743338823081 x = -3 y = 3 */"/>

	<page href="specialTypes.html" title="specialTypes" text="specialTypes The three special types are the untyped specifier (*), void, and Null."/>
<page href="specialTypes.html#*" title="*" text="* Specifies that a property is untyped. Use of the asterisk symbol for a type annotation is equivalent to using no type annotation. Expressions that read from untyped properties are considered untyped expressions. Use of untyped expressions or properties is recommended in the following circumstances:  When you want to defer type checking to runtime. You can use an untyped property or expression to circumvent compile-time type checking in strict mode. Note, however, that runtime type checking of assignment statements occurs whether you use strict mode or not. When you want to store the value undefined in a property. Unlike previous versions of ActionScript, the value undefined is not a member of the Object data type. You must use an untyped property to store the value undefined. "/>
<page href="specialTypes.html#Null" title="Null" text="Null A special data type that represents the lack of a value. The Null data type includes only one value: null. The Null data type is special in that it is not associated with a class. This means that you cannot use the Null data type as a type annotation for a property."/>
<page href="specialTypes.html#void" title="void" text="void Specifies that a function cannot return any value. The void type is a special type that contains exactly one value: undefined. It is special in that its use is limited to the return type of a function. You cannot use void as a type annotation for a property."/>
<page href="compilerErrors.html" title="Compiler Errors" text="Compiler Errors The following is a list of compilation errors that the compiler generates when it encounters invalid code. A subset of these errors is detected only when compiling code in strict mode. Strict mode adds three constraints not found in the standard language:   Expressions have static types and type errors are verification errors. Additional verification rules catch common programming errors. Verification errors are reported ahead of time. These are the verification errors that occur only in strict mode:  Function call signature matching, which checks the number of parameters supplied and their types. Duplicate definition conflicts. Unbound references, which occur when accessing methods or properties that are not defined at compile time. Dynamically adding properties on sealed objects. Writing to constant variables. Deleting fixed properties. Comparison expressions that use incompatible types. Unfound packages.    1000 Ambiguous reference to _. A reference might be to more than one item. For example, the following uses the namespaces rss and xml, each of which defines a different value for the hello() function. The trace(hello()) statement returns this error because it cannot determine which namespace to use. private namespace rss; private namespace xml; public function ErrorExamples() { use namespace rss; use namespace xml; trace(hello()); } rss function hello():String { return &quot;hola&quot;; } xml function hello():String { return &quot;foo&quot;; } Correct an ambiguous reference by making the reference specific. The following example uses the form namespace::function to specify which namespace to use: public function ErrorExamples() { trace(rss::hello()); trace(xml::hello()); } 1003 Access specifiers are not allowed with namespace attributes. You can not use both an access specifier (such as private or public) and a namespace attribute on a definition. 1004 Namespace was not found or is not a compile-time constant. The namespace is either unknown or is an expression that could have different values at run time. Check that you are spelling the namespace correctly and that its definition is imported correctly. 1006 A super expression can be used only inside class instance methods.  1007 A super statement can be used only inside class instance constructors. You cannot use the super statement within static members. You can use the super statement only within class instances. 1008 Attribute is invalid.  1010 The override attribute may be used only on class property definitions. You cannot use the override keyword within a function block. 1011 The virtual attribute may be used only on class property definitions. You cannot use the virtual attribute when you declare a property that does not belong to a class (for example, when you declare a variable within a function block). 1012 The static attribute may be used only on definitions inside a class.  1013 The private attribute may be used only on class property definitions.  1014 The intrinsic attribute is no longer supported. ActionScript 3.0 does not support the intrinsic keyword. 1016 Base class is final. The superclass cannot be extended because it is marked as final. 1017 The definition of base class _ was not found.  1018 Duplicate class definition: _.  1020 Method marked override must override another method.  1021 Duplicate function definition. You cannot declare more than one function with the same identifier name within the same scope. 1022 Cannot override a final accessor.  1023 Incompatible override. A function marked override must exactly match the parameter and return type declaration of the function it is overriding. It must have the same number of parameters, each of the same type, and declare the same return type. If any of the parameters are optional, that must match as well. Both functions must use the same access specifier (public, private, and so on) or namespace attribute as well. 1024 Overriding a function that is not marked for override. If a method in a class overrides a method in a base class, you must explicitly declare it by using the override attribute, as this example shows: public override function foo():void{}; 1025 Cannot redefine a final method. The method cannot be extended because it is marked as final in the base class. 1026 Constructor functions must be instance methods.  1027 Functions cannot be both static and override.  1028 Functions cannot be both static and virtual.  1029 Functions cannot be both final and virtual.  1030 Must specify name of variable arguments array. The ...(rest) parameter definition specifies that all values supplied after ...(rest) are collected into any array. You must specify a name for the array, as in the expression function foo(x,...(rest)). 1033 Virtual variables are not supported.  1034 Variables cannot be native.  1035 Variables cannot be both final and virtual.  1037 Packages cannot be nested.  1038 Target of break statement was not found.  1039 Target of continue statement was not found.  1040 Duplicate label definition.  1041 Attributes are not callable.  1042 The this keyword can not be used in static methods. It can only be used in instance methods, function closures, and global code. You cannot use the this keyword within a static member, because this would have no context. 1043 Undefined namespace.  1044 Interface method _ in namespace _ not implemented by class _.  1045 Interface _ was not found.  1046 Type was not found or was not a compile-time constant: _. The class used as a type declaration is either unknown or is an expression that could have different values at run time. Check that you are importing the correct class and that its package location has not changed. Also, check that the package that contains the code (not the imported class) is defined correctly (for example, make sure to use proper ActionScript 3.0 package syntax, and not ActionScript 2.0 syntax). The error can also occur if the class being referenced is not defined in a namespace that is in use or is not defined as public: public class Foo{} If you are using Flex&amp;#153 Builder&amp;#153 2 and the class is in a library, make sure to set the class path for the project. 1047 Parameter initializer unknown or is not a compile-time constant. The value used as the default value for the parameter is either undefined or could have different values at run time. Check that the initializer is spelled correctly, and that the initializer value isn't an expression that could result in different possible values at run time. 1048 Method cannot be used as a constructor. It is not possible to create an instance of a method of a class. Only global functions can be used in new expressions. class D { function xx() { return 22; } } var d:D = new D(); var x = new d.xx(); // error, method cannot be used as constructor function yy() { this.a = 22; } var z = new yy(); // no error, global functions can be used as constructors. 1049 Illegal assignment to a variable specified as constant.  1050 Cannot assign to a non-reference value.  1051 Return value must be undefined. You are attempting to use the return statement within a method that has a declared return type void. 1052 Constant initializer unknown or is not a compile-time constant. The value used to initialize the constant is either undefined or could have different values at run time. Check that the initializer is spelled correctly, and that the initializer value isn't an expression that could result in different possible values at run time. 1053 Accessor types must match.  1054 Return type of a setter definition must be unspecified or void. You cannot specify a return value for a setter function. For example, the following is invalid: public function set gamma(g:Number):Number; The following is valid: public function set gamma(g:Number):void; 1058 Property is write-only.  1059 Property is read-only. This property is defined through a getter function, which allows you to retrieve that property's value. There is no setter function defined for this property, however, so it is read-only. In the following example, line 3 generates an error because there is no setter function defined for xx: class D { function get xx() { return 22; } } var d:D = new D(); d.xx = 44; // error, property is read-only 1061 Call to a possibly undefined method _ through a reference with static type _. You are calling a method that is not defined. 1063 Unable to open file: _.  1064 Invalid metadata. This metadata is unrecognized. 1065 Metadata attributes cannot have more than one element.  1067 Implicit coercion of a value of type _ to an unrelated type _. You are attempting to cast an object to a type to which it cannot be converted. This can happen if the class you are casting to is not in the inheritance chain of the object being cast. This error appears only when the compiler is running in strict mode. 1068 Unable to open included file: _.  1069 Syntax error: definition or directive expected. Check the syntax in the line. 1071 Syntax error: expected a definition keyword (such as function) after attribute _, not _. This error will occur if the author forgets to use the &quot;var&quot; or &quot;function&quot; keyword in a declaration. public int z;// should be 'public var z:int;' This error might also occur when the compiler encounters an unexpected character. For example, the following use of the trace() function is invalid, because of the missing parentheses (the correct syntax is trace(&quot;hello&quot;)):  trace &quot;hello&quot;  1072 Syntax error: expecting xml before namespace. The correct statement syntax is default xml namespace =  ns. Either the keyword xml (note the lowercase) is missing or an incorrect keyword was used. For more information, see the default xml namespace directive. 1073 Syntax error: expecting a catch or a finally clause.  1075 Syntax error: the 'each' keyword is not allowed without an 'in' operator.  1076 Syntax error: expecting left parenthesis before the identifier.  1077 Expecting CaseLabel. The compiler expected a case statement at this point in the switch block. The following switch block incorrectly includes a call to print before the first case statement: switch(x) { trace(2); case 0: trace(0); break } 1078 Label must be a simple identifier.  1079 A super expression must have one operand.  1080 Expecting increment or decrement operator.  1082 Expecting a single expression within parentheses.  1083 Syntax error: _ is unexpected. The line of code is missing some information. In the following example, some expression (such as another number) needs to be included after the final plus sign: var sum:int = 1 + 2 + ; 1084 Syntax error: expecting _ before _. The expression was unexpected at this point. If the error says &quot;Expecting right brace before end of program,&quot; a block of code is missing a closing brace (&amp;#125). If the error says &quot;Expecting left parenthesis before _,&quot; you may have omitted a parenthesis from a conditional expression, as shown in the following example, which is intentionally incorrect:  var fact:int = 1 * 2 * 3; if fact &amp;gt; 2 { var bigger:Boolean = true; } 1086 Syntax error: expecting semicolon before _.  1087 Syntax error: extra characters found after end of program.  1093 Syntax error.  1094 Syntax error: A string literal must be terminated before the line break.  1095 Syntax error: A string literal must be terminated before the line break.  1097 Syntax error: input ended before reaching the closing quotation mark for a string literal.  1099 Syntax error.  1100 Syntax error: XML does not have matching begin and end tags.  1102 Cannot delete super descendants.  1103 Duplicate namespace definition. You defined the namespace more than once. Delete or modify the duplicate definition. 1105 Target of assignment must be a reference value. You can assign a value to a variable, but you cannot assign a value to another value. 1106 Operand of increment must be a reference. The operand must be a variable, an element in an array, or a property of an object. 1107 Increment operand is invalid. The operand must be a variable, an element in an array, or a property of an object. 1108 Decrement operand is invalid. The operand must be a variable, an element in an array, or a property of an object. 1109 Expecting an expression. An expression is missing in a part of the code. For example, the following produces this error (there is a condition missing from the if statement: var x = (5 &amp;gt; 2) ? trace(x) 1110 Missing XML tag name.  1112 Possible infinite recursion due to this file include: _. A file that is included in the source being compiled contains other include statements that would cause an infinite loop. For example, the following files. a.as and b.as, generate this error because each file tries to include the other.  File a.as contains the following, which attempts to include the file b.as: import foo.bar.baz; include &quot;b.as&quot; trace(2); File b.as contains the following, which attempts to include the file a.as: include &quot;a.as&quot; 1113 Circular type reference was detected in _. A class is trying to extend a superclass. For example, class A cannot extend class B if B inherits from A: class a extends b { } class b extends a { } 1114 The public attribute can only be used inside a package.  1115 The internal attribute can only be used inside a package.  1116 A user-defined namespace attribute can only be used at the top level of a class definition.  1118 Implicit coercion of a value with static type _ to a possibly unrelated type _. You are using a value that is not of the expected type and no implicit coercion exists to convert it to the expected type. Perhaps you are using a supertype where a subtype is expected. For example: class A {} var a:A = new A(); class B extends A { function f() } var b : B = a // error The last statement generates an error because it attempts to assign an object of type A to a variable of type B. Similarly, the following defines the foo() function, which takes a parameter of type B. The statement  foo(a); generates an error because it attempts to use a parameter of type A: function foo(x:B) { } foo(a); Also, the following statement generates an error because the returned value for foo2() must be type B: function foo2():B { return new A(); } 1119 Access of possibly undefined property _ through a reference with static type _. You are attempting to access a property that does not exist for the specified object. For example, the following code generates this error because an int object does not have a property named assortment: var i:int = 44; var str:String = i.assortment; This error appears only when the compiler is running in strict mode. 1120 Access of undefined property _. You are attempting to access an undefined variable. For example, if the variable huh has not been defined, a call to it generates this error: huh = 55; This error can appear only when the compiler is running in strict mode. 1121 A getter definition must have no parameters.  1122 A setter definition must have exactly one parameter.  1123 A setter definition cannot have optional parameters.  1124 Return type of a getter definition must not be void. A getter function simulates a variable. Because variables cannot be of type void, you cannot declare getter functions to return type void. 1125 Methods defined in an interface must not have a body.  1126 Function does not have a body.  1127 Attribute _ was specified multiple times. You specified an attribute more than once in the same statement. For example, the statement public static public var x; generates this error because it specifies that the variable x is public twice. Delete duplicate declarations. 1129 Duplicate interface definition: _. Change or delete the duplicate definitions. 1130 A constructor cannot specify a return type.  1131 Classes must not be nested.  1132 The attribute final can only be used on a method defined in a class.  1133 The native attribute can only be used with function definitions.  1134 The dynamic attribute can only be used with class definitions.  1135 Syntax error: _ as not a valid type.  1136 Incorrect number of arguments. Expected _. The function expects a different number of arguments than those you provided. For example, the following defines function goo, which has two arguments: class A { static function goo(x:int,y:int) { return(x+y); } } The following statement would generate an error because it provides three arguments: A.goo(1,2,3); 1137 Incorrect number of arguments. Expected no more than _.  1138 Required parameters are not permitted after optional parameters.  1139 Variable declarations are not permitted in interfaces.  1140 Parameters specified after the ...rest parameter definition keyword can only be an Array data type.  1141 A class can only extend another class, not an interface.  1142 An interface can only extend other interfaces, but _ is a class. You are attempting to have the interface extend a class. An interface can only extend another interface. 1143 The override attribute can only be used on a method defined in a class.  1144 Interface method _ in namespace _ is implemented with an incompatible signature in class _. Method signatures must match exactly. 1145 Native methods cannot have a body. You cannot use native because it is a reserved keyword. 1146 A constructor cannot be a getter or setter method.  1147 An AS source file was not specified.  1149 The return statement cannot be used in static initialization code.  1150 The protected attribute can only be used on class property definitions.  1151 A conflict exists with definition _ in namespace _. You cannot declare more than one variable with the same identifier name within the same scope unless all such variables are declared to be of the same type. In ActionScript 3.0, different code blocks (such as those used in two for loops in the same function definition) are considered to be in the same scope. The following code example correctly casts the variable x as the same type: function test() { var x:int = 3; for(var x:int = 33; x &amp;lt; 55; x++) trace(x); for(var x:int = 11; x &amp;lt; 33; x++) trace(x) } The following code example generates an error because the type casting in the variable declaration and the for loops are different: function test() { var x:String = &quot;The answer is&quot;; for(var x:int = 33; x &amp;lt; 55; x++) // error trace(x); for(var x:unit = 11; x &amp;lt; 33; x++) // error trace(x) } 1152 A conflict exists with inherited definition _ in namespace _.  1153 A constructor can only be declared public.  1154 Only one of public, private, protected, or internal can be specified on a definition.  1155 Accessors cannot be nested inside other functions.  1156 Interfaces cannot be instantiated with the new operator.  1157 Interface members cannot be declared public, private, protected, or internal.  1158 Syntax error: missing left brace ({) before the function body.  1159 The return statement cannot be used in package initialization code.  1160 The native attribute cannot be used in interface definitions. You cannot use native because it is a reserved keyword. 1162 Only one namespace attribute can be used per definition.  1163 Method _ conflicts with definition inherited from interface _.  1165 Interface attribute _ is invalid.  1166 Namespace declarations are not permitted in interfaces.  1167 Class _ implements interface _ multiple times. The class implements the same interface more than once. For example, the following generates this error because class C implements interface A twice: interface A { public function f(); }; class C implements A,A { public function f() { trace(&quot;f&quot;); } } The correct implementing statement should be  class C implements A {. 1168 Illegal assignment to function _. You are attempting to redefine a function. For example, the following defines the function topLevel() to print the word &quot;top&quot;. The second statement generates an error because it assigns a different return value to the function: function topLevel() { trace(&quot;top&quot;); } topLevel = function() { trace(&quot;replacement works in ~&quot;);} // error 1169 Namespace attributes are not permitted on interface methods.  1170 Function does not return a value. Every possible control flow in a function must return a value whenever the return type is something other than void. The following function f(x) does not generate an error because the if..else statement always returns a value: function f(x):int { if (x) return 2; else return 3; } // no error However, the function g(x) below generates the error because the switch statement does not always return a value. function g(x:int):int { switch(x) { case 1: return 1; case 2: return 2: } // return 2;//uncomment to remove the error } This checking is enabled only when the function declares a return type other than void. 1171 A namespace initializer must be either a literal string or another namespace.  1172 Definition _ could not be found.  1173 Label definition is invalid.  1176 Comparison between a value with static type _ and a possibly unrelated type _. This error is enabled in strict mode. 1177 The return statement cannot be used in global initialization code.  1178 Attempted access of inaccessible property _ through a reference with static type _.  1180 Call to a possibly undefined method _. This error appears only when the compiler is running in strict mode. 1181 Forward reference to base class _.  1182 Package cannot be used as a value: _.  1184 Incompatible default value of type _ where _ is expected.  1185 The switch has more than one default, but only one default is allowed.  1188 Illegal assignment to class _.  1189 Attempt to delete the fixed property _. Only dynamically defined properties can be deleted. Delete removes dynamically defined properties from an object. Declared properties of a class can not be deleted. This error appears only when the compiler is running in strict mode. 1190 Base class was not found or is not a compile-time constant.  1191 Interface was not found or is not a compile-time constant.  1192 The static attribute is not allowed on namespace definitions.  1193 Interface definitions must not be nested within class or other interface definitions.  1194 The prototype attribute is invalid.  1195 Attempted access of inaccessible method _ through a reference with static type _. You are either calling a private method from another class, or calling a method defined in a namespace that is not in use. If you are calling a method defined in an unused namespace, add a use statement for the required namespace. 1196 Syntax error: expecting an expression after the throw.  1197 The class _ cannot extend _ since both are associated with library symbols or the main timeline.  1198 Attributes are not allowed on package definition.  1199 Internal error: _.  1200 Syntax error: invalid for-in initializer, only 1 expression expected.  1201 A super statement cannot occur after a this, super, return, or throw statement.  1202 Access of undefined property _ in package _. You are attempting to access an undefined variable in a package. For example, if the variable p.huh has not been defined, a call to it generates this error: p.huh = 55; This error can only appear when the compiler is running in strict mode. 1203 No default constructor found in base class _. You must explicitly call the constructor of the base class with a super() statement if it has 1 or more required arguments. 1204 /* found without matching */ . The characters '/*' where found, which indicate the beginning of a comment, but the corresponding characters, '*/', which indicate the end of the comment block, were not found. 1205 Syntax Error: expecting a left brace({)or string literal(&quot;&quot;).  1206 A super statement can be used only as the last item in a constructor initializer list. You cannot use the super statement within a constructor. You can use the super statement only as the last item in the constructor initializer list. 1207 The this keyword can not be used in property initializers. You cannot use the this keyword within a property initializer. 1208 The initializer for a configuration value must be a compile time constant. The initializer of a configuration value must be a value known at compile time. The initializer may be a constant string, number, or boolean, or a reference to another previously defined configuration value. 1209 A configuration variable may only be declared const. When defining a configuration variable, it must be declared as const."/>
<page href="compilerWarnings.html" title="Compiler Warnings" text="Compiler Warnings Compiler warning messages identify code that is valid and compiles successfully, but may not be what the author intended. To enable detecting these possible problems, compile ActionScript projects in warning mode. Some of these warnings (for example, &quot;Missing type declaration.&quot;) are coding style choices that you have the option whether to enforce. Others (for example, &quot;Impossible assignment to null.&quot;) point out statements that are valid, but are unlikely to behave as the user expects. A third class of warnings covers issues you may encounter when porting ActionScript 2.0 code to ActionScript 3.0. 1009 _ '_' has no type declaration. Not declaring a data type is a coding style preference. A function return type, parameter, or variable has no type declaration. However, using type declarations enables the compiler to write more efficient code, as well as detect more errors at compile time. Enable this warning if you want to be reminded when you fail to use a type declaration. 1013 Variables of type _ cannot be undefined. The value undefined will be type coerced to _ before comparison. Only variables of type * can be undefined. With a few exceptions, uninitialized variables have a default value of null rather than undefined. The exceptions include: Boolean variables, which have a default value of false. Number variables, which have a default value of NaN, and int or uint variables, which have a default value of 0. 1031 Migration issue: Result of new _ will be the return value of _, rather than a new instance of that function. This is a code migration warning. The detected code behaves differently in ActionScript 3.0 than in ActionScript 2.0, as shown in the following example: function f(){ this.b = 22; this.a = new Array(2);  this.a[0] = 33; this.a[1] = 44; return a; } // returns a new instance of f in ActionScript 2.0 and a new 2 element array in ActionScript 3.0 var d = new f();  // Warning here trace(d.a); // undefined in ActionScript 3.0, [33,44] in ActionScript 2.0.  1035 Use of Boolean() with no arguments. This is a code migration warning. The Boolean() function returns false in ActionScript 3.0, but undefined in ActionScript 2.0. 1039 Migration issue: When the Number('') function is called with an empty string argument it returns 0 in ActionScript 3.0, and NaN in ActionScript 2.0. This is a code migration warning. The Number() method called with a String argument skips over all white space in the string and return a default value of 0 if no digits are detected. In ActionScript 2.0, any white space in the string causes the result to be NaN. 1045 Migration issue: Array.toString() handling of null and undefined elements has changed. This is a code migration warning. In ActionScript 2.0, null array elements convert to null and undefined elements convert to undefined. In ActionScript 3.0, both null and undefined elements convert to the empty string ''. If you have code that parses the toString() output from an Array, you may need to adjust your code for this difference. 1059 Migration issue: The property _ is no longer supported. _. This is a code migration warning. The property you are attempting to use does not exist in ActionScript 3.0. 1061 Migration issue: The method _ is no longer supported. _. This is a code migration warning. The method you are attempting to use does not exist in ActionScript 3.0. 1066 __resolve is no longer supported.  1067 Migration issue: __resolve is no longer supported. Use the new Proxy class for similar functionality. This is a code migration warning. See Proxy in this language reference for more information on the replacement for __resolve. 1071 Migration issue: _level is no longer supported. For more information, see the flash.display package. This is a code migration warning. The property you are attempting to use does not exist in ActionScript 3.0. 1073 Migration issue: _ is not a dynamic class. Instances cannot have members added to them dynamically. This is a code migration warning. In ActionScript 2.0, many classes such as Number are dynamic, which means that new properties can be added to instances of those classes at run time. This warning results from code that tries to add a property to an instance of a non-dynamic class. 1083 Migration issue: Method _ will behave differently in ActionScript 3.0 due to the change in scoping for the this keyword. See the entry for warning 1083 for additional information. This is a code migration warning. This warning is generated when a method of an object is used as a value, usually as a callback function. In ActionScript 2.0, functions are executed in the context they are called from. In ActionScript 3.0, functions are always executed in the context where they were defined. Thus, variable and method names are resolved to the class that the callback is part of, rather than relative to the context it is called from, as in the following example: class a { var x; function a() { x = 1; } function b() { trace(x); } } var A:a = new a(); var f:Function = a.b; // warning triggered here var x = 22; f(); // prints 1 in ActionScript 3.0, 22 in ActionScript 2.0 1085 _ will be scoped to the default namespace: _ internal. It will not be visible outside of this package. Not declaring a namespace is a coding style preference. Enable this warning if you want to be reminded when you forget to declare a namespace or access specifier for a definition. Without one, the definition is not visible to code located outside of this file. To make it visible to code outside this file, declare it with the access specifier public or with a namespace declaration. To keep the definition local to this file and avoid this warning, declare the definition as private. 1087 Migration issue: ActionScript 3.0 iterates over an object's properties within a &quot;for x in target&quot; statement in random order. This is a code migration warning. In ActionScript 2.0, the order in which the properties of an object were processed was always the same. In ActionScript 3.0, the order is random and can change from machine to machine. If unexpected ordering behavior occurs, inspect this loop to determine if this change in behavior may affect your code. 1089 Error code: _. This is due to either a corrupt source file or a bug in the compiler code. Please contact Adobe, Inc. to file a bug. 1091 Migration issue: _ This is a code migration warning. In ActionScript 2.0 declaring a method by a special name (such as onMouseDown) would cause Flash to call that method when a certain event occurred. In ActionScript 3.0, you must call addEventListener() with a method in order to register it to receive that event. See addEventListener in this language reference for details. 1093 Negative value used where a uint (non-negative) value is expected. Assigning a negative value to a uint data type results in an extremely large positive value. var x:uint = -1; trace(x); // 4294967295. 1097 Illogical comparison with null. Variables of type _ cannot be null. Instances of Boolean, int, uint, and Number cannot be null. The comparison operator type converts null to false before comparing it to a Boolean, or to 0 before comparing it with a Number, int, or uint data type. 1099 Illogical comparison with NaN. This statement always evaluates to false. NaN has the unique mathematical property that any comparison involving it evaluates to false. Use the global isNaN() function to detect a NaN value instead, as in the following example: trace(NaN == NaN); // false! trace(NaN != NaN); // false again! trace(isNaN(NaN)); // true  1101 Assignment within conditional. Did you mean == instead of =? The result of an = assignment statement is the value of the right-hand side of the = statement. You can use an assignment statement as a conditional test, but it is not recommended. It usually is the result of a typo where a == equality test was intended, as the following example shows: var x:Boolean = false; var y:Boolean = true; // it is hard to determine if the line below intentionally sets x's value to y's or if its a typo if (x = y) { trace(&quot;x is assigned y's value of true, making the conditional test evaluate as true.&quot;); }  1103 null used where a _ value was expected. Boolean, Number, int, and uint variables cannot be assigned null as a value. The null value is implicitly cast to false when assigned to a Boolean, and to 0 when assigned to an int, uint, or Number. 1105 No constructor function was specified for class _. Not specifying a constructor function is a coding style preference. Enable this warning if you want to always declare constructors for classes. This warning is intended to help find cases where a class name is changed but its constructor's name is not. Conditions such as this are not flagged as a problem without this warning, the former constructor appears to be a normal function. 1111 The constant was not initialized.  1113 Array(x) behaves the same as new Array(x). To cast a value to type Array use the expression x as Array instead of Array(x).  1115 The super() statement will be executed prior to entering this constructor. Add a call to super() within the constructor if you want to explicitly control when it is executed. Adding a call to super() within the constructor is a coding style preference. Enable this warning if you want to always be explicit about when super() is called. This can help catch cases where you meant to call super() after some local initialization code and forgot to add it. 3552 Appending text to a TextField using += is many times slower than using the TextField.appendText() method. See this language reference for the appendText() method of the TextField class for details on this significant text optimization. 3554 Function value used where type _ was expected. Possibly the parentheses () are missing after this function reference. You can use functions themselves as values in ActionScript. The code in question is using a value of type Function where a type other than Function, Object, or * is expected. Usually, this indicates a typo where the parentheses () were omitted after the function name. 3556 The instanceof operator is deprecated, use the is operator instead.  3574 Migration issue: The ActionScript 2.0 XML class has been renamed XMLDocument. This is a code migration warning. XML is a different class in ActionScript 3.0 than it was in ActionScript 2.0. In ActionScript 3.0, the XMLDocument class is the equivalent of the XML class in ActionScript 2.0. The ActionScript 3.0 XML class offers improved functionality with an easier and more powerful API. See XML in the ActionScript Language Reference for additional details. 3576 Date(x) behaves the same as new Date().toString(). To cast a value to type Date use &quot;x as Date&quot; instead of Date(x).  3582 Importing a package by the same name as the current class will hide that class identifier in this scope.  3584 More than one argument named '_' specified. References to that argument will always resolve to the last one.  3590 Non-Boolean value used where a Boolean value was expected.  3591 _ used where a Boolean value was expected. The expression will be type coerced to Boolean.  3593 _ is not a recognized property of the dynamic class _. The strict compilation mode does not check for undefined properties on instances of dynamic classes. The types Date, RegExp, and Error are dynamic for backwards compatibility with ECMAScript. This warning finds usages of undefined properties on instances of those classes. A common problem is attempting to get or set a non-existent year property on a Date value. The correct property name is fullYear. 3595 _ is not a recognized method of the dynamic class _. The strict compilation mode does not check for undefined methods on instances of dynamic classes. The types Date, RegExp, and Error are dynamic for backwards compatibility with ECMAScript. This warning finds usages of undefined methods on instances of those classes. 3597 Duplicate variable definition. The compiler has detected a duplicate definition for a variable. This can lead to unexpected results. ActionScript does not support block level scoping of variables. All variables defined within a function body exist within the same scope, even if they are defined within an if statement, while statement, for statement, and so on: for example, the following code redeclares the variable x twice:  function test() { var x:Number = 10; if (true) { for (var x=0; x &amp;lt 5; x++) // warning here, this is the second defintion of x trace(x); } trace(x); // 5, not 10. The last value set by the for loop above is the current value of x } 3598 Definition name is the same as an imported package name. Unqualified references to that name will resolve to the package and not the definition.  3599 Definition name is the same as an imported package name. Unqualified references to that name will resolve to the package and not the definition. If a definition is named the same as a package that is in scope, then any unqualified references to that name will resolve to the package instead of the definition. This can result in unexpected errors when attempting to reference the variable. Any references to the definition need to be qualified to resolve to the definition and not the package. 3600 Possible attempt to delete a fixed property.  3601 The declared property _ cannot be deleted. To free associated memory, set its value to null. Delete removes dynamically defined properties from an object. Declared properties of a class can not be deleted, the operation merely fails silently. To free memory associated with this variable, set its value to null instead. 3602 Use of deprecated definition.  3603 The definition _ is deprecated and should no longer be used. This definition is deprecated and may be removed in the future. 3604 Use of deprecated definition.  3605 _  3606 Use of deprecated definition.  3607 The definition _ is deprecated and has been replaced by _. "/>
<page href="runtimeErrors.html" title="Run-Time Errors" text="Run-Time Errors The following errors can occur at run time. Run-time type checking occurs in ActionScript 3.0 whether you compile in strict mode or warning mode. 1000 The system is out of memory. Flash Player needs more memory to compile your code than your system has available. Close some of the applications or processes running on your system. 1001 The method _ is not implemented.  1002 Number.toPrecision has a range of 1 to 21. Number.toFixed and Number.toExponential have a range of 0 to 20. Specified value is not within expected range. You specified a value that is not within the expected range of the precision argument. Number.toPrecision has a range of 1 to 21. Number.toFixed and Number.toExponential have a range of 0 to 20. 1003 The radix argument must be between 2 and 36; got _. You passed a value less than 2 or greater than 36 for the radix argument of a method or property. Pass a value between 2 and 36 as a radix argument. 1004 Method _ was invoked on an incompatible object. You tried to call a method that is not available to the specified object. This error occurs when you have copied a prototype function from one object to another, and then invoked it, but the target object is not the same type as the original object. Ensure that the target object and original object are the same type. See the ECMAScript Language Specification, 3rd Edition, Chapter 15 for more details. 1005 Array index is not a positive integer (_). You tried to access a member of an array using an index value that is not a positive integer. Pass only positive integers as index values for arrays. 1006 _ is not a function. This error occurs when you attempt to call a function that does not exist. Make sure you are calling the correct function, and that the API has not changed from ActionScript 2.0. Also, make sure you are using the correct object. For example, you will see this error when you use the following code (because the last line mistakenly calls the variable big instead of blg): var blg:String = &quot;foo&quot;; var big:Sprite = new Sprite(); var error:int = big.length();  1007 Instantiation attempted on a non-constructor.  1008 _ is ambiguous; Found more than one matching binding.  1009 Cannot access a property or method of a null object reference. An object that evaluates to null can have no properties. This error can occur in some unexpected (though valid) situations. For example, consider the following code, which creates a Sprite object. Because this Sprite object is never added to the display list (through the addChild() method of a DisplayObjectContainer object), its stage property is set to null. Thus, the example generates this error because Sprite object's stage property cannot have any properties: import flash.display.Sprite; var sprite1:Sprite = new Sprite(); var q:String = sprite1.stage.quality; 1010 A term is undefined and has no properties. This error can occur if you try to access a property of an object that does not exist. For example: var obj:Object = new Object(); obj.a = &quot;foo&quot;; trace(obj.b.prop); You can also see this error because of a misspelling, for example in the following, where mc represents a MovieClip object in the display list, and the stage property is misspelled with a capital S (it should be stage): trace(mc.Stage.quality); 1011 Method _ contained illegal opcode _ at offset _. See the note at the bottom of this table.&amp;#42; 1012 The last instruction exceeded code size. See the note at the bottom of this table.&amp;#42; 1013 Cannot call OP_findproperty when scopeDepth is 0. See the note at the bottom of this table.&amp;#42; 1014 Class _ could not be found.  1015 Method _ cannot set default xml namespace See the note at the bottom of this table.&amp;#42; 1016 Descendants operator (..) not supported on type _.  1017 Scope stack overflow occurred. See the note at the bottom of this table.&amp;#42; 1018 Scope stack underflow occurred. See the note at the bottom of this table.&amp;#42; 1019 Getscopeobject _ is out of bounds. See the note at the bottom of this table.&amp;#42; 1020 Code cannot fall off the end of a method. See the note at the bottom of this table.&amp;#42; 1021 At least one branch target was not on a valid instruction in the method. See the note at the bottom of this table.&amp;#42; 1022 Type void may only be used as a function return type. See the note at the bottom of this table.&amp;#42; 1023 Stack overflow occurred. See the note at the bottom of this table.&amp;#42; 1024 Stack underflow occurred. See the note at the bottom of this table.&amp;#42; 1025 An invalid register _ was accessed. See the note at the bottom of this table.&amp;#42; 1026 Slot _ exceeds slotCount=_ of _. See the note at the bottom of this table.&amp;#42; 1027 Method_info _ exceeds method_count=_. See the note at the bottom of this table.&amp;#42; 1028 Disp_id _ exceeds max_disp_id=_ of _. See the note at the bottom of this table.&amp;#42; 1029 Disp_id _ is undefined on _. See the note at the bottom of this table.&amp;#42; 1030 Stack depth is unbalanced. _ != _. See the note at the bottom of this table.&amp;#42; 1031 Scope depth is unbalanced. _ != _. See the note at the bottom of this table.&amp;#42; 1032 Cpool index _ is out of range _. See the note at the bottom of this table.&amp;#42; 1033 Cpool entry _ is wrong type. See the note at the bottom of this table.&amp;#42; 1034 Type Coercion failed: cannot convert _ to _.  1035 Illegal super expression found in method _. See the note at the bottom of this table.&amp;#42; 1037 Cannot assign to a method _ on _. See the note at the bottom of this table.&amp;#42; 1038 _ is already defined. You cannot declare a variable or function with the same identifier name more than once within the same scope. In ActionScript 3.0, different code blocks (such as those used in two for loops in the same function definition) are considered to be in the same scope. See the note at the bottom of this table.&amp;#42; 1039 Cannot verify method until it is referenced. See the note at the bottom of this table.&amp;#42; 1040 The right-hand side of instanceof must be a class or function. The expression on the right side of the instanceof operator must be a class or function. 1041 The right-hand side of operator must be a class. The expression on the right side of the is operator must be a class. 1042 Not an ABC file. major_version=_ minor_version=_. You are attempting to use an invalid file with the player: the tool that generates the SWF may be out of date or the SWF itself may be corrupt. 1043 Invalid code_length=_. See the note at the bottom of this table.&amp;#42; 1044 MethodInfo-_ unsupported flags=_. See the note at the bottom of this table.&amp;#42; 1045 Unsupported traits kind=_. See the note at the bottom of this table.&amp;#42; 1046 MethodInfo-_ referenced before definition. See the note at the bottom of this table.&amp;#42; 1047 No entry point was found. See the note at the bottom of this table.&amp;#42; 1049 Prototype objects must be vanilla Objects. See the note at the bottom of this table.&amp;#42; 1050 Cannot convert _ to primitive. See the note at the bottom of this table.&amp;#42; 1051 Illegal early binding access to _. See the note at the bottom of this table.&amp;#42; 1052 Invalid URI passed to _ function. See the note at the bottom of this table.&amp;#42; 1053 Illegal override of _ in _. See the note at the bottom of this table.&amp;#42; 1054 Illegal range or target offsets in exception handler. See the note at the bottom of this table.&amp;#42; 1056 Cannot create property _ on _. You are trying to assign a value to a nonexistent property on an instance of a non-dynamic class. This is only possible for instances of dynamic classes 1057 _ can only contain methods. See the note at the bottom of this table.&amp;#42; 1058 Illegal operand type: _ must be _. See the note at the bottom of this table.&amp;#42; 1059 ClassInfo-_ is referenced before definition. See the note at the bottom of this table.&amp;#42; 1060 ClassInfo _ exceeds class_count=_. See the note at the bottom of this table.&amp;#42; 1061 The value _ cannot be converted to _ without losing precision. This error appears if you attempt to assign a decimal number to a property that has data type int. This error also appears for out-of-range assignments, such as the following: var m0:int = 2147483648; // int.MAX_VALUE == 2147483647 You can also see this error when using the bitwise left shift operator (&amp;lt&amp;lt). For example, consider the following code: var m0:uint = 0xFF; var m1:uint = m0&amp;lt&amp;lt24; The result of left shift operator (&amp;lt&amp;lt) is interpreted as a 32-bit two's complement number with sign. In the example, the result is a negative value, which causes the error when assigned to the uint typed property. A workaround is the following: var m0:uint = 0xFF; var m1:uint = uint(m0&amp;lt;&amp;lt;24); 1063 Argument count mismatch on _. Expected _, got _.  1064 Cannot call method _ as constructor. Extracted methods are permanently bound to the object they are extracted from. Therefore, they can not later be called as a constructor. For example, the following creates function f() in Class A: class A { function f() {} } In the following code, extracting the function causes no error. However, creating a new instance of the function causes an error. var a = new A() var m = a.f // extract f, don't call it m() // same as a.f() new m() // causes this error 1065 Variable _ is not defined. You are using an undefined lexical reference. For example, in the following statements, the statement trace(x) generates an error because x is undefined. However, the statement trace(y) doesn't generate an error because y is defined: trace(&quot;hello world&quot;) trace(x) // x is undefined var y trace(y) // No error, y is defined. 1066 The form function('function body') is not supported. Unlike JavaScript, Flash does not compile code on-the-fly using eval() and function(). Thus, calling these as a constructor in ActionScript 3.0 generates this error. 1067 Native method _ has illegal method body. See the note at the bottom of this table.&amp;#42; 1068 _ and _ cannot be reconciled. See the note at the bottom of this table.&amp;#42; 1069 Property _ not found on _ and there is no default value. You are referencing an undefined property on a non-dynamic class instance. For example, the following generates this error when it references property x, which is not defined and cannot be created dynamically: class A {} // sealed class, not dynamic trace(new A().x) // no property x defined on A, and A is not dynamic 1070 Method _ not found on _ You are using a super statement to call a function, but the function doesn't exist in the super class. For example, the following code generates the error: class A() {} class B extends A { function f() { trace(super.f()); } // error 1070, there is no f on A } 1071 Function _ has already been bound to _.  1072 Disp_id 0 is illegal. See the note at the bottom of this table.&amp;#42; 1073 Non-override method _ replaced because of duplicate disp_id _. See the note at the bottom of this table.&amp;#42; 1074 Illegal write to read-only property _ on _.  1075 Math is not a function. You are trying to call math() as a function, but the Math class is a class with static methods. 1076 Math is not a constructor. You can not instantiate the Math class. 1077 Illegal read of write-only property _ on _.  1078 Illegal opcode/multiname combination: _. See the note at the bottom of this table.&amp;#42; 1079 Native methods are not allowed in loaded code. See the note at the bottom of this table.&amp;#42; 1080 Illegal value for namespace. See the note at the bottom of this table.&amp;#42; 1081 Property _ not found on _ and there is no default value.  1082 No default namespace has been set. See the note at the bottom of this table.&amp;#42; 1083 The prefix &quot;_&quot; for element &quot;_&quot; is not bound. An attribute name or element name has a prefix but no matching namespace was found. This statement generates an error because there is no foo namespace to match foo:x:&amp;lt;foo:x xmlns:clowns='http://circuscenter.org'&amp;gt; 1084 Element or attribute (&quot;_&quot;) does not match QName production: QName::=(NCName':')?NCName. You have foo:  or :foo as an element or attribute name, but there is nothing on the other side of the colon. 1085 The element type &quot;_&quot; must be terminated by the matching end-tag &quot;&quot;.  1086 The _ method only works on lists containing one item. The XMLList class propagates the XML-specific functions to one child if it has only one item in its list. If more than one item is in the list, the routines fail with this error. This happens for the following XMLList functions that mimic XML functions: addNamespace, appendChild, childIndex, inScopeNamespaces, insertChildAfter, insertChildBefore, name, namespace, localName, namespaceDeclarations, nodeKind, prependChild, removeNamespace, replace, setChildren, setLocalName, setName, and setNamespace. 1087 Assignment to indexed XML is not allowed.  1088 The markup in the document following the root element must be well-formed. These are possible causes of this error:  Parsing an XMLList style object as XML Misbalanced strings  1089 Assignment to lists with more than one item is not supported.  1090 XML parser failure: element is malformed. An element name is malformed. This example of an element name is malformed because a trailing right angle bracket &gt; is missing: &amp;lt;a/&amp;gt;&amp;lt;b&amp;gt;&amp;lt;/b 1091 XML parser failure: Unterminated CDATA section.  1092 XML parser failure: Unterminated XML declaration.  1093 XML parser failure: Unterminated DOCTYPE declaration.  1094 XML parser failure: Unterminated comment.  1095 XML parser failure: Unterminated attribute.  1096 XML parser failure: Unterminated element.  1097 XML parser failure: Unterminated processing instruction.  1098 Illegal prefix _ for no namespace. The namespace constructor throws this error if you try to pass in an empty URI with a non-empty prefix as in this example: ns = new Namespace (&quot;prefix&quot;, &quot;&quot;); 1100 Cannot supply flags when constructing one RegExp from another. Creating a new regular expression from an existing one also copies its flags. To create a regular expression with different flags, use the new operator and set the flags as desired. For example, this statement creates a regular expression and specifies flag settings: var re:RegExp = new RegExp(&quot;ali&quot;, /s) Alternatively, this statement creates a regular expression that has the same flags as re: var re2:RegExp = new RegExp(re, ...) 1101 Cannot verify method _ with unknown scope. See the note at the bottom of this table.&amp;#42; 1102 Illegal default value for type _. See the note at the bottom of this table.&amp;#42; 1103 Class _ cannot extend final base class. See the note at the bottom of this table.&amp;#42; 1104 Attribute &quot;_&quot; was already specified for element &quot;_&quot;.  1107 The ABC data is corrupt, attempt to read out of bounds. See the note at the bottom of this table.&amp;#42; 1108 The OP_newclass opcode was used with the incorrect base class. See the note at the bottom of this table.&amp;#42; 1109 Attempt to directly call unbound function _ from method _. See the note at the bottom of this table.&amp;#42; 1110 _ cannot extend _. See the note at the bottom of this table.&amp;#42; 1111 _ cannot implement _. See the note at the bottom of this table.&amp;#42; 1112 Argument count mismatch on class coercion. Expected 1, got _.  1113 OP_newactivation used in method without NEED_ACTIVATION flag. See the note at the bottom of this table.&amp;#42; 1114 OP_getglobalslot or OP_setglobalslot used with no global scope. See the note at the bottom of this table.&amp;#42; 1115 _ is not a constructor.  1116 second argument to Function.prototype.apply must be an array.  1117 Invalid XML name: _.  1118 Illegal cyclical loop between nodes.  1119 Delete operator is not supported with operand of type _.  1120 Cannot delete property _ on _.  1121 Method _ has a duplicate method body.  1122 Interface method _ has illegal method body.  1123 Filter operator not supported on type _.  1124 OP_hasnext2 requires object and index to be distinct registers.  1502 A script has executed for longer than the default timeout period of 15 seconds. A script executed after the timeout period. (The default timeout period is 15 seconds.) After this error occurs, the script can continue to execute for 15 seconds more, after which the script terminates and throws run-time error number 1503 (A script failed to exit after 30 seconds and was terminated.) 1503 A script failed to exit after 30 seconds and was terminated. The script was still executing after 30 seconds. Flash Player first throws run-time error number 1502 (A script has executed for longer than the default timeout period of 15 seconds.) if the script executed more than 15 seconds, which is the default timeout period. This error occurs 15 seconds after Error 1502 occurs. 1507 Argument _ cannot be null.  1508 The value specified for argument _ is invalid. You are possibly trying to pass the wrong data type. For example, the code public function doSomething(const:int):void { } this [&quot;doSomething&quot;] (&quot;str&quot;) generates an error at runtime because doSomething is cast as an int data type. 1510 When the callback argument is a method of a class, the optional this argument must be null.  2000 No active security context.  2001 Too few arguments were specified; got _, _ expected.  2002 Operation attempted on invalid socket.  2003 Invalid socket port number specified. The valid range is 0 to 65535. For more information, see Socket Connections in this language reference. 2004 One of the parameters is invalid.  2005 Parameter _ is of the incorrect type. Should be type _.  2006 The supplied index is out of bounds.  2007 Parameter _ must be non-null.  2008 Parameter _ must be one of the accepted values.  2009 This method cannot be used on a text field with a style sheet.  2010 Local-with-filesystem SWF files are not permitted to use sockets.  2011 Socket connection failed to _:_. There is a network problem. Possibly a DNS name is not resolving or a TCP socket is not connecting. 2012 _ class cannot be instantiated.  2013 Feature can only be used in Flash Authoring.  2014 Feature is not available at this time. The feature is not supported on this system. 2015 Invalid BitmapData.  2017 Only trusted local files may cause the Flash Player to exit.  2018 System.exit is only available in the standalone Flash Player.  2019 Depth specified is invalid.  2020 MovieClips objects with different parents cannot be swapped.  2021 Object creation failed.  2022 Class _ must inherit from DisplayObject to link to a symbol.  2023 Class _ must inherit from Sprite to link to the root.  2024 An object cannot be added as a child of itself.  2025 The supplied DisplayObject must be a child of the caller.  2026 An error occurred navigating to the URL _. Possibly the URL does not exist, the network connection has a problem, or the URL is outside the security sandbox. 2027 Parameter _ must be a non-negative number; got _.  2028 Local-with-filesystem SWF file _ cannot access Internet URL _.  2029 This URLStream object does not have a stream opened.  2030 End of file was encountered.  2031 Socket Error. A socket error occurred. For more information, see Socket Connections in this language reference. 2032 Stream Error.  2033 Key Generation Failed.  2034 An invalid digest was supplied.  2035 URL Not Found.  2036 Load Never Completed.  2037 Functions called in incorrect sequence, or earlier call was unsuccessful.  2038 File I/O Error.  2039 Invalid remote URL protocol. The remote URL protocol must be HTTP or HTTPS.  2041 Only one file browsing session may be performed at a time.  2044 Unhandled _:.  2045 The digest property is not supported by this load operation.  2046 The loaded file did not have a valid signature.  2047 Security sandbox violation: _: _ cannot access _.  2048 Security sandbox violation: _ cannot load data from _.  2049 Security sandbox violation: _ cannot upload data to _.  2051 Security sandbox violation: _ cannot evaluate scripting URLs within _ (allowScriptAccess is _). Attempted URL was _.  2052 Only String arguments are permitted for allowDomain and allowInsecureDomain.  2053 Security sandbox violation: _ cannot clear an interval timer set by _.  2054 The value of Security.exactSettings cannot be changed after it has been used.  2055 The print job could not be started.  2056 The print job could not be sent to the printer.  2057 The page could not be added to the print job. The addPage() method is not used correctly. See the addPage() entry in this language reference. 2058 There was an error decompressing the data.  2059 Security sandbox violation: _ cannot overwrite an ExternalInterface callback added by _.  2060 Security sandbox violation: ExternalInterface caller _ cannot access _.  2061 No ExternalInterface callback _ registered.  2062 Children of Event must override clone() {return new MyEventClass (...);}.  2063 Error attempting to execute IME command. One of the IME services has failed.  If you are using the setConversionMode() or setEnabled() method, ActionScript 3.0 replaces these methods with the access property. If you are using the doConversion() or setComposition() method, these methods are not supported for Macintosh OSX and Macintosh Classic.  2065 The focus cannot be set for this target.  2066 The Timer delay specified is out of range.  2067 The ExternalInterface is not available in this container. ExternalInterface requires Internet Explorer ActiveX, Firefox, Mozilla 1.7.5 and greater, or other browsers that support NPRuntime.  2068 Invalid sound.  2069 The Loader class does not implement this method.  2070 Security sandbox violation: caller _ cannot access Stage owned by _.  2071 The Stage class does not implement this property or method.  2074 The stage is too small to fit the download ui.  2075 The downloaded file is invalid. Possibly the file decompression failed, the file format is invalid, or the signature validation failed. 2077 This filter operation cannot be performed with the specified input parameters.  2078 The name property of a Timeline-placed object cannot be modified.  2079 Classes derived from Bitmap can only be associated with defineBits characters (bitmaps).  2082 Connect failed because the object is already connected.  2083 Close failed because the object is not connected.  2084 The AMF encoding of the arguments cannot exceed 40K.  2085 Parameter _ must be non-empty string.  2086 A setting in the mms.cfg file prohibits this FileReference request.  2087 The FileReference.download() file name contains prohibited characters. The filename cannot contain spaces or any of the following characters: &amp;#47, &amp;#92, &amp;#58, &amp;#42, &amp;#63, &amp;#34, &amp;#60, &amp;#62, &amp;#124, &amp;#37, or the ASCII control characters 0 through 31 (0x00 through 0X1F). Also, filenames longer than 256 characters may fail on some browsers or servers. 2088 The Proxy class does not implement getProperty. It must be overridden by a subclass.  2089 The Proxy class does not implement setProperty. It must be overridden by a subclass.  2090 The Proxy class does not implement callProperty. It must be overridden by a subclass.  2091 The Proxy class does not implement hasProperty. It must be overridden by a subclass.  2092 The Proxy class does not implement deleteProperty. It must be overridden by a subclass.  2093 The Proxy class does not implement getDescendants. It must be overridden by a subclass.  2094 Event dispatch recursion overflow. The recursion exceeds the maximum recursion depth. (The default maximum is 256.) 2095 _ was unable to invoke callback _.  2096 The HTTP request header _ cannot be set via ActionScript. You are adding a disallowed HTTP header to an HTTP request. The following headers are disallowed:  NULL header string Accept-Charset Accept-Encoding Accept-Ranges Age Allow Allowed Connection Content-Length Content-Location Content-Range Date ETag Expect Host Keep-Alive Last-Modified Location Max-Forwards Proxy-Authenticate Proxy-Authorization Public Range Referer Retry-After Server TE Trailer Transfer-Encoding Upgrade URI User-Agent Vary Via Warning WWW-Authenticate x-flash-version  2097 The FileFilter Array is not in the correct format. There are two valid formats:  A description with Windows file extensions only A description with Windows file extensions and Macintosh file formats.  The two file formats and not interchangeable; you must use one or the other. For more information, see the FileFilter class in this language reference. 2098 The loading object is not a .swf file, you cannot request SWF properties from it.  2099 The loading object is not sufficiently loaded to provide this information.  2100 The ByteArray parameter in Loader.loadBytes() must have length greater than 0.  2101 The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.  2102 The before XMLNode parameter must be a child of the caller.  2103 XML recursion failure: new child would create infinite loop. Possibly you are trying to make objects child objects of each other. For example, the following code generates this error because a and b both try to add the other as a child object. a.addChild(b); b.addChild(a); 2105 The Proxy class does not implement nextNameIndex. It must be overridden by a subclass.  2106 The Proxy class does not implement nextName. It must be overridden by a subclass.  2107 The Proxy class does not implement nextValue. It must be overridden by a subclass.  2108 Scene _ was not found.  2109 Frame label _ not found in scene _.  2110 The value of Security.disableAVM1Loading cannot be set unless the caller can access the stage and is in an ActionScript 3.0 SWF file.  2111 Security.disableAVM1Loading is true so the current load of the ActionScript 1.0/2.0 SWF file has been blocked.  2112 Provided parameter LoaderContext.ApplicationDomain is from a disallowed domain.  2113 Provided parameter LoaderContext.SecurityDomain is from a disallowed domain.  2114 Parameter _ must be null.  2115 Parameter _ must be false.  2116 Parameter _ must be true.  2118 The LoaderInfo class does not implement this method.  2119 Security sandbox violation: caller _ cannot access LoaderInfo.applicationDomain owned by _.  2121 Security sandbox violation: _: _ cannot access _. This may be worked around by calling Security.allowDomain.  2122 Security sandbox violation: _: _ cannot access _. A policy file is required, but the checkPolicyFile flag was not set when this media was loaded.  2123 Security sandbox violation: _: _ cannot access _. No policy files granted access.  2124 Loaded file is an unknown type.  2125 Security sandbox violation: _ cannot use Runtime Shared Library _ because crossing the boundary between ActionScript 3.0 and ActionScript 1.0/2.0 objects is not allowed.  2126 NetConnection object must be connected.  2127 FileReference POST data cannot be type ByteArray.  2129 Connection to _ failed.  2130 Unable to flush SharedObject.  2131 Definition _ cannot be found.  2132 NetConnection.connect cannot be called from a netStatus event handler.  2133 Callback _ is not registered.  2134 Cannot create SharedObject.  2136 The SWF file _ contains invalid data.  2137 Security sandbox violation: _ cannot navigate window _ within _ (allowScriptAccess is _). Attempted URL was _.  2138 Rich text XML could not be parsed.  2139 SharedObject could not connect.  2140 Security sandbox violation: _ cannot load _. Local-with-filesystem and local-with-networking SWF files cannot load each other.  2141 Only one PrintJob may be in use at a time.  2142 Security sandbox violation: local SWF files cannot use the LoaderContext.securityDomain property. _ was attempting to load _.  2143 AccessibilityImplementation.get_accRole() must be overridden from its default.  2144 AccessibilityImplementation.get_accState() must be overridden from its default.  2145 Cumulative length of requestHeaders must be less than 8192 characters.  2146 Security sandbox violation: _ cannot call _ because the HTML/container parameter allowNetworking has the value _.  2147 Forbidden protocol in URL _.  2148 SWF file _ cannot access local resource _. Only local-with-filesystem and trusted local SWF files may access local resources.  2149 Security sandbox violation: _ cannot make fscommand calls to _ (allowScriptAccess is _).  2150 An object cannot be added as a child to one of it's children (or children's children, etc.).  2151 You cannot enter full screen mode when the settings dialog is visible.  2152 Full screen mode is not allowed.  2153 The URLRequest.requestHeaders array must contain only non-NULL URLRequestHeader objects.  2154 The NetStream Object is invalid. This may be due to a failed NetConnection.  2155 The ExternalInterface.call functionName parameter is invalid. Only alphanumeric characters are supported.  2156 Port _ may not be accessed using protocol _. Calling SWF was _.  2157 Rejecting URL _ because the 'asfunction:' protocol may only be used for link targets, not for networking APIs.  * Note: This error indicates that the ActionScript in the SWF is invalid. If you believe that the file has not been corrupted, please report the problem to Adobe."/>
<page href="migration.html" title="ActionScript 2.0 Migration" text="The following table describes the differences between ActionScript 2.0 and 3.0. ActionScript 2.0 Migration #endinitclip  AS3 Removed The #endinitclip directive identifies the end of initialization code in ActionScript 2.0, but has no use in ActionScript 3.0. #include  AS3 Removed See the include statement for similar functionality. #initclip  AS3 Removed The #initclip directive identifies the beginning of initialization code in ActionScript 2.0, but has no use in ActionScript 3.0. false  AS3 statements.html#false The value false, rather than undefined, is the default value of a Boolean object. NaN  AS3 package.html#NaN The value NaN, rather than undefined, is the default value of a Number object. newline  AS3 Removed Use the escape sequence composed of the backslash character followed by the character &quot;n&quot; (\n). null  AS3 statements.html#null The value null, rather than undefined, is the default value of the Object and String classes. undefined  AS3 package.html#undefined The value undefined can be assigned only to untyped variables; it is not the default value of any typed object. asfunction  AS3 flash.text.TextField#event:link Replaced by the new event handling model. You now get the same functionality by using the syntax Event: instead of asfunction:. When a user clicks the link, Flash Player dispatches a TextEvent object of type TextEvent.LINK, which your code can listen for with the addEventListener() method. Any text that you decide to include is stored in the event object's text property. call()  AS3 Removed The call() function was deprecated. Use the function statement for similar functionality. chr()  AS3 Removed Use String.fromCharCode() instead. clearInterval()  AS3 flash.utils#clearInterval() Moved to flash.utils package. clearTimeout()  AS3 flash.utils#clearTimeout() Moved to flash.utils package. duplicateMovieClip()  AS3 flash.display.MovieClip#MovieClip() Replaced by new MovieClip class constructor function. eval()  AS3 Removed There is no equivalent in ActionScript 3.0. fscommand()  AS3 flash.system#fscommand() Moved to flash.system package. Also, see flash.external.ExternalInterface class for JavaScript/ActionScript communication. getProperty()  AS3 Removed To directly access properties, use the dot (.) operator. getTimer()  AS3 flash.utils#getTimer() Moved to flash.utils package. getURL()  AS3 flash.net#navigateToURL() Replaced by the navigateToURL() function. getVersion()  AS3 flash.system.Capabilities#version Moved to Capabilities class and changed to accessor property. gotoAndPlay()  AS3 flash.display.MovieClip#gotoAndPlay() This function is no longer a global function, but is still available as a method of the MovieClip class. gotoAndStop()  AS3 flash.display.MovieClip#gotoAndStop() This function is no longer a global function, but it is still available as a method of the MovieClip class. ifFrameLoaded()  AS3 flash.display.MovieClip#framesLoaded int()  AS3 global#int() Resurrected from deprecated status as a conversion function for the new int data type. length()  AS3 String#length This property is no longer a global property, but it is still available as a property of the String class. loadMovie()  AS3 flash.display.Loader Use the Loader class instead. loadMovieNum()  AS3 flash.display.Loader Use the Loader class instead. loadVariables()  AS3 flash.net.URLLoader Use the URLLoader class instead. loadVariablesNum()  AS3 flash.net.URLLoader Use the URLLoader class instead. mbchr()  AS3 String#fromCharCode() Removed. Use the static String.fromCharCode() method instead. mblength()  AS3 String#length Removed. Use String.length instead. mbord()  AS3 String#charCodeAt() Removed. Use String.charCodeAt() instead. mbsubstring()  AS3 String#substr() Removed. Use String.substr() instead. nextFrame()  AS3 flash.display.MovieClip#nextFrame() This function is no longer a global function, but it is still available as a method of the MovieClip class. nextScene()  AS3 flash.display.MovieClip#nextScene() This function is no longer a global function, but it is still available as a method of the MovieClip class. on()  AS3 flash.events.EventDispatcher Removed. Use the new event handling system in the flash.events package instead. onClipEvent()  AS3 flash.events.EventDispatcher Removed. Use the new event handling system in the flash.events package instead. ord()  AS3 String Removed. Use String class methods instead. parseInt()  AS3 package.html#parseInt() A string with a leading 0 is interpreted as decimal rather than octal. For octal numbers, pass the number 8 for the radix parameter. play()  AS3 flash.display.MovieClip#play() This function is no longer a global function, but it is still available as a method of the MovieClip class. prevFrame()  AS3 flash.display.MovieClip#prevFrame() This function is no longer a global function, but it is still available as a method of the MovieClip class. prevScene()  AS3 flash.display.MovieClip#prevScene() This function is no longer a global function, but it is still available as a method of the MovieClip class. print()  AS3 flash.printing.PrintJob Removed. Use the PrintJob class instead. printAsBitmap()  AS3 flash.printing.PrintJob Removed. Use the PrintJob class instead. printAsBitmapNum()  AS3 flash.printing.PrintJob Removed. Use the PrintJob class instead. printNum()  AS3 flash.printing.PrintJob Removed. Use the PrintJob class instead. random()  AS3 Math#random() Removed. Use Math.random() instead. removeMovieClip()  AS3 Removed Set all references to a movie clip to null to make the movie clip eligible for garbage collection. setInterval()  AS3 flash.utils#setInterval() Moved to flash.utils package. Consider using the Timer class instead. setProperty()  AS3 Removed To set the value of a writable property, use the dot (.) operator. setTimeout()  AS3 flash.utils#setTimeout() Moved to flash.utils package. showRedrawRegions()  AS3 flash.profiler#showRedrawRegions() Moved to flash.profiler package. startDrag()  AS3 flash.display.Sprite#startDrag() This is no longer a global function, but it is still available as a method of the Sprite class. stop()  AS3 flash.display.MovieClip#stop() This is no longer a global function, but it is still available as a method of the MovieClip class. stopAllSounds()  AS3 flash.media.SoundMixer#stopAll() This is no longer a global function, but it is still available as a method of the SoundMixer class, which provides global sound control. stopDrag()  AS3 flash.display.Sprite#stopDrag() This is no longer a global function, but it is still available as a method of the Sprite class. substring()  AS3 String#substring() This is no longer a global function, but it is still available as a method of the String class. targetPath()  AS3 Removed ActionScript 3.0 identifies display objects directly; therefore, identifying a display object by its path is no longer necessary. tellTarget()  AS3 Removed Use the dot (.) operator or the with statement instead. toggleHighQuality()  AS3 flash.display.Stage#quality Removed as a global property. Use the Stage class version instead. trace()  AS3 package.html#trace() The trace() method accepts a comma-delimited list of arguments. unloadMovie()  AS3 flash.display.Loader#unload() Removed. Use Loader.unload() instead. unloadMovieNum()  AS3 flash.display.Loader#unload() Removed. Use Loader.unload() instead. updateAfterEvent()  AS3 flash.events.TimerEvent#updateAfterEvent() This is no longer a global function, but it is still available as a method of the TimerEvent, MouseEvent, and KeyboardEvent classes. _accProps  AS3 flash.accessibility.AccessibilityProperties Replaced by the AccessibilityProperties class. _focusrect  AS3 flash.display.InteractiveObject#focusRect Replaced by the focusRect property of the InteractiveObject class. _global  AS3 Removed Use a static member of a class instead. _highquality  AS3 flash.display.Stage#quality Replaced by the quality property of the Stage class. _level  AS3 Removed The concept of levels does not exist in ActionScript 3.0, which instead provides direct access to the display list. See the flash.display package for details. maxscroll  AS3 flash.text.TextField Replaced by the maxScrollH and maxScrollV properties of the TextField class. _parent  AS3 flash.display.DisplayObject#parent Replaced by the parent property of the DisplayObject class. _quality  AS3 flash.display.Stage#quality Replaced by the quality property of the Stage class. _root  AS3 flash.display.DisplayObject#stage Removed. The closest equivalent is the Stage, which serves as the root of the ActionScript 3.0 display list. scroll  AS3 flash.text.TextField Removed. Replaced by the scrollH and scrollV properties of the TextField class. _soundbuftime  AS3 flash.media.SoundMixer#bufferTime Replaced by the bufferTime property of the SoundMixer class. this  AS3 statements.html#this Instance methods are bound to the instance that implemented the method; therefore, the this reference inside the body of an instance method always refers to the instance that implemented the method. add (concatenation (strings))AS3 Removed Use the concatenation (+) operator instead. eq (equality (strings))AS3 Removed Use the equality (==) operator instead. gt (greater than (strings))AS3 Removed Use the greater than (&amp;gt;) operator instead. ge (greater than or equal to (strings))AS3 Removed Use the greater than or equal to (&amp;gt;=) operator instead. &lt;&gt; (inequality)AS3 Removed Use the inequality (!=) operator instead. instanceofAS3 operators.html#is Although the instanceof operator is available, it only checks the prototype chain, which is not the primary inheritance mechanism in ActionScript 3.0. Use the is operator to check whether an object is a member of a specific data type. lt (less than (strings))AS3 Removed Use the less than (&amp;lt;) operator instead. le (less than or equal to (strings))AS3 Removed Use the less than or equal to (&amp;lt;=) operator instead. and (logical AND)AS3 Removed Use the logical AND (&amp;amp;&amp;amp;) operator instead. not (logical NOT)AS3 Removed Use the logical NOT (!) operator instead. or (logical OR)AS3 Removed Use the logical OR (||) operator instead. ne (not equal (strings))AS3 Removed Use the inequality (!=) operator instead. deleteAS3 operators.html#delete The delete operator works only on properties of objects, but not on variables that hold references to objects. importAS3 statements.html#import The import statement is not optional. To use a class, you must import it, whether or not you use a fully qualified name. intrinsicAS3 Removed ActionScript 3.0 has a similar, but not identical, keyword named native. The native keyword is similar to intrinsic in that it directs the compiler not to expect a function body, but is dissimilar in that native has no effect on compile-time type checking. privateAS3 statements.html#private The ActionScript 3.0 private keyword specifies that an identifier is visible only within a class, and does not extend to subclasses. Moreover, in ActionScript 3.0 the private keyword is enforced at both compile time and run time. set variableAS3 Removed Use the assignment (=) operator instead. superAS3 statements.html#super In ActionScript 3.0, the call to super() in a subclass constructor does not have to be the first statement in the constructor body. "/>
<page href="charset-codes.html" title="Supported Character Sets" text="Supported Character Sets  "/>
<page href="motionXSD.html" title="Motion XML Elements" text="Motion XML Elements  "/>
<page href="TimedTextTags.html" title="Timed Text Tags" text="Timed Text Tags  "/>
<page href="ExampleInstruct.html" title="Using examples in the ActionScript 3.0 Language Reference" text="Using examples in the ActionScript 3.0 Language Reference  "/>
</book>
