I have come across Flash websites (the complicated and beautiful ones) that use multiple .swf movies. Why and how is that done?

Dani AI

Generated

Good summary so far from (modules) and (ActionScript drives the wiring). Multiple SWFs were and are used to split a Flash site into a small “shell” and many content modules so each piece can be authored, loaded, updated and cached independently. Benefits include faster initial load, parallel team workflows (designers on one SWF, devs on another), reuse across pages, and simpler memory/cleanup boundaries when swapping screens or features.

Typical implementation (AS3) uses a loader/host SWF that pulls in child SWFs at runtime and links them into the display list. The host can coordinate navigation, pass data, and sandbox third‑party content. A minimal pattern (AS3) looks like:

import flash.display.Loader;
import flash.events.Event;
import flash.net.URLRequest;

var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
loader.load(new URLRequest("module.swf"));

function onComplete(e:Event):void {
    addChild(loader);
}

Practical tips and pitfalls: use a preloader for large modules; call Loader.unloadAndStop() and remove listeners to avoid leaks; be conscious of ApplicationDomain/class name collisions when sharing classes; and check cross‑domain policy/security if loading remote SWFs. Use ExternalInterface or LocalConnection for JS/host communication when needed. For AS2 projects the equivalent is loadMovie/loadMovieNum, but AS3/Loader is the modern approach.

Important context: Flash Player reached end of life in 2020 and browsers no longer support the plugin, so building new sites with SWF is not recommended. For preserving legacy SWFs consider an emulator like Ruffle or convert animations to HTML5/Canvas via modern toolchains. See Adobe on Flash end of life and the Loader class for implementation details: Adobe Flash Player End-of-Life, Loader (ActionScript 3), Ruffle emulator.

Recommended Answers

All 3 Replies

Member Avatar for Member #334542

You can imagine that as a module, Designers are create animations in different swf files and integrate as one to display in the website.

Member Avatar for Member #334542

For example, When you refreshing a page frequently,the banner ads can change different swf's for every refreshing time.

I actually found the answer to my own question this time. You need multiple SWFs when making a Flash website and Action script helps make it happen. Thanks for trying to help, but it really has nothing to do with banner ads and everything to do with making a functional Flash website.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.