Flash CS3 - Flash CS4

Free tutorials and scripts for all.
Actionscript 3.0

flash remoting with AS 3

This is a discussion on flash remoting with AS 3 within the advanced Actionscript 3.0 forums, part of the Flash CS3 eng category; I am trying to set up flash remoting with flash CS 3 with a codefusion backend(cfc) I have done ...


Go Back   Forum Flash CS3 Flash CS4 > English Forums > Flash CS3 eng > advanced Actionscript 3.0

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 24-09-08, 07:18
Junior Member
 
Join Date: Jul 2008
Location: Hawaii
Posts: 1
Rep Power: 0
johnbarrett is on a distinguished road
flash remoting with AS 3

I am trying to set up flash remoting with flash CS 3 with a codefusion backend(cfc)
I have done this with AS 2 and flash 8, but I am having problems with flash cs 3 and as 2


Code:
import mx.remoting.Service; 
import mx.services.Log; 
import mx.rpc.RelayResponder; 
import mx.rpc.FaultEvent; 
import mx.rpc.ResultEvent; 
import mx.remoting.PendingCall; 
import mx.remoting.RecordSet; 
import mx.remoting.DataGlue; 

// Connect to the Gateway 
// Establish the Service 
var myService: Service = new Service( "http://localhost/flashservices/gateway", new Log (Log.DEBUG), "cfcs.getTest", null, null); 
//path to the cfc localhost/cfcs/GetTest.cfc

//Test the Connection
function getTestConn(){ 
//Create a PendingCall object 
var getTestConn_pc:PendingCall = myService.getTestConn();
//Use the responder property to handle the success for failure 

testConn_pc.responder = new RelayResponder(this, "getTestConn_Result","getTestConn_Fault");
} 
//Handle the Success 
function getTestConn_Result(re:ResultEvent){ 
trace(re.result); 
} 
//Handle the Failure 
function getTestConn_Fault(fault:FaultEvent):Void{ 
trace("error"); 
} 
// Start Application 
getTestConn();
ColdFusion CFC
Code:
<cfcomponent displayName="getTest"> 
<!-- Establish a Flash Remoting Connection --> 
<cffunction name="getTestConn" access="remote" returnType="string" output="true">
<cfreturn "....connection successful"> 
</cffunction> 
</cfcomponent>
Trace Window
Code:
9/18 20:20:38 [INFO] : Creating Service for cfcs.getTest
9/18 20:20:38 [INFO] : Creating gateway connection for http://localhost/flashservices/gateway
9/18 20:20:38 [INFO] : Successfully created Service
9/18 20:20:38 [INFO] : Invoking getTestConn on cfcs.getTest
9/18 20:20:44 [INFO] : cfcs.getTest.getTestConn() returned "....connection successful"
I am trying to convert this to actionscript 3:
Code:
import flash.net.*;

var myservice:NetConnection = new NetConnection();
myservice.connect("http://localhost/flashservices/gateway");

var responder:Responder = new Responder(onResult, onFault);

function onResult(responder:Object):void{
trace(responder);
}

function onFault(responder:Object):void{
trace(responder);

}

myservice.call("cfcs.getTest", responder);
I can't get the trace window to output:(
I am trying to convert the old AS 2 code to AS 3.
Can anybody here help me?

Thanks,
John
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
Flash remoting in AS 3.0 to ASP.NET 2.0 flash.net danmo advanced Actionscript 3.0 9 08-06-08 19:13


All times are GMT. The time now is 22:28.


Powered by vBulletin versione 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC4
Forum SiteMap


FlepStudio
by Filippo Lughi
P.IVA 03605860406