Sometimes something very simple takes hours of your time just to figure out what’s going wrong.
I was doing a XML parsing and I was trying to save a part of information in a multi-dimensional Associative Array.
And the problem was so easy that I would never ever guess something has been changed in AS 3.0 , till I stuck in the middle and spend hours to figure out what’s the problem.
A very simplified version of the issue is like this :
var my_arr:Array=new Array();
my_arr['test'] = 'xxx';
trace(my_arr.length); // returns 0
So as you can see, none of the properties and methods of Array won’t work for associative arrays. [refering to Adobe’s help].
Again referring to the same Help document you should use object Class whenever you need something like an Associative Array.
Hope it will help someone out.
It has been a long time since I did my last projects in Flash / ActionScrip2.0 [cityofcaspian] & [Toboggan]. And since ActionScript 3.0 came out I hadn’t a chance to go and figure my own way out around it. You know most of the times a good chance would be a real project.
I have been busy mostly with PHP and CodeIgniter for the last 1 year and half. I’ll talk more about them later. But as I was taking the “Advanced Programming Practices” course at school, the professor told us that the project is a simulation of the RISK game and students are allowed to do it in whatever programming language they prefer, having in mind they need to provide certian artifacts to the professor and should improve their programming skills.
While he was telling us about the project requirements, I was totally sure that it could be done perfectly in Flash. But finding team mates with the same interests in a Masters program which everybody is just blindly fascinated to Java, was so hard. But eventually it was such a great pleasure for me to find some other people who had experiences in Flash before and wanted to do it in Flash/ActionScript.
None of us had any experience in AS3.0, but I suggested as we are going to use ASdoc and ASunit, it’s better to do it in ActionScript3.0 and that would be a great chance for us to learn the new language.
Wow! It’s an amazing language, and it’s far from the old ActionScript2.0 which was simple but having lots of its own problems. Thinking in AS2.0 way but trying to implement it in AS3.0 application just not gonna work out… tons of “compiler errors”! I’m pretty sure if we didn’t know anything about AS2.0 we would have found our ways much faster.
We are finding our ways around after a while, but having the very strict time restriction has left us behind the schedule and what we expected from ourselves.
This ActionScript2.0 VS ActionScript3.0 document helped us alot.