ActionScript 2.0 Components Language Reference |
|
|
|
| Delta interface > Delta.getItemByName() | |||
Flash Player 7.
Flash MX Professional 2004.
delta.getItemByName(name)
name A string that specifies the name of the property or method for the associated DeltaItem object.
The DeltaItem object specified by name. If no DeltaItem object is found that matches name, this method returns null.
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.
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;
}
|
|
|
|