Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Joining text files

Status
Not open for further replies.

nochoice

Programmer
Joined
Jun 17, 2003
Messages
72
Location
CA
I want to create an interface that allows me to check checkboxes and compile many pieces (files) of documention into one file. The checkboxes are simply the headings (intro, section1, section2, ......) of the documentation.

After checking the checkbox I want to click a button 'Complie',for example, and have all my files merged into 1 big file.

Before I make the UI, is there a way for me to merge 2 text files (in html format) into 1 file?
 
compile_btn.onRelease = function(){
//if checked
mytextbox.text += something;
//if checked
mytextbox.text += something else;
}
 
does this mean I should load the File as a variable and just combine the variables?

If so, how do I do I load an entire file into a variable?
I also don't know how to write to files.

Thanks,

nochoice
 
have text file like this

&intro=blahblah&
&section1=zzzzzzzzzzzzzzz&
&section2=aaaaaaaaaa&

until you have all the data in the text file


then in flash

lv = new LoadVars(){
lv.onload = function(){
intro = lv.intro;
section1 = lv.section1;
//and so on
}
lv.load("myfile.txt");

compile_btn.onRelease = function(){
//if intro checked
mytextbox.text += intro + newline;
//if section 1 checked
mytextbox.text += section1 + newline;
// etc etc
}
 
I'm not trying to load a variable file, I'm trying to load HTML source files.

I can't re-work hundreds of files to add the & at the beginning and end of every line and make a variable.

Also, once I have loaded this file into flash, is there a way to write it to another file, here's the breakdown:

-I check section 1 and section 2 check boxes
-I click the compile button
-Flash loads section1.html and section2.html
-Flash merges section1.html and section2.html into compiled.html
-Flash writes compiled.html to my drive

I hope this clarifies my question,
thanks again,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top