PDA

View Full Version : >>>>>>> Check it out this Problem <<<<<<<<<


rock22k
07-26-2001, 11:14 AM
Hi to all,

Problem :I have an problem with the array.

I have one text file with following array vairables:

abc.txt
=================


name[1]=Rock&comment[1]=something
&name[2]=Rick&comment[2]=nothing

===================

Now i wann to do one thing that

i have the two dynamic text box with variables <name> and <comment> now whats the prblem that i load the file with
loadvariables("abc.txt",0).


Now i put the button in frame
and give the action OnRealse on button

Now what i have to do that i wann to display or load each name and comment from abc.txt file to those two dynamic text box when user pressing button or release the button.

I put the action but everytime i got name and comment undefined.



Thats all can anyone help me or give me the code for that.

Jesse
07-29-2001, 02:51 AM
If you want to load in an array use this method:
myArray=elem1|elem2|elem3|elem4...
put that in 'file.txt' or whatever, then load it using loadvariables, wait for it to load and then use the string.split() method to make it into an array:
myArray = myArray.split("|");

rock22k
07-29-2001, 08:14 AM
Hey i got ur code its working now i m able to get the array but still the problem that i wann to assign each array element to my one dynamic text box one bye one when user pressing the button..


Thats still problem so can u solve it.

Plz

Thx for ur code waiting for ur reply.

Jesse
07-29-2001, 08:49 AM
what are the names of your text boxes? how do you determine which value to assign to each box?

rock22k
07-29-2001, 09:34 AM
I have a text box variable name is testname

And array txt file like

name[1]=ritesh&name[2]=rick

Now i put the text in last frame of my movie when user press the button my text box will load the name one bye one

Thats it.

Jesse
07-29-2001, 10:31 AM
huh? so you want the text box to show "ritesh" then wait, then show "rick", then wait... ?

rock22k
07-29-2001, 11:21 AM
Ok i m waiting for u r code.

I hope u can do it.


Waiting...........

Bye

I having still prblm yet.

Jesse
07-30-2001, 07:39 AM
is that what you wanted to do? my post above was a question.... are you trying to achieve that effect?

rock22k
07-30-2001, 07:48 AM
Yes jesse u r right i wann to achive that effect but not yet.

So now ....help.plz.

Bye

Jesse
07-30-2001, 08:14 AM
load and split your array as I mentioned above then use the Timered Events tutorial. Each time your time delay is up, incriment a counter variable 'j' by 1, then set the textfield to array[j]

rock22k
07-30-2001, 08:20 AM
Sorry can't get the idea can u give me the tutorial link or code for that its better.

Jesse
07-30-2001, 08:31 AM
cmon mate, help yourself out a bit, surely you can find the tutorial in the tutorials section:
http://www.actionscripts.org/tutorials/intermediate/timer_controlled_events/index.shtml