00:00
00:00
Newgrounds Background Image Theme

ozziel94 just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

AS3: Crashing your flash app.

2,898 Views | 8 Replies
New Topic Respond to this Topic

AS3: Crashing your flash app. 2009-02-14 13:01:17


AS3: Crashing your flash app.

Aim

To crash your flash app.

Knowledge needed

Knowledge of basic for loops.

Method

Okay, In this tutorial I will teach you how to crash your flash app.
It's really simple and easy to pick up.
First we are going to make a for loop.

for (var i:int = 0; i=0; i=0){
}

What this code does is first set the variable i. Then it checks if i=0 and if it is it sets i=0 and checks i again and so forth. It loops infinitely causing your script to timeout resulting in your flash application to stop working.

This could have some practical use I suppose.
You could put it in a game where if you detect someone variable tampering then you could do this to end the script and to stop the tampering.
And that has been my tutorial crashing your flash app.


"To live is the rarest thing in the world. Most people exist, that is all."

- Oscar Wilde

BBS Signature

Response to AS3: Crashing your flash app. 2009-02-14 13:07:36


Umm... ok?


BBS Signature

Response to AS3: Crashing your flash app. 2009-02-14 13:10:52


I assume you're not kidding, in which case, oh my.

while(true){ //dosomething };

or just lag:

for(var a:int=0; a<30000; a++){
var mc:Shape = new Shape();
mc.graphics.beginFill(Math.random()*0xffffff, 10);
mc.graphics.drawCircle(Math.random()*Stage.height, Math.random()*Stage.width, 10, 10);
addChild(mc);
}

LOLS.

-.-


Sup, bitches :)

BBS Signature

Response to AS3: Crashing your flash app. 2009-02-14 13:13:59


At 2/14/09 01:10 PM, liaaaam wrote: I assume you're not kidding, in which case, oh my.

while(true){ //dosomething };

or just lag:

for(var a:int=0; a<30000; a++){
var mc:Shape = new Shape();
mc.graphics.beginFill(Math.random()*0xff ffff, 10);
mc.graphics.drawCircle(Math.random()*Sta ge.height, Math.random()*Stage.width, 10, 10);
addChild(mc);
}

LOLS.

-.-

Or, on first frame

gotoAndPlay(2);

, on second frame

gotoAndPlay(1);

.


"To live is the rarest thing in the world. Most people exist, that is all."

- Oscar Wilde

BBS Signature

Response to AS3: Crashing your flash app. 2009-02-14 13:22:01


At 2/14/09 01:13 PM, Deadclever23 wrote: Or, on first frame
gotoAndPlay(2);
, on second frame
gotoAndPlay(1);

That isn't going to do anything, except literally loop the first and second frame.


Sup, bitches :)

BBS Signature

Response to AS3: Crashing your flash app. 2009-02-14 13:23:10


At 2/14/09 01:22 PM, liaaaam wrote:
At 2/14/09 01:13 PM, Deadclever23 wrote: Or, on first frame
gotoAndPlay(2);
, on second frame
gotoAndPlay(1);
That isn't going to do anything, except literally loop the first and second frame.

Try it.


"To live is the rarest thing in the world. Most people exist, that is all."

- Oscar Wilde

BBS Signature

Response to AS3: Crashing your flash app. 2009-02-14 13:45:22


At 2/14/09 01:22 PM, liaaaam wrote:
At 2/14/09 01:13 PM, Deadclever23 wrote: Or, on first frame
gotoAndPlay(2);
, on second frame
gotoAndPlay(1);
That isn't going to do anything, except literally loop the first and second frame.

The reason flash times out from this is because when flash changes frames it runs the code on the frame first then displays the frame.
So when on frame 1 the code sends it straight to frame 2 before frame 1 can be displayed and when on frame 2 it is sent to frame 1 before it can display. Thus causing an infinite loop with no frames being able to display.


"To live is the rarest thing in the world. Most people exist, that is all."

- Oscar Wilde

BBS Signature

Response to AS3: Crashing your flash app. 2009-02-15 15:28:41


Here's something interesting.
You can actually almost disable script timeout and crash either flash or browser.
The following is a bug in Flash CS3.

First go on to publish settings then set the script timeout to something like 9999999999999999.
Then press ok and flash will warn you that the number is invalid. Press ok and then publish settings will exit anyway then if you go on again the number should've set itself to -1.
Then press ok and carry on and make your infinite loop then view your flash.
The result will crash flash because your script cannot timeout.

Picture attached below.

AS3: Crashing your flash app.


"To live is the rarest thing in the world. Most people exist, that is all."

- Oscar Wilde

BBS Signature

Response to AS3: Crashing your flash app. 2009-02-15 16:24:14


This thread is pointless.


#include <stdio.h>

char*p="#include <stdio.h>%cchar*p=%c%s%c;%cmain() {printf(p,10,34,p,34,10);}";

main() {printf(p,10,34,p,34,10);}

BBS Signature