Disclaimer: I am providing this info for educational purposes ONLY. I am not encouraging malicious or buggy flash content designed by info provided in this thread. Me, and the repliers to this thread, are not responsible for you messing up your computer and losing data.
Okay, now that that's out of the way, lets get to the tutorial.
These are some things you shouldn't do when using Actionscript, the effects range from freezing your computer to buggy games.
1:Deprecated AS
Deprecated Actionscript can be used, but will probably become obsolete (Not used by future versions of Flash) in a few years. These are a few deprecated actions in Flash MX.
A:tellTarget
used like:
tellTarget (_root) {
gotoAndPlay(161);
}
use _root.gotoAndPlay(161); instead.
B:toggleHighQuality
used like:
on(press) {
toggleHighQulaity();
}
I dont know the replacement, but it has something to do with the _quality global.
C:Logical operators
this:
//ALL "and" and "or" operators are deprecated in MX.
if(fire == true and water == false or onFire == true and u_r_fucked == true) {
gotoAndPlay("death") //Just had to do that.
}
would become this:
if(fire == true && water == false || onFire == true && u_r_fucked == false) {
gotoAndPlay("death") //Much faster "death". Okay I'll stop
}
There are tons more, but these are major ones. To see them all click the plus sign above the Actions window and select "Deprecated".
2:Loop abuse
Loops can freeze someones computer, and are used in websites such as Last Measure (Actuatlly I think it uses some other script, but the same effect can be created using Actionscript)
A:Trace
Sample code:
anarchy = true
while(anarchy = true) {
trace("I am fucking up your computer. Give me $1,000,000");
}
The following will really lock a computer up:
//create a dynamic text box named "owned"
for(i=0;i=infinity;i++) {
owned.text = i
trace(i);
}
Remember my disclaimer, mods.
3:Stupid math
Really the only things that fit in here are:
1.Using deprecated math operators
2. Dividing by 0
If you divide by 0, you will mess up your game.
3. Abusing bitwise
like:
on(release){
Score = 2 << 10000000000
}
Just don't do it, it can slow really old computers down to turtle pace.
4:Everything else
A:getURL abuse
Linking to the flash itself:
//Frame 1
getURL('www.example.com/flash/idiot.swf',b
lank /* I know it isnt right */);
The flash will open itself forever, causing the user to restart his/her browser.
B:Volume
The following will turn it up to max:
myHeavyMetalRock.setVolume(100):Void //Used with a sound object
Be sure to post your own bad ideas, and remember this is for educational purposes only.