IDIA 619 Lab 5

Hooray! This took forever to do. Mostly, since OO programming is new to me… and so is Flash CS3 and ActionScript 3. I used a great Tweener class from the Google code repository. The elements of this assignment were actually very simple. Things like moving an object, altering properties in response to various events, manipulating sound, etc. The challenging things had more to do with designing object-oriented code.

pulsers

Final Project Game Design

I’m constructing a cadaver dog game! Of course!

Here is my final project game design. The algorithm is very ugly. Just a set of heuristics that won’t scale at all. But you have to start somewhere! I’ll comment more as I go… but there are still two assignments to hand in!

IDIA 619 Lab 4

Lab 4 is a game design. But it’s actually just a practice game design based on a game at: Orisinal.com

I chose a game called Midnight Serenade.

Midnight Serenade

In any case, I constructed a MindMap game design and posted it here. This is a simple game and simple game design. But this technique of using a MindMap to design a game is useful no matter how complex the game.

Rapid turnaround is vital

Here’s a great 36-minute presentation by Sean Kelly on designing better web apps.

He compares a variety of web frameworks:

  • J2EE
  • Ruby on Rails
  • Zope
  • Django
  • JBoss

One of his main points is that rapid turnaround is the key to a successful User Interface. He says that 3/4 of time and effort is spent on dealing with changes the user wants. So move this button there, tweak this color here… Only 1/4 of time and effort is in planning. (Not sure where these stats come from, but it’s a reasonable enough WAG). As a result, older UIs built with compiled languages just suck (his word, but I share the sentiment). It takes too much effort to make changes. Today using scripting languages, we get rapid turnaround in UI development. We now focus less on widgets and more on layout. And developers work with designers to this end. So Sean asks the question of what frameworks are good for this purpose.

Well, I won’t spoil his story too much. Basically, the web frameworks that use scripting languages (and the ones above use Python and Ruby) are all comparable and tremendously better than things like J2EE and JBoss. Though he prefers one over others, it appears to be more of a personal preference — not everyone will agree with some of his details such as Rails having great documentation.

One language he doesn’t discuss that I’d really like see compared is Flex. Also, something like Flexiblerails that uses Rails for the web application framework and Flex for constructing views.

IDIA 619 Lab 2

Well, I’m too embarrassed to post the source code. I wasn’t fully successful in implementing Lab 2. I had decided to use Flash 9 as a development environment. At first things were easy. Specifying the new document class in the FLA file (e.g., Lab2), I could create a separate ActionScript file with a class using this document class name (Lab 2). This represents the class of the root object. It is the display object in which other display objects are placed.

This part works just fine. I had some objects in the library which I could refer to and manipulate on the stage. The document class needed to extend either Sprite or MovieClip (if you plan to reference the timeline). More implementation details can be found here.

A key useful thing I learned is that:

Unlike other display object classes you make, the stage property of a Document class will always be accessible since the document class is inherently a child of the stage. Similarly, if you place any objects on the main timeline in Flash, they will already be children of the Document class when its instantiated.

So here’s the problem. I wanted to make twinkling stars. These would be generated and placed on the stage from a TwinklingStars class in another external AS3 file. But the base MovieClip object is actually in the library of the Fla. What I can’t figure out is how to get these to display on the stage. I spent copious amounts of time studying this and am stumped. It’s a both a novice issue and one having to do with little available documentation. More clues are available here, but my stars are still broken… so time for a break on this problem.

So here is Lab2 without source (for the time-being) and without stars.

For Lab3 (a maze), I will probably write the entire project in AS3 but embed objects from a separate FLA file.

Using ActionScript 3

With the help of:

I'm now working in Flash 9 Alpha and diving straight into AS 3.0 instead of continuing down the path of Flash 8 and AS 2.0. For a while, I was entertaining the idea of moving to Flex -- but there really is no need. For the moment, I'm building games and animation so Flash really fits the bill. Plus, my Flash files are considerably smaller than some early Flex tests that were at least 50 KB in size (as opposed to 1.4 KB in Flash). But I really wanted the power and efficiency of AS 3.0, so I then turned toward the idea of embedding Flash 8 movieclips in AS 3. This is certainly possible. And even desirable if you use the current version of FlashDevelop which can decompile Flash 8 and show you the embedded assets of a swf.

However, there are some limitations associated with importing assets from Flash 8. Code on the embedded resource timeline will not be executed. Presumably, you can't cast these objects to custom objects (though I was able to cast to a new type). If I turn my Sprite into MovieClip, I can control the timeline. I was able to do this with a 20 frame tween:

Actionscript:
  1. var tween:Sprite = new Tween();
  2. var tweenMC:MovieClip = MovieClip(tween);
  3. addChild(tweenMC);
  4. tweenMC.x = 100;
  5. tweenMC.y = 300;
  6. tweenMC.gotoAndStop(10);

I'm still scratching my head over when you would use a loader class versus not use it. Via a simple embed, my objects are compiled in and I don't need the external library to be present. By contrast, if I use a loader class, objects are loaded at runtime. In AS3 you can manipulate the imported object's DisplayObject properties. So perhaps you have more available to you... well, at least with a Flash 9 object (see comments here). But what's eminently clear is that, if you want to communicate between an AVM1 SWF and an AVM2 SWF, you need to use LocalConnection.

