I'm using the following code to teach myself flash/flex. My
question is, how do I differentiate how to handle the various
results from a CFC?
This function sees both calls as the same result. How can I
handle each separately?
private function remotingCFCHandler(e:ResultEvent):void
{
returnedText.text = ObjectUtil.toString(e.result);
}
CODE:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"layout="absolute">
<mx:RemoteObject
id="myCfc"
destination="ColdFusion"
source="test.components.User"
result="remotingCFCHandler(event)"/>
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.utils.ObjectUtil;
private function remotingCFCHandler(e:ResultEvent):void
{
returnedText.text = ObjectUtil.toString(e.result);
}
private function callRemotingCFC():void
{
// invoke sayHelloString method on User.cfc
myCfc.sayHelloString();
}
private function myCFCTest():void{
myCfc.myCFCTest();
}
private function clearText():void{
returnedText.text = '';
}
]]>
</mx:Script>
<mx:VBox>
<mx:TextArea id="returnedText" />
<mx:HBox>
<mx:Button label="Show" click="callRemotingCFC()"/>
<mx:Button label="Clear" click="clearText()" />
</mx:HBox>
<mx:HBox>
<mx:Text x="10" y="80" text="Not Yet" id="myTextBox"/>
<mx:Button label="Mine" click="myCFCTest()" />
</mx:HBox>
</mx:VBox>
</mx:Application>
Thanks for the assist. This is pretty awesome stuff.
Mark F