Actionscript is cool for developers. Not for me.
I love the creative process, I love experimenting, I love discovering new things and doing all kinds of stuff with it. I like to create toys that tell me something about myself. Having said that: I am a passionate Interactive Experience Designer. It’s a title I like because it tells you everything about me in 3 words.
- Interactive: I want the user to be able to control what is happening. The user should always be part of the application. The user should actively be engaging with the application. Whatever happens should happen either because of the user or for the user to get an even better experience.
- Experience: I don’t want them to just click a few buttons. I want my users to like the application. I want them to like it so much, that they start missing it once they’ve closed the browser window.
- Designer: Although most of you know me as a developer, I want to make a point here: I don’t develop. I create.
I write code in order to create a visual masterpiece, either in interaction or experience; not in code; not in application architecture; none of those non-Ronny words.
That last point is really the reason of why I’m writing this. Having said the above, it should be clear Actionscript has enabled me to create cool stuff. Actionscript has enabled me to create whatever I could think off. But now at this point, I’m eager to go beyond my current limits, and I want to go there fast!
Only a few minutes ago, I was thinking about how I’d start creating this new (experimental) application. And before I even got to actually start building the whole thing, I lost motivation. It is SO MUCH WORK to only setup the application without the actual features I wanted to build in the first place. How am I supposed to have fun?!
I came to realize how much I miss the AS2 coding style where you just created. You would just have pointed at a movieclip, and run a loadMovie(). It doesn’t get any quicker than that.
Even worse: I missed the loosely typed, old fashioned JavaScript style of getting straight down to business. My guess is: You don’t understand what I’m trying to say here. Let’s show you a simple example: Load an image and add it to a sprite on the stage.
import flash.events.IOErrorEvent; import flash.events.Event; import flash.display.Loader; import flash.display.Bitmap; import flash.net.URLRequest; var url:URLRequest = new URLRequest("myPicture.jpg") var loader:Loader = new Loader() addListeners(); loader.load(url); private function addListeners():void { loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeEvent) loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); } private function removeListeners():void { loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, completeEvent) loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); } private function completeEvent(event:Event):void { removeListeners(); var bm:Bitmap = Bitmap(e.target.content); someSprite.addChild(bm); } private function ioErrorHandler(event:IOErrorEvent):void { removeListeners(); trace("Ay, yo' pic is gone, mate!"); }
This looks pretty straight forward, right? Create a loader, add the eventlisteners for completion and error, handle them, and remove the listeners. This is as straight forward as it gets.
Well even though this is as basic as it get’s: It’s too much! This should be easier! Shorter! Hell: it should be more fun!
If loading this image is your application, then this is not that much of a problem. If loading 3 images is only a small (and almost not important) part of your test-application, then all of this code is way too much effort to focus on what you actually wanted to do: Test something completely different!
You might think I’m exaggerating here, but I’m not. When I think of a cool little experiment, I don’t want to spend all day starting to create it, only to end with 10 minutes of writing the actual test code. I don’t want to write 300 lines of code in order to just test something that consists of 10 lines.
I’m not asking Adobe to make AS4 shorter-handed, I’m not calling anybody out to create a framework that enables me to have fun, I’m not asking anybody something. I’m just getting tired of having to write bullshit JAVA-assed best practice code in tiny-experimental-proof-of-concept-test-applications.
I don’t feel like I’m using ActionScript anymore… I feel like I’m subjecting myself to it. I’m not in control. Actionscript is. If I don’t agree with that close minded language, it’s not going to cooperate in any way… I have to talk to it very genly, and choose my words wisely… What the f###? It’s a computer! Now bend over and do as your told!
When writing test-applications (which is basically what I do 90% of the time), I want to get the job done. I don’t want the code to look good. In fact, when creating this test builds that are a kick in the teeth for every best practice rule in the universe, I couldn’t be bothered in a lifetime about coding conventions… I just want my freaking app to start working!























Whoa, what a post. But.. I get your point. Writing 500 lines of code for a simple application is nothing these days. I think it is always challenging, I don’t mind writing lots of code. I hate weak-typed languages. Yes, most of times they are shorter, but for me that feels more crap. Yes, loading stuff in AS3 costs a lot of lines, it can be an be written much shorter.
You don’t always have to code perfectly. In case you didn’t know; you can use dynamic classes in AS3. Just use the MovieClip again (instead of a Sprite), and you can add variables without even declaring them in custom classes. You can turn off strict typing om AS3 too.
To have the full actionscript experience, you really need (!) a good code editor with auto-import functionality, code completion, snippets, contextual function generation etc. This will make your life much easier. Just take the time to learn shortcuts, i am sure your example can be coded in 2 minutes with a good editor. Just ‘hack’ to your problem (problem is having lots of code) .. learn to re-use and create reusable classes. In case of your example, I’ve created a simple image class. Just use
var image:Image =new Image(“myPicture.jpg”); addChild(image);
and you are done. It is in a lot cases not needed to listen to IOErrorEvent, in most cases you just know the images are there. Otherwise; just make sure the images are there.
BTW thanks for the BB award
I think you should use the 4th word “passionate” in your description too!!
It’s important!
And i get what you mean with the as2 -> as3 story.
In as2 i could do loads off stuff, and not event that slow (i’m a designer, not a developer!) But in as3… pfff… just a simple getURL is a hassle!