00:00
00:00
Newgrounds Background Image Theme

NisoXD 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!

AS2 Reference, Tips & Tricks

372 Views | 7 Replies
New Topic Respond to this Topic

A lot of people participating in the Flash Jam might be having trouble returning to AS2 from AS3, given the relative lack of documentation (and forgetting a lot of the AS1/2 pitfalls over time). As such, I think it'd be useful to list any tips and tricks you might've thought of while programming in AS2.


AS1 is also accepted because I imagine not too many people would've programmed in "proper" AS2, and instead resort to a hodgepodge of code on movieclips and timelines alike.


The AS2 Language Reference is available here. It's got examples of each function listed therein, which is a good place to start if you're having trouble recollecting what a function's supposed to do.


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

Response to AS2 Reference, Tips & Tricks 2021-01-13 19:45:09


Here's a more or less complete tutorial on AS2 and Flash, courtesy @Denvish et al.


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

Response to AS2 Reference, Tips & Tricks 2021-01-15 10:21:09


At 1/13/21 07:45 PM, Gimmick wrote: Here's a more or less complete tutorial on AS2 and Flash, courtesy @Denvish et al.


Very nice, the amount of tutorials that I have found via google that just redirect to dead pages is saddening.


BBS Signature

Response to AS2 Reference, Tips & Tricks 2021-01-15 11:12:16


I decided to check out "Bad ideas" out of curiosity... @Fire includes instructions for how to make a forkbomb in Flash, lol.


At 12/5/05 04:00 PM, Fire wrote: 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.


Although it's pointless (since even before the Flash shutdown you needed to manually run SWF files in browser) this could still be improved upon. First, call getURL twice to get that sweet, sweet exponential growth. Then make it work for any website. I seem to remember @XGen putting anti-piracy measures on their games (such as Stick RPG) by detecting the current URL. So if you used a call to that function rather than a string, the forkbomb would work regardless of where it was hosted.


Why am I even suggesting this...


If I offer to help you in a post, PM me to get it. I often forget to revisit threads.

Want 180+ free PSP games? Try these links! - Flash - Homebrew (OFW)

Response to AS2 Reference, Tips & Tricks 2021-01-25 04:43:21


Don't forget about the old As Main thread:


https://www.newgrounds.com/bbs/topic/229808/49


Scroll down a little and there is tons of code examples.

Response to AS2 Reference, Tips & Tricks 2021-01-30 00:16:27


At 1/25/21 04:43 AM, D-SuN wrote: Don't forget about the old As Main thread:

https://www.newgrounds.com/bbs/topic/229808/49

Scroll down a little and there is tons of code examples.


Also here's a link ot AS2 Template for Flash Develop. Gives you code competion in Flash Developer for AS2.

https://raw.github.com/fdorg/flashdevelop/development/External/Extensions/AS2Templates/AS2Templates-1.01.fdz

Response to AS2 Reference, Tips & Tricks 2021-02-17 11:42:24


Here's an AS2 to AS3 Migration list, that could help (ironically) those migrating their code from AS3 to AS2.


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

Response to AS2 Reference, Tips & Tricks 2021-02-20 01:15:27


At 1/30/21 12:16 AM, D-SuN wrote:
At 1/25/21 04:43 AM, D-SuN wrote: Don't forget about the old As Main thread:

https://www.newgrounds.com/bbs/topic/229808/49

Scroll down a little and there is tons of code examples.
Also here's a link ot AS2 Template for Flash Develop. Gives you code competion in Flash Developer for AS2.
https://raw.github.com/fdorg/flashdevelop/development/External/Extensions/AS2Templates/AS2Templates-1.01.fdz


I tried this out and it seemed to work fine but my AutoComplete disappeared, and FD began ignoring my classes in the project path. Funnily enough, the default AS3 project file seems to handle this fine as long as you set the syntax in the menu to AS2. In short, this may not be the project to select if you're going to make a "Flash IDE project".


But it absolutely is recommended, even required for the other types of projects (i.e. pure AS2), where compilation in FlashDevelop is key.


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature