PDA

View Full Version : problem reading txt files


samifox
06-18-2007, 10:49 PM
Hi,

i load a txt file in pc and I access it by variables only the first line is accessed and really load into the text. Any idea why?


Thanks
S

Cota
06-18-2007, 11:57 PM
Are there "&"s in the text? That will cause a break in the text, as flash see's the "&" as a new variable.

atomic
06-19-2007, 01:27 AM
Or is the textfield set to Mutiline?

samifox
06-19-2007, 06:45 AM
loadVariables("mytext.txt",_root);

in the text file :

var=some hebrew words

no there is no &.

i try single and multilne, its not that.

the text file saved in notepad, and in uncode format since the language is Hebrew, maybe its a new direction for thoughts? ;)

alexandre_lab
06-19-2007, 06:50 AM
what is the code you use to load the txt?

samifox
06-19-2007, 07:11 AM
It’s a gallery , each button has this code :

on (press){
_root.alphax=1
_root.bigpic.loadMovie(_root.p_arr[1])
loadVariables("mytext.txt",_root);
}

the text box has vars names

author=blabb la bla
apps=blabb la bla
des=blabb la bla

the txt file is :

author=שי גאג
des=,תמונת שטח
des=תמונת תלת מימד של הבדהה מזהב,הדגמה ראליסטת של זהב

Only the “author” is showen on the stage when I click the button , the other links are left empty.

Thanks
S

alexandre_lab
06-19-2007, 07:20 AM
in your text file, you must link each variable/value declaration next to each other via the &

author=me&foo=bar&woman=beautiful

samifox
06-19-2007, 08:19 AM
in your text file, you must link each variable/value declaration next to each other via the &

author=me&foo=bar&woman=beautiful

yakkk:( :( :(

is this the only way? i want it to be in tablet fasion so i can maintain it.

Shay

alexandre_lab
06-19-2007, 08:25 AM
with text files, yes it is the only way. For more intelligent data structure, use xml. (tutorial here (http://www.kirupa.com/web/xml/XMLwithFlash3.htm)).

samifox
06-19-2007, 09:45 AM
with text files, yes it is the only way. For more intelligent data structure, use xml. (tutorial here (http://www.kirupa.com/web/xml/XMLwithFlash3.htm)).

Hi….after reading the tutorial you gave me….i made a little thinking….i have only 4 variables and deadline that going to hunt me. So ill stay with the yak text ;)

In the same matter, I want to use component , a ScrollPane , what I did is :

1. created a text, convert it into a movie clip and name it. than in the library > Linkage , I check the export to AC checkbox.
2. draw a component, go to its parameters and change the path to the movie clip’s name.

everything is fine by now but the problem is that I want the text to be loaded into the component from external txt file.

How can I do it?

Thanks
S