Is flash site architecture one swf versus many?

I am about to start creating the site completely in Flash (at the request of the client) using AS3, and wondered about the best practices for this in terms of application architecture. The site is not too big - I think that on the main page there is a permanent nav, 8 subsections or so, each with its own content, but with a similar design between the subsections. I used to use several swfs (for example, one for the navigator and one for each subsection) and loaded them dynamically; now, however, I'm considering using a different route and using a more object-oriented design with more classes and just one SWF (plus a preloader to load it).

Are there any better methods to determine if it is better to dynamically load smaller swfs or build one big swf? In AS2, I think loading many of the smaller swfs makes more sense, but with AS3 more powerful object-oriented features. I wonder if this is still the case.

I know that one argument against a single-line design will be the extra weight of loading everything to bootstrap, but I donโ€™t think that there is enough heavy content that is really interesting here.

Any thoughts?

+4
source share
7 answers

In my experience, the usual practice these days for (most) small and medium Flash websites / applications is two SWF architectures, a shell that loads the kernel. Sometimes you can get by with just one SWF that tracks its own move. However, you want to download content and assets on demand; Images, videos, animations and great text content. Usually they should not be embedded in the main SWF, but loaded at the request of the user. The main advantage in any case here (one versus two SWFs) is code maintenance. You only need to recompile the main SWF when you make updates to the application. In this model, you can still download additional SWF files containing animations based on the timeline if you saved the application code in the kernel.

Hope this helps!

+1
source

It depends on what you mean by "lesser".

Do not break it into pieces that are too small or you will kill yourself due to overhead. Do not pack the entire site in one mammoth pad, which takes weeks to download.

A good rule of thumb: if you are trying to come up with catchy or entertaining things to display while your users are waiting for it to load, restructure instead.

- MarkusQ

+1
source

I think it depends heavily on the content of the pages and the number of assets that you have already included in the SWF.

Usually we just do 2 swfs: one preloader and a real application.

There are no text or images in the applications. Everything (except fonts) is dynamically loaded from the server, because the content is dynamic in most of our cases. The swf size will not greatly increase the addition of 10 more classes.

It is difficult to give a 100% direct answer to your question, as it depends on the weight of the content (and whether it is dynamic or very static).

+1
source

There is no way to SAY ALL. One project can be small and thin to program the code, because where another can be confusing, use many hands and, of course, be able to accept changes, then OOP and design patterns can be a way. For a production-based site that will undoubtedly be partitioned, abstracting each section to its own FLA / SWF / DOCUMENT CLASS allows code to be maintained. If something in the about section requires changes, we simply open AboutDocumentClass.as, for example, and make our changes. Let be real, you should use SWFAddress now days to offer deeplinking; enable favorites, back and forward buttons for flash sites. With the correct implementation of SWFAddress and a good preloader, you can achieve a very smooth and low level of space that is easy to manage and scale.

Saying, I believe that any level-level flash developer should be aware of the GAIA Framework. In a few minutes, you have a whole structure of FLA bones, document classes, swf, etc. GAIA not only arranges the output files in an intelligent hierarchy, but also installs SWFObject and SWFAddress, as well as a preloader.

All this is done the first time you edit the XML file, which is located in the bin folder, wherever you print new project files to GAIA. After you have finished editing XML and any other elements, you point GAIA to the scaffold, for each section that you take into account in XML, a FLA is created, a document class with transition hooks based on the timeline, or an implementation of TweenLite / Max, depending on of your choice before scaffolding. Again, this takes about five minutes, and you have the bones of your site pre-loaded, defocus SWFAddress, and transitions to transitions.

The result is accurate output of files using a standard set of names and conventions, which should be easy to read and be reduced in excess by ten times.

+1
source

one argument against a single-line design will be an additional loading weight of everything at the initial [...]

You want to keep parts that change frequently from those that are not separated, if any. There is something called Custom Creation and creationPolicy take care of loading times. But besides this, it really comes down to something that you will be comfortable supporting.

0
source

No, I know what I know ("best practices for determining whether it is better to dynamically load smaller swfs") but I can think of a good reason to download all the content in the beginning
what i usually do

  • I write all the code in one place

  • load swf with graphic dynamically

0
source

Boot time can be an important factor, but an additional consideration to consider is whether the โ€œlookโ€ of your SWF can change while the underlying code remains the same. For several โ€œskin gamesโ€ that I worked on, where the gameplay was identical, but we wanted to be able to change the image to fit the sponsor customers, we divided the header into two SWFs, one with all the executable code (Application.swf) , and another with all the art assets in it (Library.swf). It turned out that our art team could go and evade Library.swf library, and while they supported the same movieclip export naming scheme (and, if necessary, frame labels), they could create new covers and just change their "shell" "" swf without having to recompile or know anything about the source code.

I think we used LoadMovieClip () to process library resources, and, of course, all library clips should have been marked for export to frame 1 with the corresponding labels. In addition, all of our code was in separate AS files, and since we used AS2.0, we included clips as members of classes, rather than pasting logic into videos. This almost completely separated art from code, with the exception of a few basic clips in Application.SWF, which were used to initialize and process OnEnterFrame () functions, and then passed any input or tick functions through a chain of child elements.

About a year has passed since I worked on this material, so my terminology may be a little disconnected. However, I hope this is helpful.

0
source

All Articles