Now we're getting somewhere ;-)

The Delegate part was ok, you just assigned it to getUserResult rather than 
getUserResult.onResult.

And the following isn't necessary:

> var getUserResult = new Object();
> getUserResult = generatorWS.GetUserObject()

You're creating a new Object and then assign another one in the next line.
I've seen you do that before in other code you posted, so maybe it's a 
missconception regarding invoking methods that return 
something.

Maybe this example clarifies what you're doing:

function getNewObject():Object {
    return new Object();
}
var o:Object = new Object();
o = getNewObject(); // ==> new Object();

In the above, 2 objects are created, but the second one replaces the first one.
Or simply put:

var o:Object = new Object();
o = new Object();

So this should suffice:

function getObject():Object {
    return new Object();
}
var o:Object = getObject();

Putting it all together (going back to the webservice example):

import mx.services.*;
import mx.utils.Delegate;

 function myWSLoadHandler() {
    var myData_pc:PendingCall = myWS.getMyData();
    myData_pc.onResult = Delegate.create(this, myDataResultHandler);
}

regards,
Muzak

----- Original Message ----- 
From: "Merrill, Jason" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, April 10, 2007 7:45 PM
Subject: RE: [Flashcoders] WebServices in Flash IDE ...


> Actually, looking at it now that you're calling me out, I thought I was
> crazy, but noticed a typo- and instead of Delegate, I used assigned
> anonymous function, but the same basic form works.
>
> var getUserResult = new Object();
> getUserResult = generatorWS.GetUserObject()
> getUserResult.onResult = function(result){trace(result)}
>
> That does work.
>
> Jason Merrill
> Bank of America
> GT&O Learning & Leadership Development
> eTools & Multimedia Team


_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to