Current News:

8/3/2014: Finally got around to fixing the link to my SA:D Trainer. Link: http://www.mediafire.com/download/s3oxgc72ic4rys6/SAD_Hack.zip

5/3/2013: Posted a video on the development of the SAD hack. Watch it below. Enjoy it. Things on premium will be posted soon.

4/28/2013: Started developing a new SAD hack. Final one. Details in post called "Updates!! :D". Also, I started a new code pasting service. It's at http://pasteitz.comze.com/ . I programmed the website myself.

Thursday, October 10, 2013

AS3 Autotyping Code

So I won't be uploading hacks anymore; at least not for Stick Arena. I decided to post code snippets on the blog instead. So, here is an autotyper I made in ActionScript 3. The .fla using it and the .as using it will be uploaded soon.

AutoType.as:

package Other{
import fl.controls.TextArea;
import flash.utils.Timer;
import flash.events.TimerEvent;
public class AutoType{
private var typeSpeed=5;
private var msgArray:Array;
private var tArea:TextArea;
private var sTimer:Timer;
private var i=0;
public function AutoType(){
trace("AutoTyper has been loaded.");
}
public function sendMsg(Msg:String,textArea:TextArea):void{
tArea=textArea;
msgArray=Msg.split("");
sTimer=new Timer(typeSpeed*10, 1);
sTimer.addEventListener(TimerEvent.TIMER, sendTMSG);
sTimer.start();
}
public function setTextArea(textArea:TextArea):void{
tArea=textArea;
}
public function changeSpeed(speed:Number):void{
if(speed>10){
sendMsg("Error: You may only choose a speed between 1 and 10.", tArea);
}else if(speed<1){
sendMsg("Error: You may only choose a speed between 1 and 10.", tArea);
}else{
sendMsg("Information: Speed was just changed from "+typeSpeed+" to "+speed+".", tArea);
typeSpeed=speed;
}
}
private function sendTMSG(e:TimerEvent):void{
if(i!=msgArray.length){
tArea.verticalScrollPosition=tArea.maxVerticalScrollPosition;
tArea.text+=msgArray[i];
i++;
continueProcess();
}else{
tArea.verticalScrollPosition=tArea.maxVerticalScrollPosition;
if(msgArray[i-1]!="."){
tArea.text+=".";
}
tArea.text+="\n";
i=0;
}
}
private function continueProcess():void{
sTimer.reset();
sTimer.start();
}
}
}
view raw s hosted with ❤ by GitHub
I will upload this too when I'm at home. Just put that in a file called AutoType.as and then put that into the folder.

Here's the files in the EXACT order it should be in:
http://www.mediafire.com/folder/dnopd8g2tbx8d/AutoTyper Here it is: http://pasteitz.comze.com/Flash%20projects/AutoTyper.swf Get Adobe Flash player

No comments:

Post a Comment