PDA

View Full Version : Dynamic Text - Path problem?


bill1964
10-17-2002, 03:12 PM
I am putting together a site with 6 swf's. All files work correctly when loaded on their own.
I have a main swf with an empty movie clip on stage into which the other swf's are loaded - which file depending on which button pressed.
Everything loads up fine EXCEPT my dynamic text. I am truly lost as to why this is.
I have attached some files to demonstarte the problem. The file theText if run on its own loads the dynamic text. But when that file is loaded into a movie clip in theHolder - no dynamic text. If anyone can show me how to get this simple problem solved I can deal with my more complex swf's.
I have tried everything - this is driving me nuts.

spazmaster
10-17-2002, 05:03 PM
hey.

i got it working by using LoadVars and dumping loadVariablesNum
really weird, though. i'd like to know why what i did worked.

in theText.fla use this code:

//give your dynamic textfield the instance name tf
tmp = new LoadVars ();
tmp.load("text.txt")
tmp.onLoad = function() {
tf.variable = "_root.tmp.textbox"
}


in theHolder.fla use this actionscript


//the LoadVars need sthe same name here or else it wont work
tmp = new LoadVars();
tmp.load("text.txt");
tmp.onLoad = function() {
loadMovie("theText.swf", _root.movie2);
};


its seems like a real detour, coz i had to load in the text.txt file twice now.
but thats the only way how it got it to work.

the problem is that theHolder loads in the theText.swf before it has been able to load in its text file dynamically. i think ;)
(now we give the text file to the LoadVars object so that when it loads in the swf the textfile is already loaded in)

bill1964
10-19-2002, 12:10 AM
thanks for that answer - tried it and it works.
For interest I found another answer.

In the file with the dynamic text box place the dynamic text inside a movie clip and load it with

LoadVariables("text.txt","_root.movie2.clipname") with clipname the instance name of the movie clip

Then the dynamic text will not load into the file if loaded on its own but WILL load into the file with a container clip 'movie2'.