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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:51:56+00:00 2026-05-23T10:51:56+00:00

I have this code that is supposed to pull a thumbnail image from a

  • 0

I have this code that is supposed to pull a thumbnail image from a remote server and return it to be displayed in Flex. Unfortunately my code is throwing “No active security context” errors.

After searching I saw a trick with setTimeout that is supposed to fix this, but it isn’t working for me. What am I doing wrong?

Here is the Code in Flex 4.0 (Note: File is a custom class)

public function getThumbnail(file:File, callBack:Function):void
{
  // only for image files
  if (file.mimeType.indexOf("image") > -1) {
    var loader:Loader = new Loader();
    // create request
    var urlVars:URLVariables = new URLVariables();
    urlVars.id = file.id;
    var req:URLRequest = new URLRequest(THUMBNAIL_URL);
    req.data = urlVars;
    setTimeout(
      function():void {
        loader.load(req);
      }, 1);
    // set load handler
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
      function(event:Event):void
      {
        var thumbnail:Image = new Image();
        thumbnail.source = event.currentTarget.content;
        callBack(thumbnail);
      });
    }
}

Update I placed this in my application.mxml

Security.allowDomain("*");
Security.allowInsecureDomain("*");
Security.loadPolicyFile("http://localhost:8080/crossdomain.xml");

And I modified the code in my action script file to

public function getThumbnail(file:File, callBack:Function):void
{
  // only for image files
  if (file.mimeType.indexOf("image") > -1) {
    var loader:Loader = new Loader();
    // create request
    var urlVars:URLVariables = new URLVariables();
    urlVars.id = file.id;
    var req:URLRequest = new URLRequest(THUMBNAIL_URL);
    req.data = urlVars;
    var context:LoaderContext = new LoaderContext(true);
    loader.load(req);
    // set load handler
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
      function(event:Event):void
      {
        var thumbnail:Image = new Image();
        thumbnail.source = event.currentTarget.content;
        callBack(thumbnail);
      });
    }
}

I had to modify my server.xml on my J2EE backend to get the crossdomain.xml to show up at the root.

My crossdomain.xml looks like this:

<?xml version="1.0"?>

<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">

<cross-domain-policy>

    <!--This domain can accept the SOAPAction header from a SWF file from www.example.com -->

    <site-control permitted-cross-domain-policies="all" />

    <allow-access-from domain="*" secure="false" />

    <allow-http-request-headers-from
        domain="*" headers="SOAPAction" />

</cross-domain-policy>

I still get the “No active security context” error in Firefox with the debug version of 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-23T10:51:57+00:00Added an answer on May 23, 2026 at 10:51 am

    I can’t find the link anymore, but there was a bug with version 10.2 of Flash with debugging. I recently upgraded to version 10.3 with the debugger and I no longer get this error.

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

Sidebar

Related Questions

So I have this code that takes care of command acknowledgment from remote computers,
I have this code that fetches some text from a page using BeautifulSoup soup=
I have encountered this piece of code that is supposed to determine the parent
I have a query that is supposed to pull records from several tables using
I have this code that's supposed to unzipp a file. public class dec extends
I have this code that takes info from a form and sends it to
I have this code that make an image animation, but I want to call
I have this code that is supposed to load the attributes of an XML
I have this piece of code I found on some blog, that's supposed to
I have this javascript code below that uses jquery, it is suppoed to be

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.