Topic: Game Programming /
checking if a swf is hosted by kongregate
It’s almost as simple as just comparing stage.loaderInfo.url
This article provides a good explanation of how to site lock. Just follow the basics in it and instead of site locking alter the preloader code in use.
If you want a really easy solution you could just use:
if (stage.loaderInfo.url.indexOf("kongregate.com") != -1)
{
// kong preloader
}
else
{
// mochi preloader
}
However that does leave a loop hole where a malicious portal owner can disable the ads by simply adding “kongregate.com” to the url. For example under this method the url:
http://www.example.com/graygers_game/kongregate.com/file.swf
Would display the kong preloader, not the mochi one
|