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

  • SEARCH
  • Home
  • 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 8307769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:36:22+00:00 2026-06-08T18:36:22+00:00

I have two projects, A and B , that reference a library, MyExternalLibrary .

  • 0

I have two projects, A and B, that reference a library, MyExternalLibrary. A and B are .swfs (two different AS3 projects) and MyExternalLibrary is a .swc. When my application is run, A loads B.

There is a Class, MyLoader, in MyExternalLibrary that B uses extensively. MyExternalLibrary.MyLoader loads .swfs that are present on our server (we don’t embed them because they are loaded dynamically per user-request).

Note that our server contains A, B and all of the .swfs we are going to download.

Now, A must also load some of the .swfs on our server. Consequentially, A must also use MyLoader in MyExternalLibrary. So, In A, I add a reference to MyLoader, so that its binary is included during compilation. I only add a reference to MyLoader — I don’t actually instantiate or modify it. That is, somewhere in A‘s code (before B is loaded), I have:

MyLoader;

I (obviously) import the Class as well. This ensures that MyLoader‘s binary will be included in A‘s .swf.

Just referencing MyExternalLibary.MyLoader in A breaks B‘s functionality with MyLoader — all of the .swfs that B loads will not cast to its associated Class, despite being a MovieClip and having all of the proper fields. Furthermore, in the debugger, the loaded MovieClips show that they are of the correct Class. For example, if I load a .swf, it will be a MovieClip; moreover, the debugger states it is of type B.mySwfs.MyClass, but I cannot cast it to B.mySwfs.MyClass. I believe the culprit is ApplicationDomain.

Note that commenting out that line of code makes everything in B cast properly.

If anyone has any idea about what’s going on, I’d love some advice. I think that this issue deals with ApplicationDomain since A owns MyExternalLibrary.MyLoader, and I’m trying to cast a MovieClip loaded by A into a Class that is in B. When I comment out all references to MyExternalLibrary.MyLoader in A, B now owns MyExternalLibrary.MyLoader, so it is able to cast to classes in B. That is my hunch!

Thanks,

  • 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-08T18:36:23+00:00Added an answer on June 8, 2026 at 6:36 pm

    The solution was to ensure that B‘s ApplicationDomain is the same as A‘s ApplicationDomain. This is done by parameterizing an instance of LoaderContext in either Loader.load or Loader.loadBytes.

    For example, A loads B with the following line of code:

    m_loader.load(new URLRequest("B.swf"), new LoaderContext(false, ApplicationDomain.currentDomain));

    This adds all of B‘s Class definitions to A. So, when A loads a .swf, and that MovieClip is casted to a Class in B, everything will work because A and B are in the same ApplicationDomain. So, an Object loaded by A can be casted to a Class that is in B.

    If anyone else encounters this problem, I highly suggest taking a look at GreenSock’s SWFLoader: http://www.greensock.com/as/docs/tween/com/greensock/loading/SWFLoader.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two different projects and in one, I have a class that defines
I have a vb.net 3.5 class library project that needs to reference two assemblies
I have two projects, one is a library that uses libpq headers and the
I have two separete c# projects. One is a helper library that is included
I have two projects, a Cocoa iPhone application and a static library which it
We have two projects that are both class libraries. Project 1 is a VS
I have a list that has two items: projects and groups. Projects can go
I have a clojure/ring project that has two distinct app/handlers running on different ports
In my PHP project I have two different models that have a function with
I have two Android projects, a 'library project' containing a custom layout, and an

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.