So... since I'm starting fresh with building animations, it seems as if it might just be better to build everything in Flash 9 and take the plunge to learning Object Oriented Flash programming.

Lab 2 instructions are to:

  • create an object on the stage
  • set variables that control its motion in horizontal and vertical directions
  • move it so it bounces off the edge when it moves past the edge of the stage on any side
  • create a second object that moves randomly about the stage

I'm already doing most of this in Lab 1. So the challenge is re-writing in Flash 9 ActionScript 3. I've got a little twist to this to turn it into a pong game.... coming up next post. I've found an excellent resource to help move this along a little faster... Keith Peters (the guy from BIT-101) Foundation ActionScript Animation book.
Foundation ActionScript Animation

Useful free stuff

If you are interested in getting a head start on Flash 9 and ActionScript 3, you can download Adobe Labs Flash 9 preview (Windows only).

It will allow you to develop in AS2 (and will let you compile your existing projects) as well as AS3. It looks and feels a lot like Flash 8 but includes a much richer feature set if you use AS3. I tried it out with Lab 1 and it works great.

Other useful tools are:

  • Freemind Mindmaps for designing your projects and organizing your thoughts --even your notes on ActionScript.
  • There's a free swf viewer for your MindMaps so you can share them with others on the web. Here's a demo of this and you can navigate to download it here.
  • GIMP is a free image authoring tool.
  • Inkscape is a free vector illustration tool.

These are all high quality tools comparable to more expensive tools. And all of these sorts of tools are indispensible for interaction design work.

Freesound and Water Torture

I found a great site for sharing sounds. "The freesound project is a collaborative database of Creative Commons licensed sounds. Freesound focuses only on sound, not songs."

I used the drip sound below in lab 1 until I realized that it was water torture.

Drip1.wav:: One drop of water dripping into a cistern.

I replaced the drip with a pop:

FingerPlop4.wav::Finger plop from mouth.

Amazing what a difference it makes...

IDIA 619 Lab 1

On the second week of class, we started in on ActionScript. Our first assignment was rather easy... well, as easy as you make it. Starting with an animated ball, add something to it. I created the monstrosity referenced at the bottom of this post by using ActionScript. Over the next week, I'll try to re-implement it in Adobe Flex.

The obvious advantage of Flash is the ability to draw and work on a timeline. I haven't used WPF yet, but Lee Brimelow suggests that one of the great features of it is that it will generate code from the graphics you produce. Presumably, you will be able to do the same thing with Flash 9. If you could do both of these things in Flex, then it would it would be a killer tool. But, as he notes, Flex still produces very large projects as compared to Flash. Right now I'm thrumming my fingers on the table wishing I could be learning Flash 9. As it is, I'll try implementing this Lab in Flex as an exercise in ActionScript 3 and also to get a feel for the differences between Flash and Flex.

So what about WPF? It's supposed to be an analogue to Adobe Flex. As Andrew Shebanow notes:

WPF, WPF/E and Expression Blend were all designed first and foremost to address the designer-developer workflow as practiced in the Windows group at Microsoft. And based on what Robert Scoble wrote above, and on what I saw when I worked at Microsoft, this is a workflow that is all about having designers fit in with how developers want things to work. That's why they put so much focus on things like having Expression Blend use the same project format as Visual Studio, having it work with Visual Studio's version control mechanism, and so forth. When was the last time you heard a designer put any of those things near the top of their wishlist?

He goes on to say:

By contrast, Adobe feels that designers developing modern, interactive applications (whether using Web 2.0/Ajax or RIA technologies) want to build workflows that are first and foremost about delivering great designs to your clients. Those clients may be developers, but they might also be a corporate marketing department, or an online or offline content publisher, or any one of a zillion different content consumers. Adobe has designed Creative Suite, Apollo, Flex, and so forth to enable all these workflows, in a way that lets designers focus on what they do best.

Well, I've got a long ways to go to become a decent visual designer... but here's what my lab does:

  • Updates a dynamic textfield based on the location of a movieclip object
  • Changes properties of that movieclip when certain conditions are met
  • Chooses a random color from a list every time those conditions are met
  • Plays a sound when these conditions are met
  • Responds to a keypress

Not very exciting... but there you are. You can see and download the lab here.

Lisa’s Adventures in School

This blog is intended to document my journey through school. I'm in the process of applying to the doctorate program in Communications Design at the University of Baltimore Information Arts and Technologies Department. I've already spent a ton of time in graduate school while working on a PhD at Georgetown University in Computational Linguistics (I'd written about 150 pages toward my dissertation when I lost momentum and became more interested in web technologies). The Baltimore program is an applied doctorate and focuses on the art and practice of Communications and Interaction Design and is definitely more aligned with my current interests and career path. My first course is one in Interactive Multimedia taught by Kathleen Harmeyer. It's really a Flash 8 programming course, from my perspective. In any case, I will be documenting what I learn as I learn it. This blog should slowly transform and take on more character as I have time to modify it. Meanwhile, you can always visit my K9 SAR blog...