Skip to main content
nikos101
Inspiring
May 24, 2011
Answered

Async.asyncNativeResponder in place of Async.Responder?

  • May 24, 2011
  • 1 reply
  • 3558 views

I'm using 4.1 and the asyc class doesn't seem to have Async.Responder, so I tried this:

token.addResponder(Async.asyncNativeResponder(this, onResult, faultHandler, 600));

but get an issue:

Implicit coercion of a value of type flash.net:Responder to an unrelated type mx.rpc:IResponder.

This topic has been closed for replies.
Correct answer mlabriola

There are two types of responders:

flash.net.Responder which is in Flash Player 

mx.rpc.IResponder which is a Flex class

So, if you want to be able to use mx.rpc.IResponder (a Flex class) you need to have a Flex build of FlexUnit. This functionality is not included in the ActionScript only build as it is not part of the ActionScript API.

If you have a Flex build the Async class will have:

Async.asyncResponder() which returns an IResponder

Async.asyncNativeResponder() will return a flash.net.Responder, hence your error.

Mike

1 reply

mlabriolaCorrect answer
Participating Frequently
May 24, 2011

There are two types of responders:

flash.net.Responder which is in Flash Player 

mx.rpc.IResponder which is a Flex class

So, if you want to be able to use mx.rpc.IResponder (a Flex class) you need to have a Flex build of FlexUnit. This functionality is not included in the ActionScript only build as it is not part of the ActionScript API.

If you have a Flex build the Async class will have:

Async.asyncResponder() which returns an IResponder

Async.asyncNativeResponder() will return a flash.net.Responder, hence your error.

Mike

nikos101
nikos101Author
Inspiring
May 24, 2011

I have both builds in the same folder so my ide was pickup only the as one up,

thanks