AIR Tip: Getting Logged In Username

John C. Bland II

Just a quick tip here:

bq. var username:String = File.userDirectory.name;

So far I know it works on Mac/Windows but I haven’t tested Linux.

Hope it helps.




This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

2 Responses to “AIR Tip: Getting Logged In Username”

  • David Tucker Says:

    It is important to remember that there are situations where the user directory name will not equal the username. For example, if the user changes their username, the directory will still retain the old name (at least on Mac).

  • John C. Bland II Says:

    Very good point David. Any solid way to gain the username? For me, this works ’cause this is a corporate environment where usernames are set.

Leave a Reply

  • Get Adobe Flash playerPlugin by wpburn.com wordpress themes