Web games, Flash and Actionscript.

Archive for the 'Tutorials' Category

Learning AS2 Classes Part 3

In the last 2 parts we covered simple classes using object and static methods. Today I’m going to go over class extensions.Extending classes is really useful when you want to make a bunch of classes that have independent functionality but also share a lot of common functions.

One of the most useful ways to use class extensions in game development is to extend the MovieClip class, and that’s just what we’re going to do now!

Read more »

Learning AS2 Classes Part 2

In the last lesson we went over what a class is, touched on the types of functions you can do and created a static class with some commonly used math routines.

This time we’ll get into object based classes.

Read more »

Learning AS2 Classes Part 1

I know that ActionScript 3.0 is the big thing now, but for a lot of flash developers who started out as hobbyists with more art background than programming, a strict/rigid language is really imposing.

Because of this intimidation factor, many of today’s most creative flash developers still work with ActionScript 1 and 2, coding everything on their timelines and in #include files, but with AS3 looming overhead, they are looking to get their feet wet in the pool of structured programming.

For me, if I hadn’t learned how to work with AS2 classes, AS3 would definitely be way over my head, so I thought I’d take a little trip back in time today and write a long overdue tutorial for my olschool homeboys out there that want to learn what classes are all about.

Read more »

Simple Actionscript Camera

While surfing around I noticed a few people had been asking about ways to move the camera around in their flash movies without using tweens.

I’m fully aware that there are some great solutions to this problem, but they may be a bit more than what people need, so I decided to whip off a very simple solution that can be used by entry-level programmers, or people with no programming background at all.

In order for this to work you will need to contain your actual animations in a movieclip. This is typically preferable to scenes anyway, so most animators probably do this anyway.

In this movie clip, create a new layer for the camera control. Now all you need to do is download simple_camera.fla and grab the MovieclipCameraControl object from the library and paste it into the new layer of your movie.

Now, whenever you make a new keyframe and re-position the camera reticle, your movie will automatically pan itself until the camera is centered, or the edge of your scene reaches the edge of the stage.

If you are interested in how it works, read on.

Read more »