This file is where we're going to put the code that powers the FLA itself, but how will Flash know how to find it? Save this as Main.as in the same folder as your FLA. I've called mine Example.fla, but it doesn't matter what name you choose.Ĭlick File > New. I'm sure you already know how to do this. If you're one of them, I expect you're used to dealing with classes already, but you can always read this Quick Tip as a refresher - just ignore the bits about Flash!) (Part of the reason we're switching to classes is to make it easier for AS3 developers that don't use Flash itself to follow our tutorials. I'll walk you through creating a Flash project that uses classes, then break down a class file in detail. And it's really no harder than coding on the timeline it just involves a little more setup. All your ActionScript is trapped inside the FLA file you can't split the programming between different developers, you have to copy and paste code if you want to re-use it, and you're forced to use Flash's Actions Panel. It's a quick way to test out an effect, and the easiest way to sync actions to specific frames of an animation.īut for any project that relies more on code than on animation, there are serious disadvantages. I'll admit it - sometimes, coding entirely on the timeline is useful. This Quick Tip explains what you'll need to know.
From now on, our tutorials will be using class-based code, instead of timeline code, wherever possible. We're making some changes at Activetuts+.