PDA

View Full Version : flash service returns undefined


pierot
05-04-2005, 09:29 PM
hi

I’m having troubles with the use of flash remoting

I have a class called daoZoek. this class is the data accessor for searching members in a database using flash remoting. Everything worked before but yesterday I decided to place my classes in folder (be.wellconsidered.dao instead of be.wellconsidered.*) so the project has a better structure.

But since then, this class doesn’t work anymore. The strange thing is that I have a similar class to register, edit and login members and that class still works as it should be

so, the problem with daoZoek is the service. when I try to trace “zoekService” it returns “undefined” which is strange because daoLid (for registering, login and edit) is just the same.

also, the gateway path and the service path are correct as well as the methodname.

this is the code

import be.wellconsidered.*;
import be.wellconsidered.dao.*;
import mx.remoting.*;
import mx.services.*;
import mx.rpc.*;
import mx.remoting.debug.*;
//
class be.wellconsidered.dao.daoZoek extends MovieClip {
// VARS
private static var instantie:daoZoek = new daoZoek();
private static var zoekService;
// CONSTRUCTOR
private function daoZoek() {
// SERVICE INIT
zoekService = new Service("http://localhost/__flashservices/gateway.php", null, "WT.Zoeken", null, null);
trace(zoekService);
}
// GETDAOLID
public static function getInstance():daoZoek {
if (instantie == null) {
instantie = new daoZoek();
}
return instantie;
}
/* --ZOEK ALL LEDEN-------------------------------------------------------------------------------- */
public function zoekLid(o:Object, onResult:String, onFault:String, search_term:String):Void {
var pc:PendingCall = zoekService.zoekLeden(search_term);
pc.responder = new RelayResponder(o, onResult, onFault);
}

}