[Tips] AS3 User location/country detector based on IP

I have wrote a script that automates the process of your project in detecting the user location based on their current IP address via maxmind’s Javascript API. What you will need to do is to

  • See the demo below
  • Get the source code
  • Read the comment inside the FLA and start using it  :D

What is this?

A simplified script that detects the visitor’s country and other details such as latitude/longtitude based on their current IP address.

Why is this necessary?

I felt that there is a need sometimes for us to automate the language selection or region selection process in some major big site that helps in cutting down user frustration through multiple clicks before going into the site. I figured this could be useful.

How to use it?

What you will need to do is to wait until the loading listener is completed before using it.  Sample usage :

var userCountry:String = getCountryName();

Where to get the files?

Download the source file

View the demo (SWF)