flash.display3D

# IndexBuffer3D - AS3

Package | flash.display3D
Class | public final class IndexBuffer3D
Inheritance | IndexBuffer3D Object

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 11, AIR 3

IndexBuffer3D is used to represent lists of vertex indices comprising graphic elements retained by the graphics subsystem.

Indices managed by an IndexBuffer3D object may be used to select vertices from a vertex stream. Indices are 16-bit unsigned integers. The maximum allowable index value is 65535 (0xffff). The graphics subsystem does not retain a reference to vertices provided to this object. Data uploaded to this object may be modified or discarded without affecting the stored values.

IndexBuffer3D cannot be instantiated directly. Create instances by using Context3D::CreateIndexBuffer()

Related API Elements

flash.display.Context3D.createIndexBuffer()
flash.display.Context3D.drawTriangles()

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | dispose():void Free all native GPU resources associated with this object. | IndexBuffer3D
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | uploadFromByteArray(data:ByteArray, byteArrayOffset:int, startOffset:int, count:int):void Store in the graphics subsystem vertex indices. | IndexBuffer3D
|  | uploadFromVector(data:Vector.<uint>, startOffset:int, count:int):void Store in the graphics subsystem vertex indices. | IndexBuffer3D
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Method Detail

### dispose

()
method

`public function dispose():void`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 11, AIR 3

Free all native GPU resources associated with this object. No upload() calls on this object will work and using the object in rendering will also fail.

### uploadFromByteArray

()
method

`public function uploadFromByteArray(data:ByteArray, byteArrayOffset:int, startOffset:int, count:int):void`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 11, AIR 3

Store in the graphics subsystem vertex indices.

Parameters

| `data:ByteArray` — a ByteArray containing index data. Each index is represented by 16-bits (two bytes) in the array. The number of bytes in `data` should be `byteArrayOffset` plus two times `count`.
| `byteArrayOffset:int` — offset, in bytes, into the data ByteArray from where to start reading.
| `startOffset:int` — The index in this IndexBuffer3D object of the first index to be loaded in this IndexBuffer3D object. A value for startIndex not equal to zero may be used to load a sub-region of the index data.
| `count:int` — The number of indices represented by `data`.

Throws

| `TypeError` — kNullPointerError when `data` is null.
| `RangeError` — kBadInputSize when any of `count`, `byteArrayOffset`, or `startOffset` is less than 0, or if `byteArrayOffset` is greater than or equal to the length of `data`, or if two times `count` plus `byteArrayOffset` is greater than the length of `data`, or if `startOffset` + `count` is greater than `numIndices` given in `Context3D::createIndexBuffer()`.
| `Error` — 3768: The `Stage3D` API may not be used during background execution.

### uploadFromVector

()
method

`public function uploadFromVector(data:Vector.<uint>, startOffset:int, count:int):void`

Language Version: | ActionScript 3.0

Runtime Versions: | Flash Player 11, AIR 3

Store in the graphics subsystem vertex indices.

Parameters

| `data:Vector.<uint>` — a vector of vertex indices. Only the low 16 bits of each index value are used. The length of the vector must be greater than or equal to `count`.
| `startOffset:int` — The index in this IndexBuffer3D object of the first index to be loaded. A value for startOffset not equal to zero may be used to load a sub-region of the index data.
| `count:int` — The number of indices in `data`.

Throws

| `TypeError` — kNullPointerError when `data` is null.
| `RangeError` — kBadInputSize when `count` is less than 0 or greater than the length of `data`, or when `startOffset` + `count` is greater than `numIndices` given in `Context3D::createIndexBuffer()`.
| `Error` — 3768: The `Stage3D` API may not be used during background execution.

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00