MACROMEDIA COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX 2 Use Manual page 63

Table of Contents

Advertisement

// The following is Sample Code and is subject to all restrictions on such
code
// as contained in the End User License Agreement accompanying this product.
// If you have received this file from a source other than Adobe,
// then your use, modification, or distribution of it requires
// the prior written permission of Adobe.
//
///////////////////////////////////////////////////////////////////////////
/////
-->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"
pageTitle="Contact Manager"
creationComplete="initApp()">
<mx:Script>
<![CDATA[
import mx.controls.*;
import mx.collections.ArrayCollection;
import mx.data.Conflict;
import mx.data.Conflicts;
import mx.data.DataService;
import mx.data.IManaged;
import mx.data.events.*;
import mx.messaging.events.*;
import mx.rpc.*;
import mx.rpc.events.*;
import samples.contact.*;
[Bindable]
public var contacts:ArrayCollection;
[Bindable]
public var contact:Contact;
private var ds:DataService;
private function initApp():void
{
contacts = new ArrayCollection();
ds = new DataService("cfcontact");
ds.addEventListener(ResultEvent.RESULT, resultHandler);
ds.addEventListener(DataServiceFaultEvent.FAULT, faultHandler);
ds.addEventListener(DataConflictEvent.CONFLICT,
conflictHandler);
ds.autoCommit = false;
var token:AsyncToken = AsyncToken(ds.fill(contacts));
token.kind = "fill";
}
Example application
63

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents