Flex 3: How to log into Ribbit
Wally Kolcz
As I start to develop sample Flex 3 and 4 apps that including the Ribbit (http://www.ribbit.com) library and functionality I noticed that the example on Ribbit's site on how to log into the account is incorrect. They list, in thier example (http://docs.ribbit.com/index.php?option=com_content&view=article&id=59:sms-and-ribbit&catid=38:flex-articles) to login you use this:
request.login(username, password, devID, appID);
However, everything I did it that way, I get a 'Expected 5 arguments and only got 4' error due to the ILoginParam is missing.This was driving me nuts!
Here is the solution that works:
public function initApp():void {
var loginParam:ILoginParam = new LoginParam(); //Creates an ILoginParam Object
loginParam.username = "myaccountusername"; //These next 4 lines fills it
loginParam.password = "mypassword";
loginParam.devID = "wkolcz";
loginParam.appID = "wkolcz_SampleProject";
request.login("", "", "", "", loginParam); // Pass in empty values for all aurgments except the ILoginParam object
request.authenticationManager.addEventListener(AuthenticationEvent.LOGGED_IN, afterLoginFunction); //Listen for it to finish logging in
request.authenticationManager.addEventListener(AuthenticationEvent.LOGGING_IN, loggingIn); //Listens while it is logging in
request.authenticationManager.addEventListener(AuthenticationEvent.ERROR, errorInLogin); //There was an error in the login
}
This will allow you to login to your account and then listen for it logging in (setup) and when you login (to fire off what ever functionality to want) and if there is an error in the login process.
Posted in Ribbit | Flex | Flash |
4 comments
Aug 28, 2009 at 1:33 AM
Excuse me. It is not enough to aim; you must hit. Help me! Could you help me find sites on the: By nature handmade soaps. I found only this - <a href="http://www.saeon.ac.za/Members/Soap">package handmade Soap</a>. Some pictures loom to vary smooth products when flanging white because they range widely sell footwear as exclusive as century bassists. Mount mutria, being hours in produce are great, away in plastic. With best wishes :eek:, Wells from Great.
Nov 26, 2009 at 2:20 AM
I will bookmark and continue reading your blog in the future! Thanks alot for the informative post!
Feb 20, 2010 at 8:28 AM
I am to submit a report on this niche your post has been very very helpfull
Regards
Mar 8, 2010 at 2:21 AM
This is the best post on this topic i have ever read.