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 560707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:22:19+00:00 2026-05-13T12:22:19+00:00

This question is specific to Adobe AIR ActionScript/Flash applications. I’ve spend quite some time

  • 0

This question is specific to Adobe AIR ActionScript/Flash applications. I’ve spend quite some time researching this and kept finding discussions about either the Flash Player security model when running in the browser, where issues with SWF loading can be mitigated in various ways (loading from the same domain, using a crossdomain.xml file, etc.) or for AIR HTML applications, where the JavaScript security model is discussed with it’s per-frame sandboxes and the sandbox bridge approach. My problem is different, I believe.

First some code. To demonstrate, I created a very simple Flex application (LoaderInfoTest.mxml):

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication
    xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute"
    creationComplete="onCreationComplete(event)">
    <mx:Script>
        <![CDATA[
            import flash.display.LoaderInfo;
            import flash.system.ApplicationDomain;
            import flash.utils.getQualifiedClassName;

            import mx.events.FlexEvent;

            public function onCreationComplete(event:FlexEvent):void
            {
                // the following line of code throws an exception
                var info:LoaderInfo = LoaderInfo.getLoaderInfoByDefinition(this);
            }
        ]]>
    </mx:Script>
</mx:WindowedApplication>

… and an application.xml descriptor file (LoaderInfoTest-app.xml):

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<application xmlns="http://ns.adobe.com/air/application/1.5.2">
    <id>LoaderInfoTest</id>
    <filename>LoaderInfoTest</filename>
    <name>LoaderInfoTest</name>
    <version>v1</version>
    <initialWindow>
        <content>LoaderInfoTest.swf</content>
    </initialWindow>
</application>

I build this using Flash Builder 4 Beta, but I presume the issue remains the same when using the SDK command line tools. When executing this either from within Flash Builder or from the command line via:

> adl LoaderInfoTest-app.xml . 

I get a popup with this exception:

Security sandbox violation: caller app:/LoaderInfoTest.swf cannot access LoaderInfo.applicationDomain owned by app:/LoaderInfoTest.swf. at flash.display::LoaderInfo$/getLoaderInfoByDefinition() …

I don’t understand why the SWF cannot access the LoaderInfo.applicationDomain property (presumably a protected or internal property) owned by itself. The documentation for LoaderInfo.getLoaderInfoByDefinition states that it’s possible for a SecurityError to be thrown, if “[t]he caller is not running in the local trusted sandbox”. Unless I really have a gross misunderstanding of the AIR security model, a local SWF runs with full trust (application sandbox). So, why is this not working? Is it a bug in the AIR runtime?.

I should note that in a different scenario, when running this code as a pure Flash (not AIR) application in the Flash player, it does work.

The best answer would be some sort of configuration or setting I can change to make this work (maybe in the application descriptor?) … or pointing out where I am making a mistake. The second-best answer would be a definite source of explanation of why this will never work.

1st Edit – Before anyone points it out: I know that inside the onCreationComplete method, this.loaderInfo gives me access to the current LoaderInfo instance. My example here is the simplest I could come up with to demonstrate the “problem.” The context in which I want to use LoaderInfo.getLoaderInfoByDefinition(this) is not a DisplayObject instance.

2nd Edit – I am considering even accepting a link to where I can post a bug to Adobe AIR’s issue tracker as an answer. The public Flex issue tracker doesn’t count, because this is not a Flex problem.

3rd Edit – It is apparent that there are differences between the “local trusted sandbox” and the “AIR application sandbox,” but (some of) these differences seem non-sensical and I now consider them a bug, at least in the context of this question and especially because it works in Flash Player.

  • 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-05-13T12:22:19+00:00Added an answer on May 13, 2026 at 12:22 pm

    The documentation is correct that getLoaderInfoByDefinition is available only to content in the localTrusted sandbox. Although AIR application content has many privileges, it is not in localTrusted and therefore cannot use the API.

    It’s certainly a reasonable request, however, to add access for application content.

    As a workaround, you can use this API (and Sampler APIs) in AIR by loading another SWF in localTrusted sandbox. To do this, you need to add the file to one of the trusted lists, and load the file with a file:// URL (not app:/). There are then a number of ways for the localTrusted and application content to communicated.

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

Sidebar

Ask A Question

Stats

  • Questions 367k
  • Answers 367k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer First, that seems to be a ridiculously long ID --… May 14, 2026 at 4:55 pm
  • Editorial Team
    Editorial Team added an answer If you want to alter the way user registration works,… May 14, 2026 at 4:55 pm
  • Editorial Team
    Editorial Team added an answer when i export the table in html format the generated… May 14, 2026 at 4:55 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.