View Full Version : linking to dynamic text field??
okay so. i have 10 squares going horizontally across my page as a menu and below them i have a dynamic text field and i have it so that when the page loads theres the text for the main page in the text box.
what i'm wondering how to do is when you click on one of the buttons, how i could make it so the .txt file loaded in the text box disappears and is replaced by a different txt file?
i know that for basic buttons you use a getURL and you specify the target and address.
i tried doing that to see if it would load in the text box but it only loads the txt file in a new window no matter what i specify the target as. anyone know how i could fix this?
Billy T
01-31-2003, 02:22 AM
check out the LoadVars tute
you would use something like
myTextData=new LoadVars();
myTextData.onLoad=function(ok){
if(ok){
theTextBox.text=myTextData.varName;
}else{
trace("damn");
}
}
myTextData.load("first.txt");
then your buttons can just say
on(release){
myTextData.load("whatever.txt");
}
cheers
ehh? i'm sorry but i dont really have any programming experience so i'm trying really hard to understand what i'm supposed to do.
what i had before to bring the txt file up on loading is
loadVariables("home.txt", "holder");
but after that i'm clueless x___X;;
Billy T
01-31-2003, 02:51 AM
ok so put that on all your buttons
the thing is.. i can get it to work on a blank file. but when i try to apply it to my movie it wont work.. i have no clue what i'm doing wrong
Billy T
01-31-2003, 03:59 AM
Originally posted by K33N
the thing is.. i can get it to work on a blank file. but when i try to apply it to my movie it wont work.. i have no clue what i'm doing wrong
I see...are your buttons inside another mc?
you need to provide more info or upload the file
cheers
god.
of course it'd help if i had the font on a color so i could see it when it's loading. i got it now. thanks for your help.
Billy T
01-31-2003, 04:05 AM
LOL
cool :p
uhmm this is horrible. i got the buttons working. so the content comes up when you cloick on them.. but now the problem is when i load the page there's nothing intitially in the text box o-x; this is what i did..
the buttons were named instances like b1, b2, b3 etc.
and then i took the script
b1.onRelease = function() {
loadVariablesNum("info.txt", 0);
};
and did that for all ten of the buttons. but it got rid of the initial script that loaded the .txt file when the movie comes up.. the code for that that i initially had was
loadVariables("home.txt", "holder");
where holder was the instance name for the text box. but it doesnt work anymore with the rest of the script ?
Billy T
01-31-2003, 04:29 AM
ok so your buttons load the text into level 0 and the initial script loads the text in the holder mc
where is the text box?
if the buttons work then I'm guessing its in _level0 so change the initial script to
loadVariablesNum("home.txt", 0);
cheers
wow i didn't even think of that. THANK YOU THANK YOU THANK YOU. o-o; done finally
Billy T
01-31-2003, 04:36 AM
cool
okay i've thought of a few other problems i have in this setup.
i want txt files to be loaded into the dynamic text field of the movie. but there are two things i've been wondering about since i've got that working.
1. i know you're able to link to other websites and files in the txt file, but is there any way that i can link to another text file that will be brought up in the same dynamic text field without usining all the actionscript?
to put it more simply. i have the text box. within the text box is a text file that is loaded into the box via the buttons. and i want to link to another txt file to be brought up into the text box by linking to it in the txt file.
and 2. is it possible to link to a popup window in one of the txt files?
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.