A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: multiple variable in text file

  1. #1
    Member
    Join Date
    Dec 2002
    Location
    MI, USA
    Posts
    39

    multiple variable in text file

    Hi. I'm having an issue creating a working file that loads an external text file that contains multiple variables and viewing them using different buttons.
    The issue is not with the text file or the loading of the variables, but with the buttons and the variable text not displaying on rollover and I'm not sure why.

    Text file:
    The text file is named quotes.txt and contains 6 varible quotes in form quote1=blah&quote2=blah&quote3....

    The actionscript for loading:
    myData = new LoadVars()
    myData.load("quotes.txt")
    myData.onLoad = function(succes){
    if(succes){
    quote1_txt.text = this.quote1;
    quote2_txt.text = this.quote2;
    quote3_txt.text = this.quote3;
    quote4_txt.text = this.quote4;
    quote5_txt.text = this.quote5;
    quote6_txt.text = this.quote6;
    } else trace ("Error loading data")
    }

    The button setup:
    There are 6 buttons with the following code"
    on (rollOver) {
    this.gotoAndPlay("quote_1");
    }

    on (rollOut) {
    this.gotoAndPlay("start");
    }

    where quote_1 is a frame label. The frame has a dynamic text box with a name of quote1_txt. Etc, etc. The thing is, when I place and of the dynamic text boxes in the first frame of the movie (in other words not activated by using the buttons to go to specific frames) the variable text displays fine. But when going to the different frames the text won't display at all.
    I hope I am not being confusing in how I'm describing this. Any help is appreciated.
    Thanks.

  2. #2
    Member
    Join Date
    Dec 2002
    Location
    MI, USA
    Posts
    39
    hi, ummm, anyone?

  3. #3
    Multitouch Aficionado
    Join Date
    Mar 2006
    Posts
    275
    -Success is misspelled.

    -Adding 'hi, umm, anyone?' to your thread only hurts your chances of getting a reply. You all of a sudden have a reply in the main thread, and people look to help other people with no replies.

    -This is AS2 in the AS3 forum.

    I'm guessing if it works on one frame and not others, you have a scoping issue.

  4. #4
    Member
    Join Date
    Dec 2002
    Location
    MI, USA
    Posts
    39
    Thanks for responding. Changed success to correct spelling, but didn't solve the issue. I'm using Flash CS3, what's the difference between AS2 and AS3?
    What's a scoping issue?

  5. #5
    Member
    Join Date
    Dec 2002
    Location
    MI, USA
    Posts
    39
    nevermind, figured it out.

  6. #6
    Multitouch Aficionado
    Join Date
    Mar 2006
    Posts
    275
    You can call a variable whatever you like (incl. succes), as long as it's consistent.

    ActionScript 2 is the scripting language predominantly used in Flash 2004 and 8. If you are using CS3 and starting from scratch, you should probably be using ActionScript 3 (which is much faster and cleaner than AS2).

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