-
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.
-
Senior Member
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 ).
-
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.
-
Senior Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|