# \[as\]Text effect

**URL:** https://forum.kirupa.com/t/as-text-effect/59581
**Category:** flash
**Created:** [August 2, 2004, 6:42am UTC](https://forum.kirupa.com/t/as-text-effect/59581 "2004-08-02T06:42:21Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 8, 2004, 8:27am UTC](https://forum.kirupa.com/t/as-text-effect/59581/21 "2004-08-08T08:27:49Z")

</div>

> [@bombingpixels](#):
>
> that one works really well… might I suggest changing the dashes to underscores though?

Thanks, I originally made it as you are suggesting but apart from when using a few selected fonts, the underscores tended to merge into a line which did not look so good.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 9, 2004, 3:03am UTC](https://forum.kirupa.com/t/as-text-effect/59581/22 "2004-08-09T03:03:32Z")

</div>

> [@stringy](#):
>
> Thanks, I originally made it as you are suggesting but apart from when using a few selected fonts, the underscores tended to merge into a line which did not look so good.

hi.stringy

That’s great.nice work.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 9, 2004, 5:24pm UTC](https://forum.kirupa.com/t/as-text-effect/59581/23 "2004-08-09T17:24:05Z")

</div>

> [@egoldy](#):
>
> hi.stringy
> 
> That’s great.nice work.

Thanks a lot.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 9, 2004, 5:38pm UTC](https://forum.kirupa.com/t/as-text-effect/59581/24 "2004-08-09T17:38:19Z")

</div>

stringy, how could that be changes so the effect does not happen on a button clip but when text is loaded in ether from just how it is or if it were to be loaded from a txt file?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 9, 2004, 7:23pm UTC](https://forum.kirupa.com/t/as-text-effect/59581/25 "2004-08-09T19:23:55Z")

</div>

> [@rlLife](#):
>
> stringy, how could that be changes so the effect does not happen on a button clip but when text is loaded in ether from just how it is or if it were to be loaded from a txt file?

in you textfile:-  
&txtString=hello how are you,how is the weather,all cows eat grass&  
in Flash:-  
myArray1 = [“1”, “0”, “?”, “`”, “,”, " “, “a”, “b”, “B”, “c”, “d”, “e”, “f”, “g”, “h”, “i”, “I”, “j”, “k”, “l”, “m”, “n”, “o”, “p”, “q”, “r”, “s”, “t”, “u”, “v”, “w”, “x”, “y”, “z”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”, “-”];  
mop = 0;  
function init(k) {  
mop++;  
if (mop == myArray.length) {  
mop = 0;  
}  
delete mystring;  
myvar = k;  
delete A1;  
A1 = ;  
for (g=0; g\<k.length; g++) {  
A1.push(”-“);  
myString += A1[g];  
}  
delete A2;  
A2 = ;  
for (var i = 0; i\<myString.length; i++) {  
removeMovieClip(\_root[“paper”+i])  
tex = createEmptyMovieClip(“paper”+i, i);  
tex.ivar = i;  
tex.letter = myVar.charAt(i);  
A2.push(tex.letter);  
tex.counter = random(10);  
tex.onEnterFrame = move;  
}  
}  
function getString() {  
mystring = “”;  
k = A2.toString();  
for (i=0; i\<k.length; i++) {  
if (k.charAt(i) != “,”) {  
b = k.charAt(i);  
myString = mystring.concat(b);  
}  
}  
}  
function move() {  
this.counter++;  
this.letter = myArray1[random(myArray1.length)];  
A2[this.ivar] = this.letter;  
if (this.letter == myVar.charAt(this.ivar)) {  
this.letter = myVar.charAt(this.ivar);  
delete this.onEnterFrame;  
} else if (this.counter\>10) {  
delete this.onEnterFrame;  
this.letter = myVar.charAt(this.ivar);  
A2[this.ivar] = this.letter;  
}  
getString();  
}  
lv = new LoadVars();  
lv.onLoad = function() {  
myArray = lv.txtString.split(”,“);  
for (var n = 0; n != myArray.length; n++) {  
trace(“myArray[”+n+”] - "+myArray[n]);  
}  
myInterval = setInterval(changetext, 2000);  
};  
function changetext() {  
init(myArray[mop]);  
}  
lv.load(“your.txt”);

[http://www.gifsrus.com/testfile/textrand4.swf](http://www.gifsrus.com/testfile/textrand4.swf)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 9, 2004, 7:50pm UTC](https://forum.kirupa.com/t/as-text-effect/59581/26 "2004-08-09T19:50:41Z")

</div>

thanks stringy that is perfect. super cool. how would i just pull one of the sentences. i dont need all three. i am looking at the code and it looks like i just might need to not have it get the three var only 1?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 9, 2004, 8:25pm UTC](https://forum.kirupa.com/t/as-text-effect/59581/27 "2004-08-09T20:25:19Z")

</div>

> [@rlLife](#):
>
> thanks stringy that is perfect. super cool. how would i just pull one of the sentences. i dont need all three. i am looking at the code and it looks like i just might need to not have it get the three var only 1?

lv = new LoadVars();  
lv.onLoad = function() {  
myInterval = setInterval(init, 3000, this.txtString);  
};  
lv.load(“your.txt”);  
by the way, in my previous posts within the innit function, it should read  
removeMovieClip(\_root[“paper”+i])  
tex = createEmptyMovieClip(“paper”+i, i);

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 9, 2004, 8:30pm UTC](https://forum.kirupa.com/t/as-text-effect/59581/28 "2004-08-09T20:30:06Z")

</div>

dude your the best

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 9, 2004, 8:48pm UTC](https://forum.kirupa.com/t/as-text-effect/59581/29 "2004-08-09T20:48:21Z")

</div>

```auto
 myArray1 = ["1", "0", "?", "`", ",", " ", "a", "b", "B", "c", "d", "e", "f", "g", "h", "i", "I", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-"];
 mop = 0;
 function init(k) {
 mop++;
 if (mop == myArray.length) {
 mop = 0;
 }
 delete mystring;
 myvar = k;
 delete A1;
 A1 = [];
 for (g=0; g&lt;k.length; g++) {
 A1.push("-");
 myString += A1[g];
 }
 delete A2;
 A2 = [];
 removeMovieClip(_root["paper"+i])
 tex = createEmptyMovieClip("paper"+i, i);
 tex.ivar = i;
 tex.letter = myVar.charAt(i);
 A2.push(tex.letter);
 tex.counter = random(10);
 tex.onEnterFrame = move;
 }
 function getString() {
 mystring = "";
 k = A2.toString();
 for (i=0; i&lt;k.length; i++) {
 if (k.charAt(i) != ",") {
 b = k.charAt(i);
 myString = mystring.concat(b);
 }
 }
 }
 function move() {
 this.counter++;
 this.letter = myArray1[random(myArray1.length)];
 A2[this.ivar] = this.letter;
 if (this.letter == myVar.charAt(this.ivar)) {
 this.letter = myVar.charAt(this.ivar);
 delete this.onEnterFrame;
 } else if (this.counter&gt;10) {
 delete this.onEnterFrame;
 this.letter = myVar.charAt(this.ivar);
 A2[this.ivar] = this.letter;
 }
 getString();
 }
 lv = new LoadVars();
 lv.onLoad = function() {
 myInterval = setInterval(init, 3000, this.txtString);
 };
 lv.load("your.txt");

```

here is what i have in the first frame of the movie. it works but it is acting a little crazy

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 9, 2004, 9:29pm UTC](https://forum.kirupa.com/t/as-text-effect/59581/30 "2004-08-09T21:29:39Z")

</div>

> [@rlLife](#):
>
> ```auto
> myArray1 = ["1", "0", "?", "`", ",", " ", "a", "b", "B", "c", "d", "e", "f", "g", "h", "i", "I", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-"];
> mop = 0;
> function init(k) {
> mop++;
> if (mop == myArray.length) {
> mop = 0;
> }
> delete mystring;
> myvar = k;
> delete A1;
> A1 = [];
> for (g=0; g&lt;k.length; g++) {
> A1.push("-");
> myString += A1[g];
> }
> delete A2;
> A2 = [];
> removeMovieClip(_root["paper"+i])
> tex = createEmptyMovieClip("paper"+i, i);
> tex.ivar = i;
> tex.letter = myVar.charAt(i);
> A2.push(tex.letter);
> tex.counter = random(10);
> tex.onEnterFrame = move;
> }
> function getString() {
> mystring = "";
> k = A2.toString();
> for (i=0; i&lt;k.length; i++) {
> if (k.charAt(i) != ",") {
> b = k.charAt(i);
> myString = mystring.concat(b);
> }
> }
> }
> function move() {
> this.counter++;
> this.letter = myArray1[random(myArray1.length)];
> A2[this.ivar] = this.letter;
> if (this.letter == myVar.charAt(this.ivar)) {
> this.letter = myVar.charAt(this.ivar);
> delete this.onEnterFrame;
> } else if (this.counter&gt;10) {
> delete this.onEnterFrame;
> this.letter = myVar.charAt(this.ivar);
> A2[this.ivar] = this.letter;
> }
> getString();
> }
> lv = new LoadVars();
> lv.onLoad = function() {
> myInterval = setInterval(init, 3000, this.txtString);
> };
> lv.load("your.txt");
> 
> ```
> 
> here is what i have in the first frame of the movie. it works but it is acting a little crazy

well you don`t need any of the mop references but that won`t make a lot of difference (clean them up anyway).It doesn`t seem to work too well with long strings. You might try and reduce array1 to only the letters you need and maybe reduce both references to counter but there may be something inefficient happening which i have missed. Maybe try increasing the interval.Tis late here now but i`ll have a look tomorrow. What is the string which you are loading?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 9, 2004, 9:51pm UTC](https://forum.kirupa.com/t/as-text-effect/59581/31 "2004-08-09T21:51:45Z")

</div>

thanks, for the tips, i will work on it tonight

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 10, 2004, 6:02am UTC](https://forum.kirupa.com/t/as-text-effect/59581/32 "2004-08-10T06:02:15Z")

</div>

> [@rlLife](#):
>
> thanks, for the tips, i will work on it tonight

This also works better  
function getString() {  
mystring = “”;  
for (i=0; i\<A2.length; i++) {  
b = A2\*;  
mystring = mystring.concat(b);  
}  
}  
you could also remove this  
if (this.letter == myVar.charAt(this.ivar)) {  
this.letter = myVar.charAt(this.ivar);  
delete this.onEnterFrame;  
trace(“hi”);  
} else

Another way to do it which is more efficient and works for long strings is like this  
function startoff(lets) {  
displaytext = lets;  
displayLength = lets.length;  
myinterval = setInterval(messup, 20);  
}  
function messup() {  
counter++;  
mystring = “”;  
for (i=0; i\<displayLength; i++) {  
b = +displaytext.substr(random(displayLength), 1);  
mystring += b;  
}  
if (counter\>10) {  
counter = 0;  
clearInterval(myInterval);  
myString = displaytext;  
}  
}  
finterval = setinterval(startoff, 5000, "hello how are you? what are you doing today? how is the weather today in africa all cows eat grass most of the time I think you need to go with something more like what Peter has listed. Something about it doesn’t quite seem right to me, but I’ve always had a hard time with this kind of notation. If it doesn’t work, post back and I will check some files I’ve made that do a similar thing. numbers. ");  
startoff("hello how are you? what are you doing today? how is the weather today in africa all cows eat grass most of the time I think you need to go with something more like what Peter has listed. Something about it doesn’t quite seem right to me, but I’ve always had a hard time with this kind of notation. If it doesn’t work, post back and I will check some files I’ve made that do a similar thing. numbers. ");

you could use this with the loadvars  
[http://www.gifsrus.com/testfile/longt.swf](http://www.gifsrus.com/testfile/longt.swf)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 10, 2004, 2:02pm UTC](https://forum.kirupa.com/t/as-text-effect/59581/33 "2004-08-10T14:02:59Z")

</div>

i cant thank you enough for you your help. the long text code is awsome. is there a way to make it not cycle, just mix up and stay up? if you dont have time to post back that is fine. thanks again

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 10, 2004, 2:11pm UTC](https://forum.kirupa.com/t/as-text-effect/59581/34 "2004-08-10T14:11:30Z")

</div>

i know one way is to just set the interval to a very long number

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 10, 2004, 6:37pm UTC](https://forum.kirupa.com/t/as-text-effect/59581/35 "2004-08-10T18:37:42Z")

</div>

> [@rlLife](#):
>
> i cant thank you enough for you your help. the long text code is awsome. is there a way to make it not cycle, just mix up and stay up? if you dont have time to post back that is fine. thanks again

All you have to do is delete the finterval=blaaaaaaaaaaa

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 19, 2004, 10:24am UTC](https://forum.kirupa.com/t/as-text-effect/59581/36 "2004-08-19T10:24:57Z")

</div>

> 

Another way to do it which is more efficient and works for long strings is like this

ello stringy another question coz i’m stcuk here…what about for long string and then recycle like previously…i mean example it shown -------- bla bla bla------ and the the real string.i don;t want it only show static text…like the one u made…this time for long string…

hope u 'll help me… thanks u…

:h:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 19, 2004, 8:56pm UTC](https://forum.kirupa.com/t/as-text-effect/59581/37 "2004-08-19T20:56:01Z")

</div>

> [@pixeldude](#):
>
> ello stringy another question coz i’m stcuk here…what about for long string and then recycle like previously…i mean example it shown -------- bla bla bla------ and the the real string.i don;t want it only show static text…like the one u made…this time for long string…
> 
> hope u 'll help me… thanks u…
> 
> :h:

see if this helps

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 19, 2004, 9:50pm UTC](https://forum.kirupa.com/t/as-text-effect/59581/38 "2004-08-19T21:50:22Z")

</div>

That is great!! Thanks stringy!!!😉

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 20, 2004, 2:19am UTC](https://forum.kirupa.com/t/as-text-effect/59581/39 "2004-08-20T02:19:40Z")

</div>

that’s great stingy great thanks anyway…one more question is it possible to do with long string…let’s say it starts recycle the text with “–a--c-3–d--4-e—” and then the real long string appear " bbalabala…bla…bla…bla…"…and not for 3 long string…only one long string…

hope so tq anyway stringy for ur reply… :thumb:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 20, 2004, 8:41pm UTC](https://forum.kirupa.com/t/as-text-effect/59581/40 "2004-08-20T20:41:46Z")

</div>

> [@pixeldude](#):
>
> that’s great stingy great thanks anyway…one more question is it possible to do with long string…let’s say it starts recycle the text with “–a–c-3–d–4-e—” and then the real long string appear " bbalabala…bla…bla…bla…"…and not for 3 long string…only one long string…
> 
> hope so tq anyway stringy for ur reply… :thumb:

Not exactly sure what you mean. I`ve bodged the last 2 attempts together here, hope its what you want.  
If you only want one long string just delete the other elements of the array.

[Previous page](https://forum.kirupa.com/t/as-text-effect/59581.md?page=1)

[Next page](https://forum.kirupa.com/t/as-text-effect/59581.md?page=3)
