Groups | Blog | Home
all groups > coldfusion flash integration > march 2007 >

coldfusion flash integration : Flashing Remoting Help


david_sternberg
3/20/2007 2:09:49 PM
Will someone please provide some links that show exactly how to access a
coldfusion component using the most up to date methods. I am using Flash
Professional 8. All the docs I find are for Flash 2004 MX which don't jive
completely with what I am using. Also examples using #include "NetServices.as"
are not what I am looking for. An example I am looking for is how do populate
a dropdown menu flash component with dynamic data from a simple query to a
database form a .cfc file. I just need a proof of concept to my manager so I
can proceed with flash development. I really have to be spoon fed to understand
this.

Thanks
Dave
david_sternberg
3/20/2007 2:22:50 PM
Let me explain about the #include "NetServices.as"

Every time I try using these examples I always get a error saying:

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Error opening include
file NetServices.as: File not found.
#include "NetServices.as"

I have the flash 8 action script bible and it's chapter 36 on data integration
uses imports but the example is with .php. I need a good example of the most up
to date way to do what I need.

Dave
Azadi
3/21/2007 10:37:24 PM
see if this helps:

http://www.flash-remoting.com/examples/MultipleCombo/

--
Azadi Saryev
Sabai-dee.com
Vientiane, Laos
Mark Forsberg
4/3/2007 6:32:10 PM
Here you go.

http://www.asfusion.com/blog/entry/introduction-to-flash-remoting

I believe that the first method that they show is how you would do in Flash 8.
You must use the second method to remote in CF and Flashforms.
Good luck.

Mark


Mark Forsberg
4/3/2007 6:36:54 PM
David,

I just thought about this code. This is the "modern" way, at least to my
understanding. You might also want to try the Flash forum. They have a section
on remoting as well.



//Import Stuff
import mx.remoting.*;
import mx.rpc.*;
import mx.services.Log;

//Data type the components
var name_txt:mx.controls.TextArea;
var myGrid_dg:mx.controls.DataGrid;

//Remoting Stuff

mx.remoting.debug.NetDebug.initialize();

var myLogger:Log = new Log( Log.DEBUG, "logger1" );

//override the default log handler
myLogger.onLog = function(message:String):Void{
trace("myLogger: " + message);
}

//Create the service
myService = new
Service("http://localhost/flashservices/gateway",myLogger,"Phonebook.CFC.phoneDa
ta",null,null);

//Hander for results
function onGetData(msg:ResultEvent){
mx.remoting.debug.NetDebug.trace({level:"Debug",message:"onGetData" });
myGrid_dg.dataProvider = msg;
}

//Handler for errors
function onDataFault(rs: FaultEvent){
mx.remoting.debug.NetDebug.trace({level:"None", message:"Oops!: " +
fault.fault.faultstring });
}

var pc:PendingCall = myService.getNetworkUsers;
pc.responder = new RelayResponder(this._parent, "onGetData", "onDataFault");

//Create Button to close swf

var oNameListener: Object = new Object();
oNameListener.click = function(){
//trace('Mark');
getURL("javascript:window.opener=self;window.close()");

}
close_btn.addEventListener("click",oNameListener);
AddThis Social Bookmark Button