Loading arrays

hi guys,

i have an array called picdata[x]

it contains 3 rows of data

each row contains 5 pieces of information.

is it possible for me to load this data from an external text file?

(i eventually want lots of rows containing about 10 items each and the text file seems the easiest way to edit it0

thanx in advance

Gary

PLZ NEVER CROSSPOST, members will be annoyed if they saw a duplicated thread!!!

what about having ur code outside the movie using “#include”.

yours,

hey h88, you didn’t know it but you knocked my senses in the right direction and helped me a lot with that.

I was building a menu thing that I was hoping to easily update, and I can’t seem to parse the XML right since I don’t know too much about it.

I was using loadVars to do it, and it was coming along semi-good, but you just reminded me of the #include and it gave me a whole new idea. #include flew right over my head, I know what it is and how to use it, just never thought of it… 'doh!

Thank You :slight_smile:

hehe, cool!

It is very cool, it is already making my task easier :slight_smile:

sorry bout the xpost guys, but i had really fixed the problems i had in the other post. so thought it would be ok to start a new one.

(wifey has spanked my bottom on your behalf. sent me to lookk at html sites for 30 mins too!!! how cruel can women be eh!!)

thanx for the #include thing (not that i have any idea what it is or what it does but hey off i go on the learning roller coaster for another spin)

cheers guys

Gary

if u want to edit ur array directlly from the textfile, just put up this code!

#include  "arrayactionscript.as"

and then create a text file with .as extention.

very simple!

yours,

lmao

in the time since my last post i went off to “learn”

well that was difficult then, learned, tested, perfection

thank you ever so much guys, cant believe it was that simple to accomplish

again thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you

(oh but i ignored the .as extension and just left .txt seems to work fine)

(just a note to the kirupa…not a single response to the same question on flashkit…does that mean evry1 is smarter here? lol)

Gary_happily loading arrays from a text file like a madman_bydesign

hehe, r u satisfied now?

glad to be!

yours,

h88

btw, .as is the recommended file extension.

just in from work,

thanx for the info it will be .as from now on then

and no i am not satisfied (but you show me a flash user who is totally satisfied with their work!!)

lol thanx soooooooooooooooooooooooooooooooooooooooo

much for your help, it really is greatly appreciated.

Gary_most humbly_bydesign

y arent u satisfied:cowboy:

no no i am satisfied with the point of this post and like i said i am most grateful,

the comment was on “flashing” in general…lol

now i can load this stuff (did i say thanx enough yet…grin) i gotta work out how i can search it and display the results.

another night another mountain to climb, some days i feel like the woman in the sound of music (oops showing my age there lolol)

(see, us 5 week flash newbies have a real steep learning curve)

gary_very happy to close this thread as i got all that i needed _bydesign

Can u plz post your fla and maybe the .as file ? Just to check out your way of work. I’m trying to do the same but i’m having some little problems

Thankz

Can u plz post your fla and maybe the .as file ? Just to check out your way of work. I’m trying to do the same but i’m having some little problems

Thankz

you will, need some images too either named the same as mine or edit the text file with your own picture names.

one other point i am using 2 variables for my next and prev buttons, make sure you change the values, ie number of lines in your text file or the buttons wont work correctly.

there is one other variable to change, but i cant remember where…lol in the main acrionscript some place. just be sure to change x,y, and z.

any probs mail me direct at

gaziz40@ntlworld.com

(and dont get too “involved” b4 asking for help. i made this page from 3 different tutorials, i will point you to them if you need them.

the text file is still .txt, it should be .as (i am told) so change it if you like (dont forget to change the a/s '#include statement if you do

Gary

sorry guys, #include is not dynamic, if u changed the txtfile command in the textfile, the swf file wont be updated, unless u recreate the swf from the main fla :(!!

am experimenting the solution for u gary_bydesign, so dun worry, ull get wut u need, just hang on a sec.

yours,

h88

okay, solution:

textfilecontent = &picDataTemp=pic1,pic2,pic3&
then load that in and then add:
picdata = picDataTemp.split(",");
and picdata is an array with 3 elements! :slight_smile:

yours,

h88

@lostinbeta : want me to help u about ur dynamic menu, post some description :)!

yours,

h88