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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to load variables from textfile into Array?

Status
Not open for further replies.

aribert888

Programmer
Jan 12, 2003
11
DE
My array is loading images and it does. It is situated on the timeline:

_root.num=0;
_root.arrayname=new Array(‘image1’,’image2’,’image3’);

Instead of feeding the array with these variables I have created a textfield from which the ar-ray should get its variables.

It is called: ‘text1.txt’

As the textfield contains the variables I wrote in it:

num.field1=’image1’,’image2,’image3’

Now I tried everything to make the array get its variables from the textfield, but it does not work.

For instance I tried:

situating the script on the holder:

onClipEvent(enterFrame){
_root.loadVariables('tex1.txt',0);
_root.code=_root.num.field1;
}

and situating the script on the timeline:

_root.num=0;
_root.arrayname=new Array(code);

This as well as other scripts I tried don’t work.
I would be very glad if somebody would help me with a solution.

Aribert


 
code ought to be on main timeline and textfile should be like

&var1=image1&
&var2=image2&

or and vars=image1,image2, etc and then use split to get them into an array.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top