Page 1 of 1
buddylist example error
Posted: 03 Apr 2009, 12:37
by Kenn
Hey, i cant get the 24_pro_buddyList2 (as2) example to work.. I have changed the classpath to the latest as2 API, but i still get these errors:
There is no property with the name 'onBuddyPermissionRequest'.
There is no method with the name 'sendBuddyPermissionResponse'.
There is no method with the name 'getBuddyByName'.
There is no method with the name 'setBuddyBlockStatus'.
There is no method with the name 'setBuddyBlockStatus'.
There is no method with the name 'getBuddyById'.
All other examples seem to run fine, but this one just wont work whatever i put in the classpath.. Any ideas?
Cheers!
Posted: 03 Apr 2009, 13:38
by Lapo
Is it possible that you are pointing to an old version of the API?
Try tracing the version of the API:
Where
sfs is an instance of SmartFoxClient
It should be 1.5.x depending on which SFS version you use, assuming it's a 1.6.x version (yep, API version and Server version are different)
Posted: 06 Apr 2009, 09:20
by Kenn
Hmm weird, it was pointing to the right API, it just took a reboot for it to show! Thanks mate
Ive been playing around all morning trying to learn the basics of the buddylist functions, and ran in to a rather weird bug, was hoping you could help me out a bit!
I made two diffrent ways of adding friends to the buddylist, first one is the "select a user from user_lb and press add friend", and that one works perfectly.
The other way is typing in the username in a textbox and press add (like the buddylist 2.0 example).. The first friend you add this way (unless you added someone using the first method first!) will show up in the buddylist without the on/off tag, and you cant send PMs to this user. However, the second, third, and so on, works perfectly..
Any ideas?
Posted: 06 Apr 2009, 12:45
by Kenn
Here is the code if thats to any help..
This works without any problems.
Code: Select all
function addBuddy() {
var item:Object = chatPanel.mainList_lb.getSelectedItem()
if (item != undefined) {
smartfox.addBuddy(item.label)
}
}
This works
after a friend is added (using this button OR the addBuddy function)..
Code: Select all
addBuddy_btn.onRelease = function() {
if (buddyName_txt.text != "") {
smartfox.addBuddy(buddyName_txt.text)
buddyName_txt.text = ""
}
}
Posted: 14 Apr 2009, 11:48
by Kenn
After a few days of scratching my head wondering why it the first add refused to work, while second, third, and so on, worked, i found out that my input-text had "render text as html" enabled for some reason..
After disabling "render text as html" even the first add works fine!