Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get information about the User's Browser in Flex?

I'd like to know what Browser the User is using to view my Flex application. How can I get at the User Agent string and other information?

like image 378
DyreSchlock Avatar asked Apr 13 '09 21:04

DyreSchlock


1 Answers

you can 'embed' your javascript inside AS3 code like this :

var v : String = ExternalInterface.call("function(){return navigator.appVersion+'-'+navigator.appName;}");
var t : TextField = new TextField();
t.autoSize = TextFieldAutoSize.LEFT;            
addChild(t);
t.text = v;

the textField will display infos about the navigator like this (chrome):

5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.53 Safari/525.19-Netscape

like image 82
OXMO456 Avatar answered Oct 30 '22 21:10

OXMO456