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

macromedia flash flash remoting : _Result not called inside a class


shadysamir
3/9/2005 3:41:28 PM
I am using .NET remoting inside a class, my code is like that:

import mx.remoting.*

class myclass{
function myClass(){
//no initializtion, call from symbol
}
public function init() {
gatewayConnection =
NetServices.createGatewayConne?ction("http://10.0.0.15/gateway.aspx");
trace("Done Connection")
loadData();
}
private function loadData() {
rs=new mx.data.components.DataSet()
trace("Set rs")
MSQL=gatewayConnection.getServ?ice("remoting", this)
MSQL.MService("select * from videolist")
trace("done sql")
}
private function MService_Result(result){
trace("result")
rs.dataProvider = result;
}
private function MService_Status(stat){
trace("DataCallFailed-" + stat.code);
}
}

When I call init() the _Result function is never called. I get everything
traced up to "done sql" but neither the result nor the status function get
called. I tried the same .NET service with another flash document but on the
timeline not isnide a class and it worked fine.
shadysamir
3/10/2005 5:59:50 AM
I am not sure why i never get an answer to any of my posts around here! Am I
asking trivial questions that nobody wants to answer or am I asking too
complicated questions that nobody knows anything about? Are my questions clear
or do I need to explain more?
Tom Coleman
3/10/2005 9:23:46 AM
Hi shadysamir,

It looks like you have a couple of typos that could munge your function:

gatewayConnection =
NetServices.createGatewayConne?ction("http://10.0.0.15/gateway.aspx");

Note the "?" in the middle of the "createGatewayConne?ction" property, and:

MSQL=gatewayConnection.getServ?ice("remoting", this)

also has a "?" in the middle of the property.

HTH,
Tom

[quoted text, click to view]
shadysamir
3/11/2005 9:55:32 AM
Thank you for your reply. I am not sure why you got my post with those question
marks but they are not there, nor they are in my code. Anyway, I figured out
that so many people are having the same problem. The _Result handler is not
called inside a class. I am not sure why and i came across a few posts on some
newsgroups, all with no answers.
AddThis Social Bookmark Button