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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:43:38+00:00 2026-05-16T17:43:38+00:00

So my problem may be a little bigger than that, but I’m not certain.

  • 0

So my problem may be a little bigger than that, but I’m not certain. I’m creating a custom flash photo viewer for a client that dynamically loads the images with Loader objects. It takes a folder name in a specified directory on the server and calls a php page (using URLRequest) to get the workable contents of the folder. And then it loads it up from that array.

Here’s the problem: it works FINE on my machine and every machine I’ve tested it on, but it DOESN’T work on my client’s machine or some of his customer’s machines. The loader bar that’s at the bottom of the screen doesn’t start to fill, which means that the images aren’t starting to even load, and the status bar indicates that it continues to wait for a the server, yet never finishes waiting. This is consistent on a single machine, but varies across machines.

I’ve added diagnostics (a custom class I made to track certain vars and collect errors) to the thing to catch any errors, but it reports nothing on my client’s machine. I’ve added flash version checking code, so the possibility of a lower version messing it up is gone…

I guess my question is, is there anything (security, environment, etc) that I could have overlooked that doesn’t allow request objects or something to work on certain machines?? I’ve been ripping my hair out trying to figure this out!

My code (relevant sections):

    public static const LOADLIMIT:int = 4;

    public var paramObj:Object;
    private var imageRequests:Vector.<URLRequest>;
    private var loaderObj:Vector.<Loader>;
    private var nextToLoad:int = -1;

    //...

    public function Player(){
        //...
        paramObj = loaderInfo.parameters;
            if (!paramObj.root) paramObj.root = "http://site.com/images/";
            paramObj.imgloc = paramObj.imgloc;
            var res = bootstrapImages(paramObj.imgloc);
            if (res is String){
                loadErrorMsg.text = res;
                loadErrorMsg.visible = true;
                log.log(res);
            }
        //...
    }

    private function bootstrapImages(imgloc:String):*{
        try{
        if (!imgloc) return "No image location specified"; 

        var req:URLRequest = new URLRequest(paramObj.root+"getdirlist.php?name="+imgloc);
        var loader:URLLoader = new URLLoader();
        loader.addEventListener(Event.COMPLETE, directoryLoaded);
        loader.addEventListener(IOErrorEvent.IO_ERROR, function(ex:IOError){
            loadErrorMsg.text = "Error retreiving album data.";
            loadErrorMsg.visible = true;
            log.log(ex);
        });
        loader.load(req);
        } catch (ex:Error){
            log.log(ex); throw ex;
        }
    }

    private function directoryLoaded(e:Event){
        try{
        //directory will come down as a json array
        trace(e.target.data);
        try {
            var items:Array = JSON.decode(e.target.data);
        } catch (ex:Error){
            trace (ex.getStackTrace());
            loadErrorMsg.text = "Error parsing album data.";
            loadErrorMsg.visible = true;
            log.log(ex);
            return;
        } 

        if (items.length == 0){
            loadErrorMsg.text = "Invalid album name";
            loadErrorMsg.visible = true;
            log.log("Items length is 0.");
            return;
        }

        imageRequests = new Vector.<URLRequest>();
        loaderObj = new Vector.<Loader>();
        for each(var item:String in items){
            imageRequests.push(new URLRequest(paramObj.root+"coffeeimages/"+paramObj.imgloc+"/"+item));
            loaderObj.push(null);
        }

        //...show UI...

        for (var i:int = 0; i < LOADLIMIT; i++){
            imageLoaded(null);
        }
        } catch (ex:Error){
            log.log(ex); throw ex;
        }
    }

    private function imageLoaded(e:Event){
        try{
        //if this was called as a result of the load event, start the slideshow! :D
        if (e != null && e.target != null) {
            //stage.addChild((e.target as LoaderInfo).loader);
            trace(loaderObj[0]);
            if (loaderObj[0] != null && //if the first image is loaded
                loaderObj[0].contentLoaderInfo.bytesLoaded >= loaderObj[0].contentLoaderInfo.bytesTotal){ 
                trace(loaderObj[0].contentLoaderInfo.bytesLoaded, loaderObj[0].contentLoaderInfo.bytesTotal);
                loadErrorMsg.visible = false;
                playSlideshow(true);
            }
        }
        trace((e)?e.target:null, loaderObj);
        nextToLoad++;
        if (nextToLoad >= imageRequests.length) return;

        var r:URLRequest = imageRequests[nextToLoad];
        var l:Loader = new Loader();
        l.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
        l.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function(ex:ErrorEvent){
            loadErrorMsg.text = "Error parsing image data.";
            loadErrorMsg.visible = true;
            log.log(ex);
        });
        l.load(r);
        loaderObj[nextToLoad] = l;
        log.addObjectWatch(l);
        } catch (ex:Error){
            log.log(ex); throw ex;
        }
    }

Also, here’s the player live on the site. Ctrl+Alt+Home brings up my diagnostics panel. Please tell me if it doesn’t work for you as well, so I can be more worried about this… :/ Thanks.

Edit: I have added more debugging information. Turns out that on the computers that cannot load it, they are getting an HTTP status 0 returned when trying to bootstrap the album information. I have no idea what that means…

  • 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-16T17:43:38+00:00Added an answer on May 16, 2026 at 5:43 pm

    So, the problem was a matter of the URL its requesting…

    My client was typing “www.site.com”, while my code was requesting to “site.com”. To Adobe, this is a cross site request, and NOT ALLOWED by default. One solution (and probably the easiest one) is to add a file called “crossdomain.xml” to the root folder of the website. Flash looks for this file when making a request. One example that worked for me is as follows:

    //crossdomain.xml
    <?xml version="1.0"?>
    <!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
    
    <cross-domain-policy>
        <allow-access-from domain="*.site.com" secure="false"/>
    </cross-domain-policy>
    

    Other solutions involve redirecting to one of the two (“site.com” redirects to “www.site.com”), or doing url rewriting, or getting url that they entered.

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

Sidebar

Related Questions

I would like to update my SQL lite database with the native update-method of
I need to solve the following question which i can't get to work by

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.