At 3/5/24 10:21 AM, scottwjsm wrote:so as i am learning to code using Action Script 2, i am finding that on both my pc and on the browser there are some lines of code that will not function for me. On major example is that && statements will work, but not || or statements.
I was wondering if this is not working with everyone, and if this should be a reason to make a game with AS3 instead?
It's been a while since I used those operators in AS2 so I can't say, but I think it worked for me. I think what didn't work for me was ||=, though.
There's many more reasons to switch to AS3, but in terms of convenience functions, not having the following really made it a lot more tedious to work with AS2 (not an exhaustive list, just the ones I could think off the top of my head):
Array.forEach
Array.map
Array.some
Vector.<X>
Array.indexOf
The last one is particularly egregious. IndexOf! Fucking indexOf is missing! You have to implement your own convenience methods for finding an item in an array!
But besides that, the AS3 event system is much, much easier to work with than AS2's. Even though they're similar in many respects, the structure of the AS3 event system is much cleaner, and so you can organize your code to make it easier to read. As opposed to the AS2 method which requires a lot more discipline to get working correctly.