Forum ActionScript 3.0 Issue with updating to version 2.2

Problems and discussions relating to ActionScript 3.0 here.

Issue with updating to version 2.2

Postby mfranzs » April 14th, 2011, 10:13 pm

Today I upgraded to version 2.2.

I then received these errors in the flash "compiler errors" pannel. I did not change any code- i only upgraded by replacing the 2 folders-

Line 29 1067: Implicit coercion of a value of type Function to an unrelated type String.

Line 29:
Code: Select all
status2.text="Attempting to connect: 0% complete";
               function initiateConnection(){
                  PlayerIO.connect(stage, Jetpack.gameId, "public", username.text, "", handleConnect, handleError);//THIS IS LINE 29 HERE
               }
               initiateConnection();


And
Line 97 1067: Implicit coercion of a value of type Function to an unrelated type String.

Line 97:
Code: Select all
PlayerIO.quickConnect.simpleRegister(
                     stage,
                     Jetpack.gameId,
                     username.text,
                     password.text,
                     email.text,
                     null, // captcha key, if captcha is used
                     null, // captcha value, if captcha is used
                     {score:0}, // any additional data you want
                          function(client:Client):void{//THIS IS LINE 97 HERE
                        gotoAndStop(1);
                        status.text="You have registered successfully!";
                     },
                     function(e:PlayerIOError):void{
                        trace("Error: ", e)
                     }
                  );   


This is the code to connect to my game... i haven't modified it from the examples. What's wrong?
mfranzs
 
Posts: 98
Joined: August 29th, 2010, 3:27 am

Re: Issue with updating to version 2.2

Postby default0 » April 15th, 2011, 9:59 am

You need to specify a PartnerId now before the callback handlers.
I needed to modify mine like so:
Code: Select all
PlayerIO.quickConnect.simpleRegister(
               stage, // stage
               GlobalGameID, // game ID
               RegisterNameTxt.text, // username
               RegisterPasskeyConfirmTxt.text, // passkey
               "", // email
               "", // captchakey
               "", // captchastring
               null, // extraData
               "", // partnerPayId or sth like that
               SuccessfulRegister, // callback
               FailedRegister); // other callback


You just need to add in another argument containing "" before your Callback Handlers. If you have more troubles with this take a look at the QuickConnect.as from the playerio package :)

Best Regards
Try to play my Game: -->BlackGalaxy<--
User avatar
default0
 
Posts: 115
Joined: February 2nd, 2010, 6:46 pm
Location: Germany

Re: Issue with updating to version 2.2

Postby Henrik » April 15th, 2011, 10:50 am

Yes, we've added one more argument to a bunch of connect and quickconnect methods, but we also tried to make sure the AS3 API was backwards compatible. Seems like we missed a spot.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Issue with updating to version 2.2

Postby mfranzs » April 15th, 2011, 9:33 pm

Great, thanks!

@PlayerIO: A notice in the update box would have been helpful ... :P
mfranzs
 
Posts: 98
Joined: August 29th, 2010, 3:27 am

Re: Issue with updating to version 2.2

Postby Benjaminsen » April 16th, 2011, 11:19 am

mfranzs wrote:Great, thanks!

@PlayerIO: A notice in the update box would have been helpful ... :P


Sorry about that :), it's my fault for forgetting.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark


Return to ActionScript 3.0