Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 138
  • Last Modified:

hanging when loading asp value pairs

Hi there

I'm trying to load a bunch of asp pages into Flash using loadvars.

When i load this certain page in browsers, it crashes maybe every 4 out of 5 times. (Specifically what happens is - in IE it just stops, in Moz it says "Plug-in has performed an illegal operation etc")

When i test it locally in Flash (like go "test movie", it loads sweet every time)

the asp page is here :


a test version of the flash movie is here :


here's the code i'm using to load the asp page:

System.useCodepage = true;
function makeProduct(ProductID, TagLine, ProductDesc, ProductName, GenderID, RangeID, Visited) {
        this.ProductID = ProductID;
        this.TagLine = TagLine;
        this.ProductDesc = ProductDesc;
        this.ProductName = ProductName;
        this.GenderID = GenderID;
        this.RangeID = RangeID;
        this.Visited = Visited;
function getRanges() {
        RangeSend = new LoadVars();
        RangeSend.onLoad = getRangesHandler;
function getRangesHandler(success) {
        traceout.htmlText = "start";
        var Range = [];
        var ProductID, TagLine, ProductDesc, ProductName, GenderID, RangeID, ProdColourID, Code, Colour1ID, Colour2ID, SmImage, LgImage, Visited;
        if (success) {
                for (var i = 0; i<RangeSend.ProductCount; i++) {
                        ProductID = RangeSend["ProductID"+i];
                        TagLine = RangeSend["TagLine"+i];
                        ProductDesc = RangeSend["ProductDesc"+i];
                        ProductName = RangeSend["ProductName"+i];
                        GenderID = RangeSend["GenderID"+i];
                        RangeID = RangeSend["RangeID"+i];
                        Visited = false;
                        newProd = new makeProduct(ProductID, TagLine, ProductDesc, ProductName, GenderID, RangeID, Visited);
                        Range[i] = newProd;
                        delete newProd;
                        traceout.htmlText += Range[i].ProductName;
                traceout.htmlText += "done";
                // continue on if it's worked...
        } else {
                loadFunc.htmlText = "<b>SORRY, RANGE FAILED. PLEASE TRY AGAIN.</b>";

It's really weird, cos i've used pretty much identical functions to load everything else and it doesn't crash. I think therefore it may be a weird character in the asp encoding that Flash doesn't like, something like that?

Any help would be sooooooo appreciated. Thanks in advance


ps if it doesn't crash the first time refresh it a couple of times ..
  • 2
1 Solution
new makeProduct(ProductID, TagLine, ProductDesc, ProductName, GenderID, RangeID, Visited);

I think this line might be whats causing your problems...makeProduct is a function...not a class...and using the new operator tries to make a new object and flash gets confused when u try to make an onbject out of a function. remove the "new" and see if things go better?
It has something to do with the amount of data loading. Try to load less than 64k of data..
FractureAuthor Commented:
Hi guys

Thanks for your suggestions.

Drakkon - i tried taking the "new" out - so my code was like this:

                  newProd = makeProduct(ProductID, TagLine, ProductDesc, ProductName, GenderID, RangeID, Visited);
                  RangeTest[i] = newProd;
                  delete newProd;

Didn't work. it just added everything to the array as "undefined". I think that code is pretty solid, it's worked for me on a lot of other sites and on all the other load functions on this site. Here is the page where i adapted it from :


Negatyve - I actually came across that 64k thing on forums yesterday. We scaled the page back.. last time i checked it was on 48983 bytes, and it's still crashing all the browsers.

Any other suggestions? Thanks
FractureAuthor Commented:
Hi Guys,

Well we cracked it! It was the size of the page but it seems to be erroring on anything over 40 k.  Strange considering the information out there.  Possibly somehow it is adding data on to the page when it loads taking it over the 64k.  We are just stoked it works now.  

Negatyve you get the points because the first part of your answer was indeed spot on!  

Cheers mate,


Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now