A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: AS - loading ext. text files

  1. #1
    Member
    Join Date
    Jul 2002
    Location
    Corpus Christi, TX
    Posts
    82

    AS - loading ext. text files

    Hey,

    I want to load up 3 text files (by buttons) that change 2 dynamic text boxes, one localeText (tells you where you are) and myText (message) and in the buttons I have:

    Code:
    on (release) {
    		_level0.instance8.myLC.loadVariables("var1.txt",0);
    		_level0.instance8.myMC.loadVariables("var1.txt",0);
    }
    and on each of the extra buttons the loadVariable changes to var2.txt and so on.

    But... It does not work.

    The 2 DTBs are not in the same layers, but are still in the same instance. myLC and myMC are instance names, should I change them, put on them on the same layer, etc.

    I just need help - think you can help me out?

    Thanks if you can.

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    You are specifying a level in your code, you only do that with loadMovieNum.

    on (release) {
    _level0.instance8.myLC.loadVariables("var1.txt");
    _level0.instance8.myMC.loadVariables("var1.txt");
    }

    It seems like you will get a lot of textfiles when you probably could use kust one and load it into just one place ( and then distribute them to where thy should go with your buttons ).

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #3
    Member
    Join Date
    Jul 2002
    Location
    Corpus Christi, TX
    Posts
    82
    and how would i do that?

    btw - you just copied my text, was this intentional? My level of expertise with Flash MX isn't too great - I just started using MX instead of 5 about a month ago - think you can elaborate?

    Thanks.

  4. #4
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    I didnt copy it, I took away the ,0 in two lines as they are indicating a _level. And you are loading into a movieclip target.

    If you load all variables into the main timeline (_root ) you can have a button send the values into any textfield anywhere. For instance...

    on(release)}
    instance8.myLC.textfield=myVariable1;
    {

    This would send the value of myVariable 1 to a textfield called textfield in movieclip myLC, that is inside instance8 which is located on the main timeline.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

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