-
[F8] Dynamic Text loading a .txt file
I have two different .fla's. In one, loading the .txt file works great, in the other, it doesn't work for some reason. Both of them have this coding
Code:
loadVariables("text.txt", "_root");
textbox.text = text1;
While in the .txt file it says
Code:
&text1 = Howdy Howdy Howdy
The only difference is that in the .fla that DOES work, the code
Code:
loadVariables("text.txt", "_root");
is in a scene titled load, with the code
Code:
textbox.text = text1;
is in a scene titled main.
The flash that does NOT work has the code
Code:
loadVariables("text.txt", "_root");
textbox.text = text1;
on the same keyframe. Is there a way to make this work without using other scenes. Here is the .fla and .txt to the broken one.
txt&fla.zip
Any and all help would be very much appreciated.
-
FK'n_dog
use a LoadVars object.
the onLoad function executes when the data has completed loading.
PHP Code:
lv = new LoadVars();
lv.load("text.txt"); // &text1 = Howdy Howdy Howdy&
lv.onLoad = function(){
_root.textbox.text = this.text1;
};
-
Ah, that makes a ton of sense now. I get what you mean by using a LoadVars object, and I have replaced my coding in the broken .fla with the one that you posted, and even fiddled around with it... but it doesn't work for some reason, still comes up undefined.
I am wondering if it might be where I am placing my action script... The way the .fla has it set up is how I would like to do it, very simple like, could that be the problem?
-
FK'n_dog
file attached. hope it helps
Last edited by a_modified_dog; 01-11-2008 at 03:21 PM.
-
Perfect Thx a ton for all the help.
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
|