buddylist example error

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Post Reply
Kenn
Posts: 9
Joined: 03 Apr 2009, 12:25

buddylist example error

Post 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!
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Is it possible that you are pointing to an old version of the API?
Try tracing the version of the API:

Code: Select all

trace(sfs.getVersion())
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)
Lapo
--
gotoAndPlay()
...addicted to flash games
Kenn
Posts: 9
Joined: 03 Apr 2009, 12:25

Post 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?
Kenn
Posts: 9
Joined: 03 Apr 2009, 12:25

Post 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 = ""	
	}
}
Kenn
Posts: 9
Joined: 03 Apr 2009, 12:25

Post 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!
Post Reply