| Using Flash Remoting MX
|
|
Flash Remoting ActionScript Dictionary
|
RecordSet.addItemAt
Availability
Usage
RecordSet.addItemAt(index, record)
Parameters
| Parameter |
Description |
index
|
The index number of the record.
|
record
|
The record to add.
|
Return value
Nothing.
Description
Method. Inserts a record into the RecordSet object at the specified index. When you use the addItemAt method, avoid the following conditions:
- Index out of range.
- The record parameter is not an object.
- The record parameter has unknown or missing fields.
- The
RecordSet object is associated with an application server and not fully populated yet.
Error handling
| Error condition |
What happens |
Error message |
Index is less than zero.
|
The RecordSet object is not changed.
|
|
Index is greater than the length of the RecordSet object.
|
The RecordSet object length is extended, and the record is added to the RecordSet object.
|
|
The record parameter is not an object.
|
The record is added to the RecordSet object.
|
|
The record parameter contains unknown or missing fields.
|
The record is added to the RecordSet object.
|
|
The RecordSet object is associated with an application server and not fully-populated yet.
|
No change is made to the RecordSet object, and an error message is reported to the Flash MX Output Window and Debug Console.
|
Operation not allowed on partial RecordSet objects.
|
Example
The following example demonstrates the addItemAt method:
#include "NetServices.as"
var productList =new RecordSet(["ProductName","Price","Color"]);
var itemToAdd = {ProductName:"magicbubbles", Price:1, Color:"0x987654"};
productList.addItemAt(0,itemToAdd);
See also
Constructor for RecordSet, RecordSet.addItem
Send me an e-mail when comments are added to this page
| Comment Report
Current page: http://livedocs.adobe.com/flashremoting/mx/Using_Flash_Remoting_MX/asDict28.htm