all groups > macromedia flash flash remoting > january 2005 >
You're in the

macromedia flash flash remoting

group:

What to do with data once in Flash


What to do with data once in Flash tapsmedia
1/13/2005 10:08:25 PM
macromedia flash flash remoting:
HI TEAM This is my .as mx.remoting.debug.NetDebug.initialize(); 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; // Initialization code,
run once for each movie instance. if (inited == null) { inited = true;
// Specify the main movie (this) as the default responder object.
//weatherService = gatewayConnection.getService('flashExamples.weatherStation',
this); // connect to service and create service object var
howdyService:Service = new Service(
'http://devmayaguezmall/flashservices/gateway', new Log(),
'remoteservices', null, null ); // call the service helloWorld()
method var pc:PendingCall = howdyService.historia('2'); } // tell the service
what methods handle result and fault conditions pc.responder = new
RelayResponder( this, 'serviceFunctionName_Result', 'serviceFunctionName_Fault'
); function serviceFunctionName_Result(result:ResultEvent) { var
Historia:Object = new Object(); var temp:Object = result.result + ' ASS';
//trace(temp); // will print undefined // display successful result
titleDisplay.text = result.result.mTitles; //GIVES Type Function.toString
// display successful result messageDisplay.text = result.result;
//messageDisplay.text = temp; } function
serviceFunctionName_Fault(fault:FaultEvent) { //display fault returned from
service messageDisplay.text = fault.fault.faultstring; } MY .CFM <CFQUERY
DATASOURCE='mMall' NAME='GetHistoria'> SELECT * FROM tbl_Historia <!---WHERE
ID = '#flash.params#'---> </CFQUERY> <cfset flash.Result =
GetHistoria<!---.Historia--->> THIS WOrks fine. I get the data in the
Netconnect debugger. Result (object #2) .....mRecordsAvailable: 2
......serverinfo: (undefined) .....uniqueID: 2 ....._items (object #3)
...........[0] (object #4) ...............Historia: 'El Mayaguez Mall fue
iniciativa' ...............ID: 1 ...............__ID__: 0 ..........[1] (object
#5) ...............Historia: 'this king of exception? 'SERVER.PROCESSING'
.....description: 'Service threw an exception during method invocation'
................ID: 2 ...............__ID__: 1 .....mTitles (object #6)
...........[0]: 'ID' ..........[1]: 'Historia' If you notice I can specify in
the .cfm to get data from a table, What do I do with the data I either get one
record or none at al ( I GET [object, object]. Whats the next step from here!
I'd like to know also, If can send a ID to my .cfm from flash to pull a
specific record. I created another approach with a .cfc
(http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=250&amp
;threadid=945165&amp;enterthread=y) but I was even more flustered with no
results. I have seen many posts with the same issues but no answers. Any luck
this time around?? Thanks
Re: What to do with data once in Flash Ekur
1/13/2005 11:37:29 PM
When you get data from a database query you get it as a RecordSet. Read more
about the RecordSet class in flash.
Change your result function to this:
function serviceFunctionName_Result(result:ResultEvent)
{
rs:RecordSet=Recordset(result.result);
}

If you call the result propertie in the ResultEvent object (also called result
in your case) it will return a RecordSet with all the posts you asked for in
the database query. Then you can do alot of things with the RecordSet, like
filtering, sorting. And then you can call a function to turn the RecordSet into
an array and present the data on your page. But it read more about the
RecordSet class in Flash.

//Erik
Re: What to do with data once in Flash tapsmedia
1/14/2005 6:09:43 PM
HI ERik Thaknks I added this function
serviceFunctionName_Result(result:ResultEvent) { // var rs:RecordSet =
RecordSet(resultEvent.result); //resultEvent.result); result.result
trace(rs.length + ' RS'); //This trace does not work . DO I have to add items
to this RecordSet or is the data from the query considered a Recordset
already?? //var rs:RecordSet = new Recordset(result.result); var
Historia:Object = new Object(); var temp:Object = result.result;
//trace(temp); // will print undefined // display successful result
titleDisplay.text = result.result.mTitles; //GIVES Type Function.toString
// display successful result messageDisplay.text = result.result;
//messageDisplay.text = temp; }
AddThis Social Bookmark Button