Delta.getItemByName()

Availability

Flash Player 7.

Edition

Flash MX Professional 2004.

Usage

delta.getItemByName(name)

Parameters

name A string that specifies the name of the property or method for the associated DeltaItem object.

Returns

The DeltaItem object specified by name. If no DeltaItem object is found that matches name, this method returns null.

Description

Method; returns the DeltaItem object specified by name. When method calls or property changes on a transfer object are needed by name, this method provides the most efficient access.

Example

The following example calls the getItemByName() method:

private function buildFieldTag(deltaObj:Delta, field:Object, isKey:Boolean):String {
    var chgItem:DeltaItem = deltaObj.getItemByName(field.name);
    var result:String= "<field name=\"" + field.name + "\" type=\"" + field.type.name + "\"";
    var oldValue:String;
    var newValue:String;
    if (deltaObj.getOperation() != DeltaPacketConsts.Added) {
        oldValue = (chgItem != null ? (chgItem.oldValue != null ? encodeFieldValue(field.name, chgItem.oldValue) : __nullValue) : encodeFieldValue(field.name, deltaObj.getSource()[field.name]));
        newValue = (chgItem.newValue != null ? encodeFieldValue(field.name, chgItem.newValue) : __nullValue);
        result+= " oldValue=\""  + oldValue + "\"";
        result+= chgItem != null ? " newValue=\"" + newValue + "\"" : "";
        result+= " key=\"" + isKey.toString() + "\" />";
    }
    else {
        result+= " newValue=\"" +encodeFieldValue(field.name,  deltaObj.getSource()[field.name]) + "\"";
        result+= " key=\"" + isKey.toString() + "\" />";
    }
    return result;
}