Hi people I’m having a problem loading an external txt file into my movie from a different scene… I have got the text file to load in with no problem on scean 1 but if I copy the code etc to scene 2 it does not work
Okay this is what I have got on scene 1…
a. text field with the var: textbox
b. a blank movie clip that loads an external button with the following code appended to it…
c. this script on the first frame before the buttons are loaded… message = “”; (This script sets message to have no value)
d. And finally on the externally loaded button is the following code…
on (release) {
loadVariables(“pro/pro1.txt”, “_parent”);
}
Must I point the script to go to scene 2? If so how do I do this?
If anyone wants to see the source files just email me…
Please not mate the the following files = sample.txt, pro1.txt, pro1.swf and pro1.fla belong in a folder called ‘pro’ just so that the path’s are still okay you will also notice that the main file kicks up some errors when you preview it - thats because it can’t find all the external files. I’ve just attached one. Also buddy could you possably cast your eye over why the scroll bar is not working within the text field?
Hi claudio yes mate it does help! Thx! The Scroll bar is working a treat now! Yet I still have the problem when the movie loads and you click on the ‘crow button’ the text appears - yet when you click on the ‘graphic design’ button then click on the crow button the text does not appear??? ;( I can’t figure out why that’s happening?
It’s just the same text file mate - the problem is that I can’t get it to load when you hit the button within scene 2? Scene 1 and 2 are basically the same other than scene 1 has the animation on it…
Ok, now all buttons launch the same txt file. You need to correct the mask over the textbox and also the code on the scrollbar. Use the same code as i used on scene1 scrolbar.
Just to check mate… So the changes that you have made are mainly to the botton…
function loadText() {
loadTexts = new loadVars();
loadTexts.load(“pro/pro1.txt”);
loadTexts.onLoad = function(success) {
if (success) {
_root.textBox.text = this.message;
} else {
_root.textBox.text = “Error loading data”;
}
};
}
On my main movie there will be several different buttons loading on the various scenes ‘1 to 6’ if I change the text file name on the above code it will load the different text file into the text box depening on what button I press.
Many Thanks for your help on this one - Its really been doing my head in.
Okay when the page first loads I need a text file pro_over.txt to be loaded in the text field where it currently says “_level0.textBox”.
Then when you click on any of the two buttons (there will be five total) I need the first button to load pro1.txt and the second button to load pro2.txt into the text field. As it stands if you click on button 2 the text loads fine yet button 1 will then not work and vice versa.
Hope you understand and can help as I’m in a desperate rush to get this done.
Many Thanks,
dEVS!
P.S. I’ve uploaded the zipped files to here again…
When the movie first loads I need the text file pro_over.txt to be loaded automatically into the text box.
Then when you click on the “number 2” button I need the text to change to pro2.txt and if you were to hit the first button I need it to change the text to pro1.txt.