all groups > flash actionscript > may 2006 >
You're in the

flash actionscript

group:

Beginner coder


Beginner coder Methallico
5/29/2006 11:10:34 PM
flash actionscript:
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
static 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.
Re: Beginner coder animee
5/29/2006 11:37:45 PM
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.
Re: Beginner coder Methallico
5/29/2006 11:51:25 PM
Re: Beginner coder ImagicDigital
5/29/2006 11:59:57 PM
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.

[quoted text, click to view]
AddThis Social Bookmark Button