PDA

View Full Version : AMF.NET 3.0 Flash Remoting


cellis3306
09-26-2007, 03:06 AM
Has anyone used this ?

If so, can you tell me why it doesn't support conditionals.

I can call a method from C# with it from outside a condition like this:

//implementation code at top of file

but if I do

if(a=1)
{
//implementation
}

nothing happens. any help greatly appreciated!

cellis3306
09-26-2007, 03:16 AM
this may help someone desperately searching for the answer

my code initially looked like this


var x:Number =2;
if(x==2)
{
var pc:PendingCall = svcService.GetUser();
pc.responder =
new RelayResponder(
this, "onSuccess",
"onFault");
function onSuccess(re:ResultEvent)
{

txtTestBox.text += re.result[1];
txtTestBox.text += re.result[0];
txtTestBox.text += "dafdafew2342343";
//trace(re.result.
//trace(re);
}
function onFault(re:ResultEvent)
{
txtTestBox.text = "no go!";
}

}

for some reason, if the status methods exist in the body of the conditional, they don't work!!

so I did this

var x:Number = 2;
if(x==2)
{
var pc:PendingCall = svcService.GetUser();
pc.responder =
new RelayResponder(
this, "onSuccess",
"onFault");
}
function onSuccess(re:ResultEvent)
{

txtTestBox.text += re.result[1];
txtTestBox.text += re.result[0];
txtTestBox.text += "dafdafew2342343";
//trace(re.result.
//trace(re);
}
function onFault(re:ResultEvent)
{
txtTestBox.text = "no go!";
}


Works like a charm! Maybe this will save someone a night of frustration :)

oh and btw http://amfnet.openmymind.net - for open source .NET remoting