你如何阻止复制/粘贴在一瞬间形式在一、瞬间、形式

2023-09-08 11:59:52 作者:街角的风铃

我的医疗转录公司工作,我们的管理,我们对我们的申请医疗转录测试是一个旧版本的Flash形式的应用程序,停止复制,并通过清空剪贴板,当你进入的形式粘贴。这在IE 7伟大的工作,但最近它已经到了我的注意,它并没有工作在Firefox这么好。也许这是Flash的版本,因为闪光灯应该是独立于浏览器。我绝不是一个Flash开发人员,其实我是挺可怕的吧。因此,我需要知道的是如何停止复制和使用动作脚本粘贴。

I work for a medical transcription company and our medical transcription test we administer to our applicants is an older flash forms app that stops copy and paste by emptying the clipboard when you enter the form. This worked great in IE 7, but recently it has come to my attention that it does not work so well in Firefox. Or perhaps it is the version of flash, since flash should be browser independent. I'm not by any means a flash developer, in fact I'm quite terrible at it. So what I need to know is how to stop the copy and paste using action script.

根据显然是一些额外的信息是必要的注释。什么是测试实际执行它起着一个声音文件(基本MP3),他们必须抄写的收听。复制和粘贴问题是当他们的打字员好友已经采取的测试,只是电子邮件给他们的朋友,使他们可以跳过入。

Based on the comments apparently some additional information is necessary. What the test actually does it plays a voice file (Basic MP3) that they have to transcribe as the listen to it. The copy and paste problem comes in when their transcriptionist buddy has already taken the test and just emails it to their friend so they can skip over it.

推荐答案

您可能无法为禁止贴这样(没有承载Flash控件不知何故自己,可以说,在一个Windows应用程序,或在浏览器扩展)的某种形式,但你一定可以做出关于某人的使用少许基于定时器的数学应用程序的方式pretty的很好的猜测。这里有一个(超)粗糙的Flex应用程序说明我的意思例如:

You might not be able to "disable paste" as such (without hosting the Flash control somehow yourself, say, in a Windows app, or in a browser extension of some sort), but you can certainly make a pretty good guess about the way someone's using the app with a little timer-based math. Here's a (super-)rough example of a Flex app illustrating what I mean:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*" creationComplete="this_creationComplete(event)">

    <mx:Script>
    	<![CDATA[

    		private var timer:Timer;
    		import flash.events.Event;

    		private function this_creationComplete(event:Event):void
    		{
    			timer = new Timer(1000);
    			timer.addEventListener(TimerEvent.TIMER, timer_tick);
    			timer.start();
    		}

    		private function timer_tick(event:TimerEvent):void	
    		{
    			var elapsedTimeInMinutes:Number = timer.currentCount / 60;
    			var averageWordLength:Number = 4;
    			var humanlyPossible:Number = 200;

    			var thisPersonsSpeed:Number = (txtTest.text.length / averageWordLength) / elapsedTimeInMinutes;

    			if (thisPersonsSpeed > humanlyPossible)
    			{
    				txtSpeed.text = "Wait, " + Math.floor(thisPersonsSpeed).toString() +  " words per minute?  This clown is probably cheating.";
    				txtTest.enabled = false;
    				timer.stop();
    			}
    			else
    			{
    				txtSpeed.text = "Currently typing " + Math.floor(thisPersonsSpeed).toString() + " wpm.  Hurry up!  Faster!";
    			}
    		}

    	]]>
    </mx:Script>	

    <mx:VBox>
    	<mx:TextArea id="txtTest" width="600" height="300" />
    	<mx:Text id="txtSpeed" />
    </mx:VBox>

</mx:Application>

从本质上讲,它只是每分钟计算的话定时器;如果该数量超过某一阈值,则定时器停止,并且该形式禁用

Essentially, it's just a timer that calculates words per minute; if that number exceeds a certain threshold, the timer stops, and the form disables.

当然,这不是铁一般的,如果我是执行它自己,我想层中的一些额外的时序为导向的保障措施(例如,停止计时活动等时段后),但它应该说明点。我敢肯定还有其他的解决方案,但简单的东西这样就可以进行得很顺利,够你。

Sure, it's not iron-clad, and if I were implementing it myself, I'd layer in some additional timing-oriented safeguards (e.g., stopping the timer after periods of inactivity, etc.), but it should illustrate the point. I'm sure there are other solutions, but something simple like this may work out well-enough for you.

更新:一对夫妇的乡亲都提到Event.PASTE,这将工作,但在ActionScript不存在2 / Flash播放器9。只要你能够确保Flash Player 10和脚本可以在ActionScript 3,即' d是另一种选择。

Update: A couple of folks have mentioned Event.PASTE, which would work, but doesn't exist in ActionScript 2 / Flash Player 9. Provided you were able to ensure Flash Player 10 and could script in ActionScript 3, that'd be another option.