Skip to main content
Known Participant
October 29, 2010
Question

Class based programing vs timeline programing

  • October 29, 2010
  • 1 reply
  • 409 views

Hi Guys,

I’m new to ActionScript 3.0, some time ago I was developing some websites using ActionScript 2.0 - mainly timeline scripting. As I want to come back to developing websites, but I don’t want to go back to AS2 I’m learning AS3. On that occasion I want to learn class based programming and to learn it I’m trying to build the image portfolio website.

Before, my projects build was based on main.swf file which was loading external swf files for every ‘module’ of the website and now I’m not entirely sure how to organize my project using AS3.

So for the example let’s say the website I’m building will have:
- Main stage
- Menu
- Links content displayer
- Footer

Links would look like the below:
- Main image gallery
- Another image gallery
- Contact form
- About me
- News module

Now the question is, what is the best practice for building this kind of project?
Should I create Main swf file that will load all external content as swf files (image galleries engine, contact form, about me, news module) and place it on the stage? Or should I create separate class for each of the part of the website?

My concern is, that with separate swf files, I could update just one part of the website and upload it on the server and that part was loaded when needed. With project build based on classes, after updating one link’s class I’ll have to compile whole project – of course it’s not a big problem, but then the website will be in one file, which can grow every time I’ll update the links. The swf file will contain data that may never be used so this could be easily separate swf file loaded only on request.

This topic has been closed for replies.

1 reply

Inspiring
October 29, 2010

It is a pretty extensive topic. Based on your description entire application will be pretty small, so there is no need to separate swfs.

I sense that the main challenge is to separate information and presentation layers. This means, in part, that all your classes are configurable at runtime. The most common approach is loading external XML (it seems you got a handle on it). So, images, news, copy, links, etc. can reside in XML (or even several XMLs) - thus, you update these XMLs only without application recompilation. The same may go with styling of your classes.