Hi Wally,

For some examples of hooking up coldfusion to flex check the below links. They are using PureMVC but if your simply view source and check out the proxy and delegate classes you will see the simple calls to cf and handling of the returned data. Sure there is room for improvement now as I did them a while back but something to have a look at none the less.

http://trac.puremvc.org/Demo_AS3_Flex_CF_QueryCFC
http://www.nutrixinteractive.com/blog/?p=129

Cheers,

Simon

On 2 Jan 2009, at 23:27, Wally Kolcz wrote:

Wait..CFCs have methods, not operations....

So do I remove the Operation variables and just create a function like:

        public function create(petData:Object):void {
            ro.create(petData);
ro.create.addEventListener(FaultEvent.FAULT, faultHandler);
           ....
        }

From: "wkolcz" <[email protected]>
Sent: Friday, January 02, 2009 2:45 PM
To: [email protected]
Subject: [flexcoders] AS3 RemoteObjects and Operations


Thank you to those that have taken the time to try to help me understand AS RemoteObjects. Its much more detailed than the mxml version, but that is why I want to learn it. Having said that...

When creating a DAO Class for CRUD, is it necessary / best practice declare the operation name? I don't see it declared in the few examples online that I can find for creating RemoteObjects in AS. For example, is this right for a set up?

package com.isavepets.data
{
    import mx.rpc.events.FaultEvent;
    import mx.rpc.remoting.Operation;
    import mx.rpc.remoting.RemoteObject;

    public class PetDAO
    {

        private var ro:RemoteObject;
        private var create:Operation;
        private var read:Operation;
        private var update:Operation;
        private var deletePet:Operation;

        public function PetDAO()
        {
            var ro:RemoteObject = new RemoteObject();
            ro.destination = "ColdFusion";
            ro.source = "com.isavepets.pets.petDAO";
            ro.addEventListener(FaultEvent.FAULT, faultHandler);
        }

    }
}

Then build functions off of them:

public function create(petData:Object):void {
    var create:Operation = new Operation(ro, "create");
    ro.create(petData):
}

Thanks again. trying to wrap my head about RemoteObjects and how to create them in one Class that my app can use over and over.





Reply via email to