Load data from access db using asp

Hi,

I have a quote reader where a quote is loaded from an access database through asp. First quote is animated in, waits for 6 seconds then replaced by the next. It is not working properly as it sometimes loads the first quote, but sometimes doesnt! None of the other quotes load in either…not used to doing this sorta stuff in flash so any help/guidance would be appreciated. Heres the code:


[COLOR=#f000f0]*//Import the filter class*[/COLOR]
[COLOR=#993300]import[/COLOR] flash.[COLOR=#000000]filters[/COLOR].[COLOR=#000000]DropShadowFilter[/COLOR];
[COLOR=#f000f0]*//Create the dropShadow filter*[/COLOR]
[COLOR=#993300]var[/COLOR] dropShadow:DropShadowFilter = [COLOR=#993300]new[/COLOR] DropShadowFilter[COLOR=#000000]([/COLOR][COLOR=#000000]2[/COLOR], [COLOR=#000000]45[/COLOR], 0x000000, [COLOR=#000000]0[/COLOR].[COLOR=#000000]5[/COLOR], [COLOR=#000000]4[/COLOR], [COLOR=#000000]4[/COLOR], [COLOR=#000000]1[/COLOR], [COLOR=#000000]2[/COLOR][COLOR=#000000])[/COLOR];
quote.[COLOR=#000000]filters[/COLOR] = [COLOR=#000000][[/COLOR][COLOR=#993300]_root[/COLOR].[COLOR=#000000]dropShadow[/COLOR][COLOR=#000000]][/COLOR];
author.[COLOR=#000000]filters[/COLOR] = [COLOR=#000000][[/COLOR][COLOR=#993300]_root[/COLOR].[COLOR=#000000]dropShadow[/COLOR][COLOR=#000000]][/COLOR];
[COLOR=#f000f0]*//Import tween and easing classes (for animation)*[/COLOR]
[COLOR=#993300]import[/COLOR] mx.[COLOR=#000000]transitions[/COLOR].[COLOR=#000000]Tween[/COLOR];
[COLOR=#993300]import[/COLOR] mx.[COLOR=#000000]transitions[/COLOR].[COLOR=#000000]easing[/COLOR].*;
[COLOR=#f000f0]*//Set up the quote and author text properties*[/COLOR]
quote.[COLOR=#000000]strName[/COLOR].[COLOR=#993300]autoSize[/COLOR] = [COLOR=#0000ff]"left"[/COLOR];
quote.[COLOR=#000000]strName[/COLOR].[COLOR=#993300]_width[/COLOR] = [COLOR=#000000]750[/COLOR];
quote.[COLOR=#993300]_alpha[/COLOR] = [COLOR=#000000]0[/COLOR];
author.[COLOR=#000000]strTelephone[/COLOR].[COLOR=#993300]autoSize[/COLOR] = [COLOR=#0000ff]"left"[/COLOR];
author.[COLOR=#993300]_alpha[/COLOR] = [COLOR=#000000]0[/COLOR];
[COLOR=#f000f0]*//Set up the typewriter variables*[/COLOR]
myText = [COLOR=#0000ff]""[/COLOR];
letterCount = [COLOR=#000000]1[/COLOR];
[COLOR=#f000f0]*//Increase charToAdd for a faster write-in*[/COLOR]
charToAdd = [COLOR=#000000]5[/COLOR];
[COLOR=#f000f0]*//Increase charToErase for a faster erase transition*[/COLOR]
charToErase = [COLOR=#000000]10[/COLOR];
[COLOR=#f000f0]*//This is the _y location of the horizontal line across the stage to center the quote text vertically*[/COLOR]
centerLine = [COLOR=#000000]200[/COLOR];
[COLOR=#f000f0]*//This position will be used to update the quote text _y location as the text is constructed*[/COLOR]
centerPos = [COLOR=#000000]200[/COLOR];
[COLOR=#f000f0]*//Set the initial _y location of the quote*[/COLOR]
quote.[COLOR=#993300]_y[/COLOR] = centerLine;
[COLOR=#f000f0]*//Function to write-in each quote*[/COLOR]
simpleTyper = [COLOR=#993300]function[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
    [COLOR=#f000f0]*//Type in the text n characters at a time*[/COLOR]
    [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]letterCount<myText.[COLOR=#993300]length[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
        quote.[COLOR=#000000]strName[/COLOR].[COLOR=#993300]text[/COLOR] = myText.[COLOR=#993300]substring[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]0[/COLOR], letterCount[COLOR=#000000])[/COLOR];
        letterCount = letterCount+charToAdd;
    [COLOR=#000000]}[/COLOR] [COLOR=#993300]else[/COLOR] [COLOR=#000000]{[/COLOR]
        [COLOR=#f000f0]*//If the text has completed typing in, clear the interval*[/COLOR]
        quote.[COLOR=#000000]strName[/COLOR].[COLOR=#993300]text[/COLOR] = myText;
        author.[COLOR=#000000]strTelephone[/COLOR].[COLOR=#993300]text[/COLOR] = newAuthor;
        [COLOR=#f000f0]*//Position and fade the author text*[/COLOR]
        author.[COLOR=#993300]_y[/COLOR] = centerPos+quote.[COLOR=#000000]strName[/COLOR].[COLOR=#993300]textHeight[/COLOR]+[COLOR=#000000]20[/COLOR];
        [COLOR=#993300]new[/COLOR] Tween[COLOR=#000000]([/COLOR]author, [COLOR=#0000ff]"_alpha"[/COLOR], Strong.[COLOR=#000000]easeOut[/COLOR], [COLOR=#000000]0[/COLOR], [COLOR=#000000]100[/COLOR], [COLOR=#000000]1[/COLOR], [COLOR=#993300]true[/COLOR][COLOR=#000000])[/COLOR];
        [COLOR=#993300]clearInterval[/COLOR][COLOR=#000000]([/COLOR]simpleTyperInt[COLOR=#000000])[/COLOR];
    [COLOR=#000000]}[/COLOR]
    [COLOR=#f000f0]*//Move and center the text vertically by updating the centerPos*[/COLOR]
    centerPos = centerLine-[COLOR=#000000]([/COLOR]quote.[COLOR=#000000]strName[/COLOR].[COLOR=#993300]textHeight[/COLOR]/[COLOR=#000000]2[/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#993300]new[/COLOR] Tween[COLOR=#000000]([/COLOR]quote, [COLOR=#0000ff]"_y"[/COLOR], Strong.[COLOR=#000000]easeOut[/COLOR], quote.[COLOR=#993300]_y[/COLOR], centerPos, .[COLOR=#000000]5[/COLOR], [COLOR=#993300]true[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR];
callSimpleTyper = [COLOR=#993300]function[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
    [COLOR=#f000f0]*//Clear old intervals*[/COLOR]
    [COLOR=#993300]clearInterval[/COLOR][COLOR=#000000]([/COLOR]simpleTyperInt[COLOR=#000000])[/COLOR];
    [COLOR=#f000f0]*//Fade in the quote*[/COLOR]
    [COLOR=#993300]new[/COLOR] Tween[COLOR=#000000]([/COLOR]quote, [COLOR=#0000ff]"_alpha"[/COLOR], Strong.[COLOR=#000000]easeOut[/COLOR], [COLOR=#000000]0[/COLOR], [COLOR=#000000]100[/COLOR], [COLOR=#000000]1[/COLOR], [COLOR=#993300]true[/COLOR][COLOR=#000000])[/COLOR];
    simpleTyperInt = [COLOR=#993300]setInterval[/COLOR][COLOR=#000000]([/COLOR]simpleTyper, [COLOR=#000000]10[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR];
[COLOR=#f000f0]*//Function to erase each quote*[/COLOR]
typeErase = [COLOR=#993300]function[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
    [COLOR=#f000f0]*//Erase the text n characters at a time*[/COLOR]
    [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]letterCount>[COLOR=#000000]0[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
        quote.[COLOR=#000000]strName[/COLOR].[COLOR=#993300]text[/COLOR] = myText.[COLOR=#993300]substring[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]0[/COLOR], letterCount[COLOR=#000000])[/COLOR];
        letterCount = letterCount-charToErase;
    [COLOR=#000000]}[/COLOR] [COLOR=#993300]else[/COLOR] [COLOR=#000000]{[/COLOR]
        [COLOR=#f000f0]*//If the text has completed erasing, clear the interval*[/COLOR]
        [COLOR=#993300]clearInterval[/COLOR][COLOR=#000000]([/COLOR]typeEraseInt[COLOR=#000000])[/COLOR];
        quote.[COLOR=#000000]strName[/COLOR].[COLOR=#993300]text[/COLOR] = [COLOR=#0000ff]""[/COLOR];
        myText = newText;
        [COLOR=#f000f0]*//Call the function to write-in the new quote*[/COLOR]
        callSimpleTyper[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#000000]}[/COLOR]
    [COLOR=#f000f0]*//Move and center the text vertically by updating the centerPos*[/COLOR]
    centerPos = centerLine-[COLOR=#000000]([/COLOR]quote.[COLOR=#000000]strName[/COLOR].[COLOR=#993300]textHeight[/COLOR]/[COLOR=#000000]2[/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#993300]new[/COLOR] Tween[COLOR=#000000]([/COLOR]quote, [COLOR=#0000ff]"_y"[/COLOR], Strong.[COLOR=#000000]easeOut[/COLOR], quote.[COLOR=#993300]_y[/COLOR], centerPos, .[COLOR=#000000]5[/COLOR], [COLOR=#993300]true[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR];
callTypeErase = [COLOR=#993300]function[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
    [COLOR=#f000f0]*//Clear any setIntervals*[/COLOR]
    [COLOR=#993300]clearInterval[/COLOR][COLOR=#000000]([/COLOR]typeEraseInt[COLOR=#000000])[/COLOR];
    [COLOR=#993300]clearInterval[/COLOR][COLOR=#000000]([/COLOR]simpleTyperInt[COLOR=#000000])[/COLOR];
    [COLOR=#f000f0]*//Fade out the author text*[/COLOR]
    [COLOR=#993300]new[/COLOR] Tween[COLOR=#000000]([/COLOR]author, [COLOR=#0000ff]"_alpha"[/COLOR], Strong.[COLOR=#000000]easeOut[/COLOR], [COLOR=#000000]100[/COLOR], [COLOR=#000000]0[/COLOR], .[COLOR=#000000]5[/COLOR], [COLOR=#993300]true[/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#f000f0]*//Fade out the author text*[/COLOR]
    [COLOR=#993300]new[/COLOR] Tween[COLOR=#000000]([/COLOR]quote, [COLOR=#0000ff]"_alpha"[/COLOR], Strong.[COLOR=#000000]easeOut[/COLOR], [COLOR=#000000]100[/COLOR], [COLOR=#000000]0[/COLOR], [COLOR=#000000]1[/COLOR], [COLOR=#993300]true[/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#f000f0]*//Call the function to erase the quote*[/COLOR]
    typeEraseInt = [COLOR=#993300]setInterval[/COLOR][COLOR=#000000]([/COLOR]typeErase, [COLOR=#000000]10[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR];
[COLOR=#f000f0]*//Continue calling quotes*[/COLOR]
newQuote = [COLOR=#993300]function[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
    CurrentRecord++;
    [COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]CurrentRecord == TotalRecords[COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]
      CurrentRecord = [COLOR=#000000]0[/COLOR];
        [COLOR=#f000f0]*//loadVariables ("getdetails.asp?Record=" +(CurrentRecord), this);*[/COLOR]
[COLOR=#000000]}[/COLOR]
 
    newAuthor = quoteArray[COLOR=#000000][[/COLOR]currentQuote[COLOR=#000000]][/COLOR][COLOR=#000000][[/COLOR][COLOR=#000000]0[/COLOR][COLOR=#000000]][/COLOR];
    newText = quoteArray[COLOR=#000000][[/COLOR]currentQuote[COLOR=#000000]][/COLOR][COLOR=#000000][[/COLOR][COLOR=#000000]1[/COLOR][COLOR=#000000]][/COLOR];
    callTypeErase[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR];
[COLOR=#f000f0]*//Set the initial quote position to -1*[/COLOR]
currentRecord = -[COLOR=#000000]1[/COLOR];
 
[COLOR=#f000f0]*//Create the new quoteArray to hold all quote data*[/COLOR]
[COLOR=#993300]var[/COLOR] quoteArray:[COLOR=#993300]Array[/COLOR] = [COLOR=#993300]new[/COLOR] [COLOR=#993300]Array[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
 
[COLOR=#f000f0]*//Add each quote and author to the quotesArray*[/COLOR]
[COLOR=#993300]for[/COLOR] [COLOR=#000000]([/COLOR]i=[COLOR=#000000]0[/COLOR]; i<TotalRecords; i++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
    newAuthorText = [COLOR=#993300]loadVariables[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#0000ff]"getdetails.asp?Record="[/COLOR] +[COLOR=#000000]([/COLOR]CurrentRecord[COLOR=#000000])[/COLOR], [COLOR=#993300]this[/COLOR][COLOR=#000000])[/COLOR];
    newQuoteText = [COLOR=#993300]loadVariables[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#0000ff]"getdetails.asp?Record="[/COLOR] +[COLOR=#000000]([/COLOR]CurrentRecord[COLOR=#000000])[/COLOR], [COLOR=#993300]this[/COLOR][COLOR=#000000])[/COLOR];
    quoteArray[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR] = [COLOR=#000000][[/COLOR]newAuthorText, newQuoteText[COLOR=#000000]][/COLOR];
    [COLOR=#993300]loadVariables[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#0000ff]"getdetails.asp?Record="[/COLOR] +[COLOR=#000000]([/COLOR]CurrentRecord[COLOR=#000000])[/COLOR], [COLOR=#993300]this[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
 
[COLOR=#f000f0]*//When finished, call the first quote and create an interval to dislpay quotes every 6 seconds*[/COLOR]
newQuote[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
callNewQuote = [COLOR=#993300]setInterval[/COLOR][COLOR=#000000]([/COLOR]newQuote, [COLOR=#000000]6000[/COLOR][COLOR=#000000])[/COLOR];

two movieclips on the stage have this code on them:

clipname: quote


[COLOR=#993300]onClipEvent[/COLOR][COLOR=#000000]([/COLOR][COLOR=#993300]data[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]
    strName.[COLOR=#993300]text[/COLOR] = [COLOR=#993300]Name[/COLOR];
[COLOR=#000000]}[/COLOR]
 
[COLOR=#993300]onClipEvent[/COLOR][COLOR=#000000]([/COLOR][COLOR=#993300]load[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]
    CurrentRecord = [COLOR=#000000]0[/COLOR];
    [COLOR=#993300]loadVariables[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#0000ff]"getdetails.asp?Record=0"[/COLOR], [COLOR=#993300]this[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]

clipname: author


[COLOR=#993300]onClipEvent[/COLOR][COLOR=#000000]([/COLOR][COLOR=#993300]data[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]
    strTelephone.[COLOR=#993300]text[/COLOR] = Telephone;
[COLOR=#000000]}[/COLOR]
 
[COLOR=#993300]onClipEvent[/COLOR][COLOR=#000000]([/COLOR][COLOR=#993300]load[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]
    CurrentRecord = [COLOR=#000000]0[/COLOR];
    [COLOR=#993300]loadVariables[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#0000ff]"getdetails.asp?Record=0"[/COLOR], [COLOR=#993300]this[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]

Looks like you need to define TotalRecords. Its referenced in two places but never defined anywhere. That’d be a good first step.

Nope, that didnt sort it! heads wrecked with this one…