3 Replies Latest reply on May 29, 2006 8:59 PM by Newsgroup_User

    Beginner coder

      I'm begining to code with AS. I'm using a FlashMX AS book to learn with Flash 8. Will that cause a problem?
      In my textbook, it has a simple code to load up an external .txt file onto a dynamic text field.

      -The .txt file (with MS Notepad): &electricBill=60
      -.txt file saved as: Electric_Bill.txt
      -saved in the same folder as the .fla file that is being used.

      -the text field instance name: owed

      -code inserted on frame 1 of the actions layer.
      -the code to load up the .txt file: loadVariablesNum ("Electric_Bill.txt", 0)

      When I Cntrl+ENTER to see how it runs, it doesn't show anything in the text field.
      There's a lightbulb that turns on and shines according to how much someone pays their bill. If underpaid, the light doesn't turn on. If paid in full, the light turns on. If overpaid, the light bulb shines very bright. But when I run it, the "owed" text field shows nothing (it suppose to show 60). The movie doesn't work at all.

      Though, when I make the text field = 60 by typing 60 into the text field and then run it...it works respectively to the dynamic text input. Underpaid, paid in full, and overpaid works fine.

      What I would like to know is, am I typing the right code, saving the file in the right place, does MX scripting work with Flash 8.

      Thank you in advance.
        • 1. Re: Beginner coder
          Of course, it does.

          Make sure that you're loading the varibales in the right direction (right there where the textfield is).
          Im not sure if you can load external data into a static textfield -as far as i know only "dynamic" and "input" types will work fine.
          • 2. Beginner coder
            Methallico Level 1
            Thanx animee for your response. I actually found my problem. I wrote down: owed.txt rather than owed.text. Man, this coding business is going to be an adventure! ^ ^
            • 3. Re: Beginner coder
              Level 7
              Some code from Flash MX will not work if you want to publish with AS 2,
              and many things have been deprecated - i.e. replaced with something much
              better and/or more streamlined. Just IMO, get an ActionScript 2 or
              Flash 8 book instead.

              animee wrote:
              > Of course, it does.