Crash Flash in 4 lines of code (more fun than a barrel of monkeys)
Four lines of code are all you need to freeze Flash solid! :) This discovery is brought to you courtesy of a simple flaw in logic.
Warning: Don't try this in the IDE unless you want to restart it. At least publish it for your browser so you'll only have to restart that.
Symptoms: No script timeout message, 100% CPU.
Instructions: Make sure you have a dynamic textfield on stage with the descriptive instance name of "t" and add the following code on to the same frame.ActionScript:
t.autoSize = true; t.text = "I love a good crash!"; for (i = 0; i < 100; i++ ) { t.text += t.text; }
Comments
What you've done is ballooned the memory usage of Flash way up. I don't even think any word editing program can handle 25 quintillion characters.
Here's what you did and why you crashed the Player.
var t = 20; // num characters
for (var i = 0; i
by Jon on 2005-01-12 18:28:19
What you've done is ballooned the memory usage of Flash way up. I don't even think any word editing program can handle 25 quintillion characters.
Here's what you did and why you crashed the Player.
Resulting number of characters after your script (double the character count for 100 iterations, starting with 20 characters): 2.53530120045646e+31
Yea. That's just over 25 quintillion (in the british system, nonillion for the english system). You won't get a script error because the script actually only gets run 100 times (that's really minor). What you did is blow the memory out the window.
No wonder you busted it. Hehe.
by Jon on 2005-01-12 18:30:47
by Jon on 2005-01-12 18:32:26