Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
Subject: | Re: FLASH: array trouble - final. really! |
From: | Helen Triolo |
Date: | Wed, 20 Dec 2000 17:09:22 GMT |
And some days, I just shouldn't send any email at all, because my brain
just goes too slow. ;-) The code in that last message is just dumping
one array into another. You already have an array, once you've read the
variables in. (doh!)
If you do loadVariablesNum("yourtext.txt",0) then they'll be accessible
as _root["soundpress"+i], as mentioned below.
If you read them into a separate movieclip (which provides the
additional benefit of being able to check for variables loaded with the
onClipEvent(data) routine instead of the 2-frame loop mentioned
previously), with eg, LoadVariables("yourtext.txt","varclip"), you
should be able to access them with _root.varclip["soundpress"+i]. So
you don't even need to create an extra array either way.
Well, from those 3 messages, I hope you will get something that works.
Let us know.
Regards,
Helen
-----------------------------------------------------
i-Technica � http://i-technica.com � 301.424.6037
developer resources: http://i-technica.com/whitestuff
Helen Triolo wrote:
>
> Yes, that's what I was saying. But thinking about it a bit more, I
> think my idea isn't so great. Flash may barf on such a big string for
> one variable, and the split method is really slow. Probably your
> original way is better, using a text file with
> soundpress0=55555&soundpress1=44444&...soundpress899=33333.
>
> Then after you've read in the 900 variables, you could put them into an
> array with
>
> aSounds = new Array(900);
> for (i=0; i<900; i++) {
> aSounds[i] = _root["soundpress"+i];
> }
>
> You would still access the array elements as aSounds[thiselement].
>
> Regards,
> Helen
>
> Ruben Mafura wrote:
> >
> > ..So waht you say is,...import the complete string of values and place it
> > into an array, number by numer, using the split-property?
> >
> > Very refreshing idea!,...i've experimenting with the old textfile setup for
> > quite some time.
> > I'll give it a try.
> >
> > ManY ManY ThenX!!!
> > I'll let you know when i get it to work.
> >
> > GreetingZ
> > RuupY
> >
> > -----Original Message-----
> > From: Helen Triolo [designeri-technica [dot] com (mailto:designeri-technica [dot] com)]
> > Sent: Wednesday, December 20, 2000 4:12 PM
> > To: flasherchinwag [dot] com
> > Subject: Re: FLASH: array trouble
> >
> > RuupY,
> >
> > You could make this easier with a text file with these contents:
> >
> > soundpress=12034,13501,etc
> >
> > and then after you do LoadVariables on the text file (and make sure the
> > variable has loaded by adding a 2-frame loop to cycle until soundpress
> > ne ""), you'll have a string variable named soundpress, which you can
> > turn into an array with:
> >
> > aSounds = soundpress.split(",");
> >
> > To reference an element of the array, you'd just use
> > aSounds[thiselement] (which will be something like 13501). Does that
> > give you what you need?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and the Flash(tm) Film Festival
November 27-29, 2000, LONDON, National Film Theatre
Produced by United Digital Artists and lynda.com
-Sponsored by Macromedia, Adobe Systems and Apple Computer
-http://www.flashforward2000.com or UK tel. +44 (0870) 751 1526
Register before November 10 and save �200
http:// www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpchinwag [dot] com
Replies
FLASH: Labyrinth game, Bert Deyaert
Replies
RE: FLASH: array trouble, Ruben Mafura
Re: FLASH: array trouble, Helen Triolo
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]