ActionScript 2, Detect Browser

I want to detect the browser type/version from within a Flash file. I can't use any server-side scripting, so I'm hoping to do it via Actionscript. Is this possible?

Who is Participating?
CyanBlueConnect With a Mentor Commented:
You could use JavaScript's navigator.userAgent to tell the type and the version of the web browser...  Take a look at these pages for more information on that...

So, what you need to do is to place this simple JavaScript function inside the HTML file...
      function getUserAgent()
            return navigator.userAgent;

and call it from the Flash like this: var ua:String ="getUserAgent");

Once you receive the ua back from Flash, you can do a string manipulation to check what browser you are on...  This logic can be placed inside the JavaScript if you want to...  But I will leave that up to you...  Please check the attached file for more information...

KaressaAuthor Commented:
Sweet! Thanks!!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.