3 Replies Latest reply on Aug 7, 2008 1:53 PM by kglad

    Intermittant "Undefined" error in dynamic text field

    TPK Level 1
      I have recently inherited a fairly complex Flash project. Lots of individual Flash files and dynamic text/HTML files all working together to form interactive Flash project.

      This project is built using a “container” flash file that loads other, different flash files that contain dynamic text fields. These dynamic text fields pull text from external text/HTML files.

      The user looking at the flash file sees the text displayed after it is pulled into the dynamic text fields. The user can either click a “back” button and see the previously displayed dynamic text or click a “forward” button and see the next dynamic text content. The user "walks" through the project like turning pages of a book.

      Occasionally, when a flash file loads into the flash “container”, and that file tries to pull text for the dynamic text field (from the HTML file), a problem occurs. Instead of the text that is supposed to appear in the display, the word “undefined” appears. The user can navigate back to the previous content then go forward again, and the problem disappears.

      This problem is very intermittent. There does not seem to be a specific place where it occurs.

      I have been asked to determine why an “undefined” error occurs. The problem does not appear to be from the flash with the dynamic text fields, nor does it appear to be from the text/HTML file.

      Somehow the variable is getting “lost” intermittently.
      I have seen this error message when there is a definitive problem but it is consistant. This intermittent thing has me baffled.

      Has anyone seen this behavior before, and if so have you ever traced the problem (could this possibly be a problem unrelated to the actionscript)?
        • 1. Re: Intermittant "Undefined" error in dynamic text field
          kglad Adobe Community Professional & MVP
          watch for a text property being assigned before the text string is loaded.
          • 2. Re: Intermittant "Undefined" error in dynamic text field
            TPK Level 1
            Hi kglad,

            Thank you for the note. I have gone over the Actionscript and can find no obvious flaw. Can you tell me how a property might be assigned before the text is loaded? Could network traffic affect this?

            I did some tests during peak usage times.

            The tests of the project seem to indicate that once the error was encountered and the content reloaded (keeping the same session) that the error would not reoccur. Closing the session and browser and er-entering resulted in no error.

            However, closing the session then deleting cookies and/or temporary internet files then starting a new session caused the problem to reoccur. I could delete just the cookies and the problem would reoccur. I could delete just the temporary internet files and the problem would reoccur.

            Again, the error, when it does occur, seems to affect some text fields more than others and never consistantly. Its a moving target.

            Thank you for your earlier clue.

            Tim
            • 3. Re: Intermittant "Undefined" error in dynamic text field
              kglad Adobe Community Professional & MVP
              that's almost certainly an asynchronous error caused by assigning the text string before it's loaded. for example:

              lv.loadVars("text.txt");
              tf.text = lv.var1; // where var1 is defined in text.txt will always fail unless text.txt is in the user's cache.