You may not be able to โdisable insertionโ per se (without any placement of the Flash control yourself, say, in a Windows application or in any browser extension), but you can certainly make a pretty good guess about how someone is using a timer-based math application. Here's a (super) example Flex application 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 this number exceeds a certain threshold, the timer stops and the form turns off.
Of course, this is not ironclad, and if I implemented it myself, I would add some additional measures oriented to the time frame (for example, stop 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 might be good enough for you.
Update: a couple of people mentioned Event.PASTE, which will work, but does not exist in ActionScript 2 / Flash Player 9. If you were able to provide Flash Player 10 and could script in ActionScript 3, this would be a different option.
source share