Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8960457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:39:47+00:00 2026-06-15T15:39:47+00:00

I need some clarification on this subject as I just ran into an issue

  • 0

I need some clarification on this subject as I just ran into an issue with loading swfs into a reused loader object.

So lets say I have 3 SWFs.
Main.swf
childA.swf
childB.swf

Main.swf has a loader object in it that gets reused (myloader.load(“childA.swf”)) and childA or childB swf will be loaded via user interaction.
Both child swfs have a com package with a class in that package called config.
The config files are different files for both classes just named the same.
both child swf also dispatch an event that the Main listens for

Now the problem I had was if childA was loaded first then after childB was loaded it would still show as childA. Basically, whichever one got loaded into that loader first would be the winner.
This drove me nuts as nothing I did would cause the swf to unload. Not until I found the following code.

var appDomain:ApplicationDomain = new ApplicationDomain();
var context:LoaderContext = new LoaderContext(false, appDomain);
_contentPanel.load(new URLRequest(str), context);

I stumbled over this code on a post somewhere talking about how to truly unload a swf. Apparently, This also applies to how to truly load a swf.
As you can see a new appDomain is created and assigned to the context when loaded.
This works like a dream I can now load and unload all day long.

My confusion is the event that the child dispatches still works, when I don’t think the Main swf should pick it up due to it not being in the same appDomain.
I mean shouldn’t the event be blocked?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T15:39:49+00:00Added an answer on June 15, 2026 at 3:39 pm

    Unloading a SWF

    The Loader class provides Loader.unload() (or after Flash Player vers. 10 – Loader.unloadAndStop())

    Problem with the second loaded SWF being overridden by the first

    Objects that are stored in ApplicationDomains are stored by their class-name and I wonder whether the class names of the loaded SWFs (or their children) are overriding. Even if that isn’t the case; why not use a new instance of the Loader for each object being loaded?

    How the Main SWF can pick up both children from another application domain

    The Main SWF will be able to work with the new (loaded) application domains because they are child-domains of the Main SWF’s (See ApplicationDomain.parentDomain). The Main SWF’s domain will be the ‘system domain’ and the new instances will be loaded below it.

    Splitting the loaded SWFs from the Loader

    Ideally you want to have access to the SWF data irrelevant of the state of the Loader. You can do this by accessing the root movieClip of the SWF once loaded and create a new instance with

    var rootClipClass:Class = ApplicationDomain.getDefinition("[InsertYourRootClipName]") as Class; 
    var rootClip:MovieClip = new rootClipClass(); 
    

    At that point you can unload the loader and work with your fresh instance cleanly.

    Further reading

    • Difference between Loader.unload() and Loader.unloadAndStop()
    • Working with Application Domains – Adobe Docs
    • Loader class reference
    • ApplicationDomain class reference
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just need some clarification on variables A normal variable has 2 parts to
Just need some quick clarification I have 2 Queries in my Access Database that
Just need some clarification on how to design a python script file test.py. When
I've read several threads about this topic and need some clarification on a few
Since I'm still new to Java, I'm running into some need for clarification how
I need some clarification regarding runtime/heap issues when deleting an object which was created
I thought I knew this, but am confused :( Need some clarification on it
I just need some clarification in regards to unit testing with VS2010. Currently, we
I came across the following code and I need some clarification about this code.
I just need some clarification on a line I read after running rvm requirements

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.