I have to admit, it’s pretty cool.
December 2003. Everyone’s screaming about PrimalScript. I liked SciteFlash at the time, but figured I’d give Primal a shot for a week. I never looked back. Until now. Everyone’s screaming about FAMES, FAMES, FLAMES. Then Macromedia announces partnership with Eclipse. Hmmmm… maybe there’s something to this.
OK, OK. Downloaded Eclpse, ASDT, Flashout. I already have the M and S. Took a bit to get it all set up, but damn. Syntax checking as you type. Hard to find an argument against that. The code completion works better than I understood it to. Still some minor differences from PrimalScript here and there, but nothing I couldn’t adjust to.
Read more...I’ve been jumping back into MTASC recently, and tried turning on the -strict option. Started giving me errors for all functions I had declared like this:
function foo(Void):Void
{
}
Telling me that I have an untyped parameter. I had seen something about using Void as a parameter in the comments of this post. To quote: “avoid using Void as parameter to methods. In AS2 it creates no value. The compiler simply creates an untyped parameter named Void.”
Read more...Or maybe “singleton is the new _root.”
Ha. Just something someone threw out there jokingly in Toronto at FiTC. Keeps coming back and making me laugh whenever I think of making anything a singleton.
Of course, a singleton can be used for good or for evil. [Insert something about great power and responsibility here…]
Funny how we can always find out new, complicated, highly elegant techniques to write the same old crappy code.
Read more...Seems my timing was pretty good. I went on a unit testing kick, and I get a brand new version of AsUnit!
Version 2.6 includes the following:
Look Ma! I’m famous.
Read more...It seems like forever since I’ve updated the experiments at BIT-101. But things have changed recently for me in terms of working conditions and schedules and so forth, so I have a little more time on my hands now. I’m going to try to get back into the swing of things.
Read more...I wanted to mention a very useful feature in AsUnit that you may not have completely been aware of, even though it’s sitting right there. Right on the front of the AsUnit panel is a little checkbox which says “Show Sys.println”. I’ve seen it there every time I’ve used it, and figured it was some internal thing that I didn’t need to worry about while I was busy figuring out how to compare to non-Comparables. There’s also some mention of Sys.println somewhere in the docs or site.
Read more...Hot off the presses. I was all over MTASC 1.04, but 1.05 changed so many things that none of my projects would compile any more so I shelved it for a while. I have to hand it to Nicolas Cannasse. He is very in touch with the users of MTASC and regularly puts out releases that address hot issues. Go get MTASC 1.06.
Read more...OK, you install AsUnit, you follow the Quickstart Directions, and you grab Test Driven Development: By Example or some other book or online reference and start converting Java to AS2.
The first thing that’s going to stick in your craw is when you try to use assertEquals(). You’re going to get an error about using the incorrect type or something along those lines. This is because in AsUnit, assertEquals requires two arguments that are Comparable. Note the capital C. Comparable is an interface: com.asunit.utils.Comparable. (You can find all the AsUnit classes in the Classes directory of your Flash Configuration directory.) Comparable specifies two methods: equals() and toString(). I really don’t like the way that assertEquals is implemented. First of all it forces a tight coupling between your testing environment and your project code. If you make a class that you might want to test a member of for equality, you have to make it implement com.asunit.utils.Comparable. Furthermore, you can’t use it to test primitive values at all. So it’s impossible to do something like:
Read more...For the last year and a half, I’ve been concentrating on learning, implementing and improving my development processes and practices. Learning as much as I can about patterns, object oriented design, UML, refactoring, on and on. The one subject I kept procrastinating on was unit testing. Test driven development is such a completely different way of programming, and I was always in the middle of so many things with so many deadlines, there was never the opportunity to just drop everything and implement a whole new methodology in development.
Read more...I do a lot of work with on-line apps that are customized at run time through Flash Vars. So I’ve devised a lot of different ways to fake them while testing in the IDE. At the end of the day, a Flash Var is simply a variable defined on _root.
Thus, the simplest way to simulate them is to create a variable on the main time line:
user_id = 1;
The problem is that I often have a bunch of these and when it comes time to deliver the final swf, these variables will overwrite the actual Flash Vars coming in. So they have to be commented out, or otherwise disabled. One thing I was doing for a while is this:
Read more...