Archive for September, 2007
Book review: ActionScript 3.0 Cookbook
Posted by zedia.net in Book review on September 26th, 2007
Not so long ago I bought the book ActionScript 3.0 Cookbook by Joey Lott, Darron Schall & Keith Peters, from O’Reilly. I’m a big fan of O’Reilly’s book; I got one for every computer language I learned. Usually I get the Definitive guide kinda book, but this time I decided to get a cookbook since you see these a lot and I never really stopped to see what it was.
In general it’s a pretty good book, for what it covers, it’s really well explained. I found it’s a good book to read fast; you just go over the pages quickly and look at the examples and it will give you ideas about what you can do in ActionScript 3 and how you should do it. For the most part it is targeted to a wide audience, novice to advanced programmers. That’s what I found not so useful about it. About 50% of the book is on really basic topics like: how to trace a message, how to add element to an array, etc. Mostly everything before Chapter 6 is really trivial. There is also a whole chapters about Date and Time. I found strange that in the Programmatic Animation chapter, they wouldn’t even speak about the tweening and easing classes.
The really good thing about this book is the chapter about the display list. It is something new to flash and they really take the time to explain it well.
All in all, it’s a good book; I don’t think that you can’t live without it, but it’s definitely nice to have around when you program.
Using the Fuse kit for animation versus using the Tween Classes
Most of what I will write about is interesting stuff I found while searching for something. When searching for the tween classes in Flash CS3 I stumble two times on people speaking about the fuse kit for animation. I have as a motto to check out things that I hear about twice, so that the next time it comes up, I know what people are talking about. In this case this could even be helpful for my job, so I go and check it out.
The fuse kit are some ActionScript2 classes that simplify that syntax of doing animation using ActionScript. It has 3 parts; one is the Zigo Engine which handles the tweening. It can be used as a standalone. The second part is Fuse itself, which are sequencing classes that helps you organize your tween in time. The last part is FMP which permits you to use filters with Fuse.
This all looks pretty good, with it you can do tweens in sequence as well as in parallel. I say to myself, that is fantastic, I will be able to get rid of the setTimeout in my code and my ActionScript will be simpler to understand.
There is only one catch; The Zigo engine in itself adds to your SWF 34k, Fuse: 2k and FMP: 1k for a grand total of 37k. So it rules out the possibility to use it in banners and such. When I make a flash movie, I want it to be as small as possible so the idea of starting my SWFs at 37k doesn’t make me happy. Also you can’t use the Fuse kit to do roll overs; I do all my rollovers in actionscript so I would have to import the tween classes from Adobe too to add another 2k. For me it just doesn’t cut it; if my website as more than one SWF it’s 39k I have to add each time.
So in the end, the Fuse kit looked pretty good, but its advantages don’t match up with its disadvantages…
Flash IDE, FlashDevelop, SE|PY
While searching around for answers, I stumbled a couple of time on developers who didn’t use the actionScript editor that comes with Flash. As a matter of fact, before Flash CS3, the default editor wasn’t packed with options and was kinda simplistic. I was working on a project where I was up to 1000 lines of code so I said to myself, that’s right I need something that has more options. So here are the options I found:
SE|PY: It’s the first one I found, I guess it’s been around the longest. It’s kinda cool, and really easy to customize. It was made by Alessandro Crugnola from http://www.sephiroth.it/ . If you’ve done Flash for some time, you surely ended up on this site one day. This is a good interface, but it has two major down sides: it looks kinda old and it is not in development anymore.
FlashDevelop: I think FlashDevelop is the most promising interface out there. It looks great and has most of the feature that SE|PY has. It’s kinda hard to change the syntax color of the code, but that’s mostly it. It has a great structure for adding plugin so it might become really good in time. Another point I didn’t like was that for help about actionScript code it sends you to adobe liveDocs on the web which is awfully slow.
Flash IDE: This is the default interface that comes with Flash. Up to Flash 8 I would say that you need another interface if you do a lot of actionScript coding. The thing is, that in Flash CS3 Adobe really put some time on the ActionScript editor and made it the better than even FlashDevelop. It now has code folding, and can fold mostly anywhere, not just functions (like in FlashDevelop). Help is easy and fast and it is integrated with the rest of the Flash interface.
So there it is, my review of the ActionScrip editors out there. My big winner is the Flash CS3 editor, but you have to watch closely for FlashDevelop development because it might become really interesting.
ActionScript 3 Tween Classes
Posted by zedia.net in ActionScript 3 on September 14th, 2007
I was reading the book ActionScript 3 cookbook from O’Reilly (very good book by the way) and I wanted to get my hands dirty. I have never coded in ActionScript 3 before and where i work we still use Flash 8 because it’s what most people have. So there I was wanting to do basic stuff, regular animation using the tween classes from Flash, but at first I couldn’t find them. Searched a bit and found all sort of post saying they didn’t exist anymore, or that you had to use classes from Flex in order to use them. I finally found them after some time. So let me spare you that effort. Here are the tweening classes from flash CS3.
1 2 | import fl.transitions.Tween; import fl.transitions.easing.*; |
and they still work the same way using this syntax:
1 | var myTween:Tween = new Tween(myObject, "x", Elastic.easeOut, 0, 300, 3, true); |
The only difference is with the “x” where it used to be “_x” because ActionScript 3 dropped the underscore before key properties.
Where this all started
zedia.net used to be the website for a company I had with two friends. We did good for a while made some websites, learned the ropes, made some money but when we finished school, we all went our way. Still it took us so much time to find a name that we all liked for the company and the web address that I didn’t want to just throw it away. So I’m going to use it for my blog. I didn’t think I would ever make a blog, but recently I have been looking around for questions about Adobe Flash and I have had a hard time finding the answer I wanted. So mostly this blog will be about my research in the ActionScript domain and mostly everything I find interesting.
For now I will use the wordPress platform to blog until I find something better. for now it serves all my needs. Also several changes will appear on the page as I tweak the interface. I don’t know how often I will update this blog, but I guess we will see…


