Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
Subject: | Re: FLASH: string functions? |
From: | olga |
Date: | Thu, 18 Jan 2001 22:54:22 GMT |
I started out with a string variable-- but the user can also drag the mcs
_out_ of the area, and the lines of associated text are removed. I tried to
remove the lines by searching the string with a substring loop, but it was a
bit messy and inaccurate.
I will look up substr method-- thanks for the tip!!
Olga
----- Original Message -----
From: "Helen Triolo" <designeri-technica [dot] com>
To: <flasherchinwag [dot] com>
Sent: Thursday, January 18, 2001 2:26 PM
Subject: Re: FLASH: string functions?
> Olga,
>
> Could you just append the mc contents to a string variable instead of
> building an array? (and then dump the variable to the text file when
> done) It seems archaic to do it that way I know, but all the string
> manipulation functions in Flash are so slow that a plain old append (x =
> x + new_content) might turn out to be best. You wouldn't have the
> commas to get rid of then. If you want to stick with array/string
> manipulations, at least you could substitute the substr function for the
> substr method -- it's faster even though deprecated. ;-)
>
> Regards,
> Helen
> -----------------------------------------------------
> i-Technica � http://i-technica.com � 301.424.6037
> developer resources: http://i-technica.com/whitestuff
>
> olgatwitchy [dot] com wrote:
> >
> > This works wonderfully-- the only problem is that this is an event that
> > updates often, and it's bogging down the movie A LOT.
> >
> > What is happening:: user drags mc unto an area. mc triggers addition of
> > item into an array. array prints into a text file (it reads like a
story,
> > so the commas are removed).
> >
> > Every time I drop the mc unto the target area the whole movie freezes
for a
> > second.
> >
> > Is there a less processor intensive (fast?) way of doing this?
> >
> > Thanks so much!!
> > Olga
> >
> > ----- Original Message -----
> > From: "Phillip Kerman" <flash5teleport [dot] com>
> > To: <flasherchinwag [dot] com>
> > Sent: Thursday, January 18, 2001 1:31 PM
> > Subject: RE: FLASH: string functions?
> >
> > > I don't know if this is the easiest... but it's one way I use in my
> > upcoming
> > > book "ActionScripting in Flash":
> > >
> > > function removeCharacter (whatChar,fromString) {
> > > var charFound=1
> > >
> > > while (true) {
> > >
> > > charFound = fromString.indexOf(whatChar);
> > > if (charFound == -1) {
> > > return fromString;
> > > }
> > > fromString
=fromString.substr(0,charFound)+fromString.substr(charFound+1);
> > >
> > > }
> > > }
> > >
> > >
> > > // to use removeCharacter(",","the,string,with commas"));
> > >
> > > > -----Original Message-----
> > > > From: ownerchinwag [dot] com [ownerchinwag [dot] com]On">mailto:ownerchinwag [dot] com]On Behalf Of
> > > > olgatwitchy [dot] com
> > > > Sent: Thursday, January 18, 2001 1:04 PM
> > > > To: flasherchinwag [dot] com
> > > > Subject: FLASH: string functions?
> > > >
> > > >
> > > > What's the easiest way to remove a repeated character from a string?
> > > >
> > > > I have a string with repeating commas that I need to extract:
> > > >
> > > > "the dog, is blue, on saturdays, and sundays."
> > > >
> > > > to:" the dog is blue on saturdays and sundays."
> > > >
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 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
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
RE: FLASH: string functions?, Phillip Kerman
Re: FLASH: string functions?, olga
Re: FLASH: string functions?, Helen Triolo
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]