Flash电影和ActionScript-停止视频脱机工作 [英] Flash Movies and ActionScript - Stop the video from working offline

查看:129
本文介绍了Flash电影和ActionScript-停止视频脱机工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在超级用户上发布了一个问题,该问题似乎具有与代码相关的答案,所以就到这里了。我有个问题;我需要在线共享视频,但需要找到一种方法来完全停止播放视频,或者至少使人们难以下载和在线观看视频。我知道好莱坞有可能做到这一点,但我有个主意...

I posted a question on superuser which seems to have a code related answer, so here it goes. I have a problem; I need to share videos online, but need to find a way to either completely stop, or at least make it hard for people to download them and view them online. I'm aware that if it was possible, Hollywood would have done it already, but I have an idea...

几年前,我偶然发现了一个newgrounds视频.com,Flash动画制作者可以在其网站上发布其内容,以便用户对其进行评分,反馈和评论。在这个网站上,我花了数小时下载视频以在学校播放(噢,具有讽刺意味的...),但是我记得有一个视频是不同。下载并打开.swf文件后,它停止了播放并显示了一个框架,上面写着抱歉,已在newgrounds.com上观看了此动画。您可以随时在其中找到它!。当时我很生气,但是现在它给了我一个主意...

Some years ago I stumbled across a video on newgrounds.com, a site for flash animators to post their content for users to rate, feedback and comment on, a place where I spent hours downloading videos to play them at school (oh the irony...), but I remember one video was diferent. After downloading, and opening the .swf file, it stoped playback and displayed a frame that said "Sorry, this animation was made to be viewed on newgrounds.com. You can find it there anytime!". I was mad at the time, but now it gave me an idea...

有什么方法可以让动画检查当前位置/目录吗?文件正在播放,因此,如果发现它是从物理计算机而不是要从其播放的服务器正在播放,它将完全停止播放?

Is there some way I can get the animation to check the current location/directory of the file being played, so that if it finds out it's being played from a physical computer instead of the server it was meant to be played from, it stops playback completely???

推荐答案

此功能称为站点锁定。您可以在Google中搜索该词以获取更多信息。这是指向AS3游戏博客 Emenuelle Ferronato的链接,其中包含有关如何对文件进行站点锁定的教程。

This functionality is called "Site locking". You can google that term for more information. Here is a link to the AS3 Games Blog "Emenuelle Ferronato" with a tutorial on how to sitelock a file.

http://www.emanueleferonato.com/2008/03/10/how-to-sitelock- a-flash-movie /

该博客提供了AS2中的代码,因此我在下面使用AS3更新了该代码。此代码需要访问该阶段,并且需要在执行锁定检查的那一点上调用 sitelock(urls_allowed)。

The blog gives the code in AS2, so I updated it below using AS3. This code needs to have access to the stage, and you need to call "sitelock(urls_allowed)" at the point the lock check should be perforemed.

urls_allowed = ["www.emanueleferonato.com", "www.triqui.com"];
sitelock(urls_allowed);
function sitelock(urls_allowed) {
    lock = true;
    domain_parts = stage.loaderInfo.url.split("://");
    real_domain = domain_parts[1].split("/");
    domain.text = real_domain[0];
    for (x in urls_allowed) {
        if (urls_allowed[x] == real_domain[0]) {
            lock = false;
        }
    }
    if (lock) {
        stage.alpha = 0;// make sure this function has access to the stage.
    }
}

这篇关于Flash电影和ActionScript-停止视频脱机工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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