Far more errors can be caught compile-time using classes than using timeline script. Rather than finding out halfway into a project that you've mistyped a variable's name in several places, you find out the first time you try to compile.
Classes also make for easier unit testing. I think it's generally better to extend the MovieClip class and register the symbol to the class than to create classes that refer to movie clips and assign them via timeline code. The latter approach faces more problems when the movie structure changes. In some ways it's also good to keep in line with what Adobe is doing. Are they making classes? Yes. Are they making scripts to be included from the timeline? No. There is only one instance where I currently use an included timeline script instead of a class, and that is for SWFObject's expressinstall.as, which needs to work in Flash Player 6r65. ― Mike Keesey > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:flashcoders- > [EMAIL PROTECTED] On Behalf Of Meinte van't Kruis > Sent: Monday, September 11, 2006 1:33 PM > To: Flashcoders mailing list > Subject: Re: [Flashcoders] classes vs external .as files > > it's more of a taste thing i guess, and this question kinda revolves > around > 'oop vs procedural' etc. > These discussions have been 'waged' alot of times, and often result in > language religion wars ;) > > Personally, if code is readable and makes sense, it's allright by me. > > Meinte > > On 9/11/06, Adrian Ionut Beschea <[EMAIL PROTECTED]> wrote: > > > > Hello, > > > > I've just had a debate with a colleague of mine about the some of the as > > 2.0 best practice. > > We both like to separate design from code, but we have slightly > different > > ways of doing it. > > > > This is what he does : > > He leaves design elements on stage and includes and external .as file to > > handle the logic. > > #include 'script.as' > > > > I like to think in terms of oop. > > So instead of including a script, I write something use: > > SampleClass.main(this) > > > > main is something like this : > > public static function main(target_mc:MovieClip) { > > instance = new SampleClass(target_mc); > > } > > > > What do you guys think ? Which method is more of your taste and why ? > > > > > > > > > > > > > > > > > > > > --------------------------------- > > How low will we go? Check out Yahoo! Messenger's low PC-to-Phone call > > rates. > > _______________________________________________ > > [email protected] > > To change your subscription options or search the archive: > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > Brought to you by Fig Leaf Software > > Premier Authorized Adobe Consulting and Training > > http://www.figleaf.com > > http://training.figleaf.com > > > _______________________________________________ > [email protected] > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com _______________________________________________ [email protected] To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com

