阻止swf文件被盗链 [英] Stop swf file from being hotlinked

查看:208
本文介绍了阻止swf文件被盗链的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何阻止其他网站管理员盗用我的Flash应用程序,并在他们的网站上使用它。

>让Flash应用程序检查域名,如果它没有在您的域名,使其重定向到您的网站。让其他网站管理员将流量引导至您的网站。 :)

  import flash.net.LocalConnection; 
var lc:LocalConnection = new LocalConnection();
switch(lc.domain){
caselocalhost:
casemydomain.com
break;
默认值:
//在这里重定向
}

I使用一个switch语句来检测这个,因为如果你正在测试你的应用程序并在本地文件系统下运行,它将会是localhost,显然你不想在测试期间重定向。

I would like to know how I can stop other webmasters from hotlinking my flash application and using it on their websites.

解决方案

Have the flash app check the domain and if it fails to be on your domain make it redirect to your site. Let the other webmasters drive traffic to your site. :)

    import flash.net.LocalConnection;
    var lc:LocalConnection = new LocalConnection();
    switch( lc.domain ){
      case "localhost":
      case "mydomain.com"
        break;
      default:
        // do redirect here
}

I use a switch statement to detect this, because if you are testing your app and running under the local file system it will be localhost and obviously you don't want to redirect during testing

这篇关于阻止swf文件被盗链的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