Home RSS

Archive for January, 2008

Using BulkLoader with FDT and Eliminating Parsing Errors

I have been using the open source BulkLoader AS3 classes since I read about it a few months back on the developer Arthur Debert's blog. When I first used the classes in FDT, the editor shows that the classes have errors in BulkLoader.as and LoadingItem.as. However, the project would still compile without issue so I just kept on coding, ignoring the little "x" as I finished the project. The issue is even marked as "WontFix" in the project's issue database on Google Code.

I am setting up a new project in which I intend to use BulkLoader once again -- and this time I'd prefer not to have FDT barking at me about code which I know compiles correctly, even in strict mode. So, I spent a few minutes and dug up how to fix the issues so that FDT quits complaining. Hopefully this saves someone else the time, and allows you to know your code is really error-free at a glance.

The issue has a proposed fix in the Google Code issue database, but *warning* you'll want to stay away from it, as the fix partially leads to more issues. The correct fix is actually found deep in FDT's forums, the gist of which is:

First, on lines 201-207 of LoadingItem.as remove all of the quotation marks and add a semi-colon at the end of the object definition. These lines should now read:

private static var classes : Object= {
loader: Loader,
xml: URLLoader,
sound: Sound,
text: URLLoader

Second, change line 958 of BulkLoader.as to:

var res : * = item.content as type;

Note that the line numbers are for revision 107 : and may change in future revisions.

My take on ActionScript 3.0: Is It Hard or Not?

O'Reilly's Inside RIA site is off to a great start with a new article by Colin Moock, author of Essential ActionScript 3.0. In the article Colin attempts to answer the question: ActionScript 3.0: Is It Hard or Not?

I highly suggest reading the lengthy article, the gist of which is:

The most common laments I hear about ActionScript 3.0 are, "It’s too complicated," "It’s harder to learn/understand," and "It takes a lot more code to do things." Yet, rarely have I seen these complaints backed up by more than one or two examples. So let’s do some thorough investigation to see if ActionScript 3.0 really is as hard as people seem to think it is.

Like the users Colin speaks of, I have also often felt that using AS3 can result in more code than using AS2. While in most cases the additional code results in a more structured and OOP-sound project, that structure is not always necessary. I also felt that it was more complicated than AS2 once I started using AS3, but I have never heard anyone deny that there is a ramp-up period, even for the most skilled developers.

As more and more developers make the switch and as more clients require their projects be developed in AS3, most of us developers will no longer have the choice. This is the main reason I chose to make a concerted effort to learn AS3 and start using it in projects -- I didn't want to get blindsided with an AS3 project and all of the sudden need to spend most of the project schedule learning AS3. It should also be noted that just about every developer who I speak to about AS3 says they haven't looked back since transitioning to AS3.

I think for designer-types the situation is a bit different, however. For instance, I have lost count of the number of times I have been asked the question, "Should I switch to AS3?" by designers who are used to coding on the timeline. These designers can make their way around a Flash file with AS2, alter code they find on the internet, and have a functional project. In these cases, yes, AS3 seems like it is "too complicated" and "harder to learn/understand". AS3 is now a fully OOP language and without the base knowledge of OOP, one would be lost quickly. While these concepts can be learned, each person needs to decide if they would benefit from doing so. The general Flash concepts from AS2 have not changed in AS3 -- gotoAndPlay() and the like are still available. Loops, conditionals, and timeline functions all still work pretty much the same, so your base of reference for AS3 isn't too far off.

My take? Start using AS3 immediately. As a developer-type you'll be forced to learn it eventually, and you might as well start getting cozy now. If you are more of a designer-type you can still code on the timeline using AS3 if you prefer to do so, and by following some simple timeline coding concepts you could take your code to external class files once you feel comfortable doing so.

However, the big issue here is not one of just developer-types vs designer-types. No, it is that group in the middle that was starting to grow significantly due to Flash: the "designveloper" - those who have a great sense of design and the development know-how to make their visions a reality. Samuel Agesilas and his Saffron AIR application is a great example of this - a complex application that looks beautiful. I have also seen several speakers at conferences last year actually call themselves something along these lines. This group is now starting to shrink rapidly because of the additional OOP knowledge that is required with AS3, the perceptions of AS3 being "too complicated" and "harder to learn/understand", or just plain unwillingness to take the time needed to learn the new language. This is not to say it cannot and will not start to grow again once the Flash community becomes more comfortable with AS3, but that may take some time to happen. In the meantime, I'm doing as much as I can to stay a "designveloper" because I enjoy both the design and development. But, even with that mindful effort I have seen myself leaning more and more to the development side as I continue to program in AS3...

Powered by WordPress.