Expand my Community achievements bar.

LocalAuthenticator question

Avatar

Former Community Member
I'm using LocalAuthenticator like so:



<rtc:LocalAuthenticator id="cocomoAuthenticator" />



Then when I connect the user (to subscribe) I set the
username like this:



cocomoAuthenticator.userName = "test";



This however never sets the username to "test" but always to
the random username generated by Cocomo when a username is not
supplied. There has to be something obvious I'm missing here?



Thanks,



Chad

3 Replies

Avatar

Former Community Member
Hi ,



Did you try running the LocalConnection example in the
examples folder ? It takes an userName as ArbitraryUserName and
shows that as userName. So, it should work fine. Just try running
that example and yes, you need to stop and restart the server if
you are changing the username.



Thanks

Hironmay Basu

Avatar

Former Community Member
Hi Hironmay,



I have no problems when I do this (the LocalConnection
example uses this way too):

<rtc:LocalAuthenticator id="cocomoAuthenticator"
userName="Chad" />



Then it always works as expected. However, I don't want to
hardcode a username there, I want the user to be able to set it
themselves. When I leave out the "userName" from the
LocalAuthenticator tag and attempt to set it in ActionScript to
something the user defines as their username it never gets set and
defaults to the randomly generated username rather than the one I
specified. I moved around the code I use to set the username to
before and after the connection to the server is made but neither
helps and it just gets ignored.



Chad

Avatar

Former Community Member
Hi,



This sounds like a bug, we will verify it and if it happens,
we will fix in the next drop.