Advanced Prehack: Flash
-migrated-
Advanced Prehack: Flash Posted on: 07/17/2009 4:36pm
Quote Post
I will be using three SWFs in this tutorial. It makes it a bit more complicated, but it works, and that's all that really matters.

Step 1: Loader

1. Create a new ActionScript 2 document


2. Enter this in the first frame:
Code: [Select]
loadMovie("fold.swf", this);
loadMovieNum("foldhacks.swf", 200);

Save it as 'fold loader.fla' and export it as an SWF.


Step 2: Download the game

SWF: http://chat.kongregate.com/gamez/0000/3 ... e/fold.swf
Tutorial: viewtopic.php?f=18&t=660


Step 3: GUI

1. Create a new ActionScript 2 document


2. Make a hack menu


3. Convert it to a symbol (movie clip)


4. Change its instance name to 'innerHackMenu'


5. Make a button and convert it to a symbol (graphic)


6. Make a text box (static), write 'Lives' and move it onto the button


7. Convert them to a symbol (button) and change its instance name to 'livesHackBtn'


8. Drag it onto the hack menu and make a new text box (input)
(broken image removed)

9. Change the text box' instance name to 'livesHack_txt'


10. Make a drag bar or w/e it's called, convert it to a symbol (movie clip) and change its instance name to 'dragBar'


11. Convert everything to a symbol (movie clip) and change its instance name to 'hackMenu'


12. Make a text box (dynamic), write 'hide hacks', convert it to a symbol (movie clip) and change its instance name to 'showHide'
(broken image removed)

13. Double click it, right click the timeline and insert a new keyframe


14. Change the text to 'show hacks'


15. Add the ActionScript below and save it as 'foldhacks.fla' and export it as an SWF


Step 4: ActionScript

Main timeline, frame 1

1. dragBar
Code: [Select]
hackMenu.dragBar.onPress = function(){
startDrag(hackMenu);
}
hackMenu.dragBar.onRelease = function(){
stopDrag();
}

2. livesHackBtn
Code: [Select]
hackMenu.livesHackBtn.onRelease = function(){
_level0.lives = hackMenu.livesHack_txt.text;
}

3a. showHide
Code: [Select]
showHide.onRelease = function(){
if(showHide._currentframe == 1){
hackMenu._visible = false;
}else{
hackMenu._visible = true;
}
showHide.play();
}

showHide, frame 1 and 2

3b. showHide
Code: [Select]
stop();

Step 5: Misc.

1. Change frame rate to 36 fps


2. Move all three SWFs to the same folder and open 'fold loader.swf'


Re: Advanced Prehack: Flash Posted on: 12/20/2010 2:38pm
Quote Post
Outdated with as3 but, hey! Still a good tut!
Re: Advanced Prehack: Flash Posted on: 12/20/2010 8:12pm
Quote Post
Quote from: "hitandrun160"
Outdated with as3 but, hey! Still a good tut!
Not entirely outdated. There is a way to get around the security sandbox IIRC.
Re: Advanced Prehack: Flash Posted on: 12/20/2010 9:23pm
Quote Post
Holy thread necromancy, Batman!
Re: Advanced Prehack: Flash Posted on: 12/21/2010 8:45am
Quote Post
Quote from: "KongregateHack"
Quote from: "hitandrun160"
Outdated with as3 but, hey! Still a good tut!
Not entirely outdated. There is a way to get around the security sandbox IIRC.
Yeah, you can still use
Code: [Select]
var myLoader:Loader;
var swfUrl:URLRequest;
var game:Object;

public function mainFunction()
{
myLoader = new Loader();
addChild(myLoader);
swfUrl = new URLRequest("anything.swf");
myLoader.load(req);

myLoader.contentLoaderInfo.addEventListener(Event.INIT, finishedLoading);
}
function finishedLoading(event:Event):void
{
game = loader.content;
//anything you want to do here
}

Quote from: "zhaoli"
Holy thread necromancy, Batman!
At least someone might learn though.