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 23:10:06 GMT

Here is the code on the first frame of the movie:
---------
start = "This is how it begins. ";
tell = "This is our story.";
us = "We are the storytellers. You and I. ";
a = "No story is written alone. ";
story = "Our story is built on the stories of a thousand people before us.
";
StoryItems = new Array(start);
_root.volume = StoryItems.toString();
;
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);
}
}
----------
Every time an mc is dropped or removed, it adds or removes an item from the
StoryItems array, and the following is executed:
_root.volume = _root.StoryItems.toString();
_root.volume = _root.removeCharacter(",", _root.volume);

Originally, it was just performing it on the array, and it refused to run--
nearly crashed flash. Performing it on the array generated string appears
to be faster, but not fast enough, programmaticly moving elements in the
flash movie freeze when the above two lines run.

Olga


----- Original Message -----
From: "Phillip Kerman" <flash5atteleport [dot] com>
To: <flasheratchinwag [dot] com>
Sent: Thursday, January 18, 2001 2:37 PM
Subject: RE: FLASH: string functions?


> My guess is the thing that's killing performance is the split() method.
>
> Definitely Helen's suggestion of holding a processed version of the
variable
> makes the most sense to me.
>
>
>
> Phillip
>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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: string functions?, Phillip Kerman

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