Quick Flash Remoting Fix (and simple Flex Sample) for Tartan Sample Application
Taking the helloWorld example, either:
- Copy the
configfolder intartanSamples\helloWorldtotartanSamples\helloWorld\remote, or - Alter line 28 of
tartanSamples\Application.cfcto readconfigFileLocation="#ExpandPath('../config/service.xml')#"(note the added "../" at the start of the path.)
Also, I don't believe that there are any Flash or Flex samples for using Tartan with Flash Remoting (it's actually dead simple) so here's the simplest possible Flex example:
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" xmlns="*" load="initForm()"> <mx:Button label="Get greeting" click="getGreeting()" /> <mx:Label id="status" /> <mx:Script> <![CDATA[ import mx.remoting.Service; import mx.remoting.PendingCall; import mx.rpc.RelayResponder; import mx.rpc.ResultEvent; import mx.rpc.FaultEvent; import mx.remoting.debug.NetDebug; var helloWorldService:Service; function initForm() { NetDebug.initialize(); var gatewayURL:String = "http://localhost:8500/flashservices/gateway"; helloWorldService = new Service ( gatewayURL, null, "tartanSamples.helloWorld.remote.HelloWorldFlashService", null, null ); status.text="Initialized."; } function getGreeting() { var pendingCall = helloWorldService.getGreeting ( "English" ); pendingCall.responder = new RelayResponder(this, "onResult", "onStatus"); } function onResult (resultObj:ResultEvent) { status.text = resultObj.result; } function onStatus ( faultObj:FaultEvent ) { status.text = "There was an error getting the greeting."; } ]]> </mx:Script> </mx:Application>
I look forward to working with Tartan on our current Flex/CF project. We will be using it in conjunction with Model-Glue on the server side and, of course, Arp on the client
The Quick Flash Remoting Fix (and simple Flex Sample) for Tartan Sample Application article by Aral Balkan, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial 2.0 UK: England License.

Subscribe to my blog






pkenney
Thanks for finding the bug and putting the sample flash remoting code together. I fixed the bug in the HelloWorld app, and I figure I can use the mxml in the Tartan sample code.
September 3rd, 2005 at 10:30 pm