Dynmanic Geo Targeting in Flash

miketpowell

New member
Feb 20, 2009
755
26
0
Las Vegas
I'm trying to create flash files that dynamically change to match the users location.

I'm used to doing it on HTML LPs no problem with JS or PHP but can't figure out a way to do it in flash.

Could someone point me in a helpful direction? Thanks.
 


When you distribute a .swf, the code runs locally on the clients machine. The GeoIP lookup requires a 21mb database. Therefore, you want to do the lookup serverside and pass the values back to the client. This is what you're already doing with PHP lookups.

Then, you just pass the variables into your swf from your HTML, something like this --
Code:
<EMBED src="flaMovie1.swf?city=<?php echo $city ?>&country=<?php echo $country?>" 
    quality=high bgcolor=#FFFFFF WIDTH="250" HEIGHT="250" NAME="flaMovie1"
    TYPE="application/x-shockwave-flash" 
    PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
Then you can access the variables (in ActionScript) as "_root.city" and "_root.country".
Hit me up on AIM if you need more specifics :)
 
Awesome man thank you - I set up clickTags in the banners all the time but I never realized how they really worked and was just copying a tutortial. Now that I see it actually passes variables to the swf that can be used I can see how I'll implement this.

I made an HTML ad and in the HTML it grabs the location and then pass the location and clickTag from adserver into the .swf and everything seems to work great and the ad server can track the clicks.

Thanks!