THE PASZ.COM BLOG

Friday, August 12, 2005

A couple of FAME notes

A couple of things came to my attention that might affect people using
my FAME tutorial.

1. If you're planning to do Flash 8 development, you should grab this update to the mtasc/std folder.

2. There is an Alpha version of ASDT floating around (v. 0.0.8). I
would recommend NOT installing this version. You should be using the
version from the Sourceforge ASDT site (v. 0.0.7.1).

Wednesday, August 10, 2005

Coding Style: Getting into JavaScript OOP

I'm amazed how many JavaScript developers still don't use classes and other OOP concepts in their work. I don't know if this is because most of their projects are small in scale, or because most JavaScript developers come from a design background, or because OOP syntax in JS is arcane (e.g.: prototype). In any case, I think moving in an OOP direction is essential fro JS coders hoping to create more complex , maintainable applications.

For me, the best way to learn how to implement OOP is to convert non-OOP code. Create the functionality for a single instance of your object, using
variables and functions. Test it and get it working properly. Then convert
it into a Class. The variables become properties, and the functions become
methods. Once your Class is complete, it's very easy to create and test
multiple instances of the Object.

Here's a simple example with some non-OOP code that creates a single Rectangle:


var x = 100;
var y = 200;
var width = 50;
var height = 60;
function perimeter(){...} //returns perimeter
function area(){...} //returns area


To turn it into a Class, just make
x,y,width and height the properties, and perimeter() and area() the methods.


//Rectangle class
function Rectangle(x, y, width, height){
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}

Rectangle.prototype.area = function(){...}
Rectangle.prototype.perimeter = function(){...}
//end class


Voila, now you have a Class and you can instantiate multiple Rectangle
objects like so:

var r = new Rectangle(100,200,50,60);

This is a simplisitic example, but hopefully you get the idea. I like
coding out a single object procedurally first because it helps me understand in advance how my Class should be designed. Once you get good at making Classes, you
can skip this step, and do it in your head or on paper.

For further discussion of OOP techniques in JavaScript, I recommend my article A Practical Approach for Implementing Inheritance in JavaScript.

Tuesday, August 09, 2005

Macromedia Studio 8 Info

Here's the best info I've found so far about Macromedia Studio 8, which was announced this week. The article has detailed info from a web designer who clearly spent a considerable amount of time with the product. If you're interested in Flash 8, there are also some good tidbits here.

It looks like I will probably be investing in the $399 Studio upgrade. At first I was thinking I only needed Flash 8, but Macromedia is obviously making it very enticing for people to jump up to Studio for just $100 dollars more. So basically you're getting 4 products for $100 each. Also, the upgrade requirements are very friendly. All prior versions of Studio, Dreamweaver, Flash, and Fireworks are now eligible for the upgrade price. Anyone who owns either Flash, DreamWeaver or FireWorks can upgrade to Studio for the same flat price. It makes me wonder why anyone would pay $999 for the full version. Instead you could just buy Fireworks MX 2004 for $299 and then get the studio upgrade for $399, saving yourself $202! (You can probably find an older version on Ebay for even less.) I suppose this is Macromedia's sneaky way of hooking people who currently only use a part of the "studio" into the entire thing.

Monday, August 08, 2005

Getting More Out Of FAME

I've posted a new FAME tutorial in the Articles section of the site. If you've already worked through my first tutorial, this new tutorial can be considered Step 2 in becoming a FAME developer.

The tutorial covers the following topics:

  • Tracing Debug Output

  • Setting Up A Class Library

  • Working With Art Resources


If you're serious about learning FAME, I highly recommend you work through this tutorial, especially the part about dealing with Art Resources from the Flash Authoring Environment. So far, I haven't found any clear info on this topic, so hopefully the time I spent sussing things out will be helpful to people.

As always, please contact me with comments, especially if something is not working for you, or if you find a better way to do things.

Sunday, August 07, 2005

Macromedia News Coming On Monday

There are a couple new rumors circulating about an announcement from Macromedia on Monday. We shall see...

Latest rumors:
ActionScript.It
CIO

And thanks to MXNA for keeping me on top of all things Macromedia.