如何站点锁定一个Flash应用程序? [英] How to Site-Lock a Flash Application?

查看:122
本文介绍了如何站点锁定一个Flash应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有,我打算把在我的网站上不久,Flash应用程序。我希望能够锁定到现场prevent:

I have a flash application that I am going to put up on my website shortly. I want to be able to "lock it" to the site to prevent:

  • 主办.SWF在其他网站上(非法下载后)和
  • preventing从开放的.SWF如果包括在一个iFrame在其他网站

尽管允许:

  • 在网站的白名单将通过/启用过去了,没有我不必定义URL的所有变化(如:www.abc.com,abc.com,abc.com/game/,games.abc.com,等等。)

有那花费数百美元来执行此任务的商业应用程序,但我pretty的肯定这是可以做到的:

There are commercial applications that cost hundreds of dollars to perform this task, but I'm pretty sure it can be done with:

root.loaderInfo.url

不知何故。没有人有知道如何去这样做?我最大的担忧是的iFrame prevention,因为当网站窃取闪光,他们通常只是iframe来自己的网站,以节省自己的带宽成本。

Somehow. Does anyone out there know how to go about doing this? My biggest concern is the iFrame prevention, as when sites steal flash they usually just iframe to your own site to save themselves the bandwidth costs.

我在使用Flex SDK(不是Flash IDE),所以一些纯AS3 code会做的伎俩我。

I'm using Flex SDK (not the Flash IDE) so some pure AS3 code will do the trick for me.

推荐答案

这code会报到加载URL。你可以用它在你的主加载器显示一个未经授权的消息,或者根本无法加载,如果它不符合你所期望的:

This code will report back the loading URL. You can use it in your main loader to show an unauthorized message or not load at all if it doesn't match what you expect:

public static function Domain(root:Sprite):String {
    var currentDomain:String = root.loaderInfo.url.split("/")[2];
    var fqdn:Array = currentDomain.split(".");
    var rdi:int = 1;
    var tli:int = 2; 
    if (fqdn.length == 2) {
    	rdi--;
    	tli--;
    }

    return fqdn[rdi] + "." + fqdn[tli];
}

这篇关于如何站点锁定一个Flash应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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