
1319
DEVELOPING
COLDFUSION 9 APPLICATIONS
Using External Resources
Las
t
upda
te
d 8/5/2010
<cfscript>
// Create event
createEvent = StructNew();
createEvent.action = "create";
createEvent.item = newContact;
// Create update notification
updateEvent = StructNew();
updateEvent.action="update";
updateEvent.previousversion = oldContact;
updateEvent.newversion = updatedContact;
// Create delete notification
identity = StructNew();
identity["contactId"] = newId;
deleteEvent = StructNew();
deleteEvent.action = "deleteID";
deleteEvent.identity = identity;
// Send a batch notification
all = StructNew();
all.destination="cfcontact";
all.action="batch";
all.changes = ArrayNew(1);
all.changes[1] = createEvent;
all.changes[2] = updateEvent;
all.changes[3] = deleteEvent;
r = sendGatewayMessage("LCDS", all);
</cfscript>
Data translation
The following table lists the ColdFusion data types and the corresponding Adobe Flash or ActionScript data type:
ColdFusion data type
Flash data type
String
String
Array
[] = Array
Struct
{} = untyped Object
Query
ArrayCollection
CFC
Class = typed Object (if a matching ActionScript class exists, otherwise the CFC becomes a
generic untyped Object (map) in ActionScript)
CFC Date
ActionScript Date
CFC String
ActionScript String
CFC Numeric
ActionScript Numeric
ColdFusion XML Object
ActionScript XML Object