hanging when loading asp value pairs

Posted on 2004-11-29
Last Modified: 2010-04-07
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 ..
Question by:Fracture
    LVL 4

    Expert Comment

    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?
    LVL 27

    Accepted Solution

    It has something to do with the amount of data loading. Try to load less than 64k of data..

    Author Comment

    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

    Author Comment

    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,


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
    Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
    The goal of the tutorial is to teach the user how to how to record live broadcast.
    The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now