A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: End a variable?

  1. #1
    Senior Member
    Join Date
    Apr 2001
    i want to stop or end a variable. I have an input box (name) I have it save the variable to a txt file. I want to be able to pull up that variable again from the txt file. I noticed that it loads the variable from the name as well as the txt file. So i dont want it to read the name variable in the movie just the .txt file.
    Any help would be apriciated.
    I have:
    frame 1: input box (input)
    button: on (release) {
    fscommand ("save", "c:/new folder/Amex/new folder/cool.txt");
    Then I have another button to load the txt back to a dynamic txt box(output)on (press){
    Frame 15: load loadVariablesNum ("./cool.txt", 0);
    Frame 16: if (text ne"")gotoAndPlay(19);
    Frame 17: gotoAndPlay(16);
    Frame 18: output=input; This is the problem I want the output to come from the txt file not the movie. How can I end that variable. I thought in the {} made it local. Does local mean that its anywhere in the timeline on the main stage?

  2. #2
    Stupid Little Dreamer
    Join Date
    Aug 2000
    For one thing, variables are only local if you call them var a, var my_temp_counter, etc. I haven't fiddled with var's much, but Flash's help file seems to indicate that this will only work to keep a variable local when it's called inside a function. So I don't know if adding var to a button script would keep it from being global.

    Now I haven't had cause to save a variable, then load it all within the same movie. But I believe that, as soon as you load variables, whatever previous value it had is replaced with the new, loaded value. Meaning you don't have to 'delete' it prior to loading.

    Hope this helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center