00:00
00:00
Newgrounds Background Image Theme

Jmurr12 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 to AS3 issues

447 Views | 3 Replies
New Topic Respond to this Topic

AS2 to AS3 issues 2010-05-20 20:34:59


I'm making the effort to rid myself of ASS2. Oh I meant AS2. Damn type-o's. =p

Anyway, In AS2 to access any MC I usually just did:

_root["mc_" + id]

This was very useful for creating say 50 MCs with AS then assigning a script to them. Can this be done in AS3?

Response to AS2 to AS3 issues 2010-05-20 20:46:54


Use an array.


Indescriptive topic names have left me in despair!

Response to AS2 to AS3 issues 2010-05-20 20:50:56


Well you can get children by their name, so technically yeah you can do the same thing. But since your objective is to rid yourself of your bad as2 habits, why is your first instinct to find a similar bad habit in as3? :P


You can solve pretty much any problem you may have with AS3 by consulting the AS3 Language reference.

Response to AS2 to AS3 issues 2010-05-21 03:35:30


At 5/20/10 08:34 PM, SmartNoob wrote: _root["mc_" + id]

This was very useful for creating say 50 MCs with AS then assigning a script to them. Can this be done in AS3?

Even in AS2 you should have choosen an Array. Because you want to use this like an array, but it's a hash. It works, but it's not good.

There are vectors, too.