Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: RE: FLASH: array trouble - final. really!
From: Paul Willoughby
Date: Wed, 20 Dec 2000 17:40:01 GMT

Hi Helen,

I've just been following this thread as I'm trying to get my head round
a similar sort of thing.
But I don't quite understand this 'final' solution. I understand that
the loaded variables can be accessed with the array syntax, but if you
do it look this is there any way you can still use array methods (like
array.pop, array.join). Surely you'd have to use your previous
suggestion of creating a new array object before you could use those
methods on the array???

regards

confused paul


Helen Triolo wrote on 20 December 2000:

> 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.


> Helen Triolo wrote a bit earlier:
> >
> > 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
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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 helpatchinwag [dot] com


Replies
  Re: FLASH: array trouble - final. reall, Helen Triolo

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]