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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:30:52+00:00 2026-05-20T23:30:52+00:00

The problem is: I have (for example) font embeder class, and I want to

  • 0

The problem is: I have (for example) font embeder class, and I want to load external SWF not from application storage folder, but another local path ( “D:\blah-blah\123.swf”) in AIR, but as you understand I can’t find any decision on the Internet (Google, Adode.com)

Security.allowDomain() not working in AIR ( documented on adobe.com)


Trick with ApplicationDomain is not working ( same documented on adobe.com)

The all I want, is to get CLASS REFERENCE from loaded content and use in load initiator.

Does anybody knows how to solve this problem?

listing code for getting acquaint:

_

_

[main AIR-app code sheet]

// function and one param (path to content)
function tralala( _swfPath : String)
{
    var l : Loader = new Loader();

        l.contentLoaderInfo.
        addEventListener( Event.COMPLETE,
                          function( _e : Event)
                          {
                              var tmp = _e.target.content;

                              // call function from SWF and retrieving
                              // classes, but can't work with them
                              Font.registerFont( tmp._getRef()[0]);


                              // no error checking for clarity
                          }
                        );

        l.load( new URLRequest( _swfPath));
}

_

_

[external SWF code]

function _getRef() : Array
{
    // class1,2,3 are font classes imported in library
    return [ class1, class2, class3]; 
}
  • 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-20T23:30:53+00:00Added an answer on May 20, 2026 at 11:30 pm

    I just managed to get my code working.

    So here’s everything I had to do in case someone else has the same issue:

    1. Read the swf file using a FileStream

      stream.readBytes(bytes)

    2. Create a new Loader object and load the bytes on that, using a LoaderContext

      var loader:Loader = new Loader();
      loadercontentLoaderInfo.addEventListener(Event.COMPLETE, fontFileLoaded, false, 0, true);

      var context:LoaderContext = new LoaderContext();
      context.applicationDomain = ApplicationDomain.currentDomain;
      context.allowCodeImport = true;

      loader.loadBytes(bytes, context);

    3. Make sure you do NOT call Security.allowDomain() inside the loaded swf. It doesn’t work with AIR, as @Focker mentions.

    4. There is no need to load a policy file with Security.loadPolicyFile()

    5. The swf files I used were created using Flash CS3, by adding new Font instances to the Library. I had no luck creating them with [Embed], as the resulting class was stored as TrebuchetMS_TrebuchetMS for example, instead of the actual class name which was TrebuchetMS.

    6. I didn’t have to create a security bridge (LoaderInfo.childSandboxBridge)

    I hope I’m not forgetting anything.

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

Sidebar

Related Questions

i have problem using LIKE structure in DB2 : for example: select * from
An application specific example to illustrate my immediate problem: I have a metadata provider
Here's the problem. I ,for example,have a string 2500.Its converted from byte array into
I have a problem. I wrote example code and I want to build it
I have a problem, when i delete a item for example, it deletes from
i have problem use link_to_remote link_to_remote document example say link_to_remote Delete this post, :update
I have a problem with accented letters. For example: I have a tag that
I have problem developing with live555. I already build the lib-files and example projects
i will give an example of the problem i have. My XML is like
Possible Duplicate: Java - Regex problem I have list of URLs of types: http://www.example.com/pk/etc

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.