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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:43:36+00:00 2026-05-27T08:43:36+00:00

I’m currently enrolled in an ActionScript course, and cannot seem to get my progress

  • 0

I’m currently enrolled in an ActionScript course, and cannot seem to get my progress bar to work correctly. We were tasked with creating a simple image loader application, which would access externally hosted images (through use of a PHP proxy script), and then spit the image onto the user’s screen (with a progress event and progress bar to track the image’s download progress).

However, when I run it, I get these mysterious black graphical glitches everywhere, as well as a non-functioning progress bar. In some browsers I get the following error: “ArgumentError: Error #2109: Frame label NaN not found in scene NaN. at flash.display.MovieClip/gotoAndStop() at Document/imageLoadProgress().

Here is my code – I cant for the life of me figure out what is wrong. I figure it has something to do with the imageLoadProgress() function, or my progress bar (which is just a simple 100-frame movie clip with a motion tween and a “stop()” command at the beginning).

public function loadImage()
    {
        var imageURL:String = imageArray[currentImageIndex];
        if(loaderInfo.url.substr(0,4) == "http")
        {
            trace("we're online");
            //use the proxy script
            //escape() will replace spaces in file names with %20
            imageURL = "./image_proxy.php?filename=" + escape(imageArray[currentImageIndex]);
        }

        var imageRequest:URLRequest = new URLRequest(imageURL);
        this.imageLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, this.imageIOError);
        this.imageLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, this.imageLoadProgress);
        this.imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, this.imageLoadComplete);
        this.imageLoader.load(imageRequest);
        //end loadImage
    }

    public function imageIOError(e:Event)
    {
        trace("ImageIOError called. Error=" + e);
        //end imageIOError
    }

    public function imageLoadProgress(e:ProgressEvent)
    {
        var percentLoaded:Number = e.bytesLoaded/e.bytesTotal;
        percentLoaded = Math.round(percentLoaded * 100);
        //this.progress_mc.scaleY = percentLoaded;
        if (percentLoaded < 1)
        {
            this.progressBar.gotoAndStop(1);
        }
        else
        {
            this.progressBar.gotoAndStop(percentLoaded);
        }
        //end imageLoadProgress
    }
  • 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-27T08:43:36+00:00Added an answer on May 27, 2026 at 8:43 am

    Your loader script seems absolutely fine to me, except for a tiny flaw:
    The only way the NaN(== not a Number) in your error message makes sense to me is if your ProgressEvent’s bytesTotal property equals 0 – because division by zero doesn’t produce valid results, as we all know.

    I can’t say for sure why this happens, not knowing any of your server-side code, but I assume it would occur if your PHP proxy script does not set the Content-Length HTTP response header correctly. If you were loading an actual image file, the web server would automatically set the header for you – in the case of your proxy script, it seems you have to take care of it yourself.

    Anyway, you can make your loader script more error-proof by testing for NaN, and making sure the frame you jump to is never greater than 100:

    var frame:int = isNaN (percentLoaded) || percentLoaded < 1 ? 1 : 
                             percentLoaded > 100 ? 100 : percentLoaded;
    progressBar.gotoAndStop(frame);
    

    (I chose shorthand notation, but this is essentially the same as writing two if statements and an else).

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

Sidebar

Related Questions

Seemingly simple, but I cannot find anything relevant on the web. What is the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am currently running into a problem where an element is coming back from
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm making a simple page using Google Maps API 3. My first. One marker
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.