Forum QuickConnect Getting errors causes an error

Discussion and help relating to PlayerIO's QuickConnect feature, including Facebook Connect and Kongregate Connect.

Getting errors causes an error

Postby jhofmann » June 12th, 2011, 4:55 am

I am writing a game in HaXe. I'm accessing the API by compiling the code to a swc and then inserting it into a library swf, which in the final SWF is accessed by "playerio.*".

The API can connect and I have successfully stored and recieved BigDB data with it, and am moving on to user logins. However, I always get this exception when the API throws an error:

Code: Select all
ReferenceError: Error #1056: Cannot create property playerio:PlayerIOError::_type on bridge.generated.PlayerIOError.
   at bridge.generated::PlayerIOError()
   at Function/<anonymous>()
   at Function/<anonymous>()
   at flash.events::EventDispatcher/dispatchEventFunction()
   at flash.events::EventDispatcher/dispatchEvent()
   at flash.net::URLLoader/onComplete()


Inspecting the data in FlashDevelop's debug tools, the correct error information exists. The only problem is with this property creation. I don't completely understand the problem, but tried a few hacks to see if there was an easy workaround:

I tried loosening the parameters on "playerio.PlayerIOError._type" by changing it to public and * and then recompiling the swc, but to no avail.

I also tried renaming the playerio package to "bridge.generated" which simply caused namespace conflicts with the real bridge.generated classes.
jhofmann
Paid Member
 
Posts: 5
Joined: June 12th, 2011, 2:05 am

Re: Getting errors causes an error

Postby jhofmann » June 12th, 2011, 11:35 am

It works if I give the callback anonymous functions, not static functions.

Could you document this?

edit: Wait. Using anonymous functions works in some callbacks and not others.
edit 2: So far I can only get the registration error to work correctly. Problem definitely not solved.
jhofmann
Paid Member
 
Posts: 5
Joined: June 12th, 2011, 2:05 am

Re: Getting errors causes an error

Postby jhofmann » June 16th, 2011, 2:42 am

I tried wrapping my API integration(including callbacks) into my swc library. This does not work either, it always fails with the same error once I move out of a pure mxmlc environment into the haXe one. Although the functionality has been fine otherwise, I can't use an API that generates corrupt error messages. I am going to try one final thing before I give up and look for alternatives, and that is to do a haXe-native port of the API.
jhofmann
Paid Member
 
Posts: 5
Joined: June 12th, 2011, 2:05 am

Re: Getting errors causes an error

Postby jhofmann » June 16th, 2011, 6:16 am

After some work figuring out how to reproduce PlayerIO.proxy() in haXe(haXe doesn't have the "arguments" related functionality), I succeeded in getting both successful API calls and errors to work by butchering the public-facing API so that it uses "Dynamic" (aka * in AS3) instead of the error classes - the error classes are left completely undefined. Then in my client code I act as if the resulting errors are anonymous objects.

Whew.
jhofmann
Paid Member
 
Posts: 5
Joined: June 12th, 2011, 2:05 am

Re: Getting errors causes an error

Postby Benjaminsen » June 16th, 2011, 9:36 am

jhofmann wrote:After some work figuring out how to reproduce PlayerIO.proxy() in haXe(haXe doesn't have the "arguments" related functionality), I succeeded in getting both successful API calls and errors to work by butchering the public-facing API so that it uses "Dynamic" (aka * in AS3) instead of the error classes - the error classes are left completely undefined. Then in my client code I act as if the resulting errors are anonymous objects.

Whew.


Hey! Sorry for not being ontop of this error report before now. I had plans on installing haXe tomorrow to try to puzzle what might go wrong. I guess you solved it for me :)
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark


Return to QuickConnect



cron