Groups | Blog | Home
all groups > macromedia flash flash remoting > january 2005 >

macromedia flash flash remoting : flash recordset



dnk NO[at]SPAM canada.com
1/12/2005 7:10:31 PM
Ekur
1/13/2005 11:48:01 PM
Here's an example from a database query that returns a resultEvent object that
is turned into a RecordSet object when calling the .result property. Then it's
calling a filterfunction and then .items to turn the RecordSet into an array to
present the data on the page.

var rs:Recordset = RecordSet(resultEvent.result);
var rsFiltered = rs.filter(rs, myDate);
var rsItems:Array = rsFiltered.items;

function rsFilter(aRecord:Object, aContext ):Boolean {
return (aRecord.date.getMonth() == aContext.getMonth())
}

//Erik
tapsmedia
1/14/2005 7:08:43 PM
Hi i am trying to pass an ID so that I may pull a specifc record can you
help?? MY Service <!---<cfset ID = flash.params[1].ID><!------>---> <CFQUERY
DATASOURCE='mMall' NAME='GetHistoria'> SELECT * FROM tbl_Historia <!---WHERE
ID = #ID#---> </CFQUERY> <cfset flash.Result = GetHistoria<!---.Historia--->>
MY .AS (I GET ALL RECORDS mx.remoting.debug.NetDebug.initialize(); import
mx.remoting.Service; import mx.remoting.PendingCall; import
mx.remoting.RecordSet; import mx.remoting.DataGlue; import mx.services.Log;
import mx.rpc.RelayResponder; import mx.rpc.FaultEvent; import
mx.rpc.ResultEvent; // 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
params = new Object(); params.ID = 2; var pc:PendingCall =
howdyService.historia(); }// // 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 rs:RecordSet =
RecordSet(result.result); rs.addItem([result.result]); messageDisplay2.text =
DataGlue.bindFormatStrings(messageDisplay2, rs, '#result.result.mTitles#',
'#result.result.mRecordsAvailable#'); //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 // shows the Number of
records messageDisplay.text = result.result.mRecordsAvailable;
//messageDisplay.text = temp; } function
serviceFunctionName_Fault(fault:FaultEvent) { //display fault returned from
service messageDisplay.text = fault.fault.faultstring; } Thanks
AddThis Social Bookmark Button