# \[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:** 10\
**Page:** 3

<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 24, 2004, 1:00pm UTC](https://forum.kirupa.com/t/as-text-effect/59581/41 "2004-08-24T13:00:48Z")

</div>

> stringy: you could use this with the loadvars

i am now starting to look into that. would that be just changeing the startoff=(“my text at start”); to startoff = myVar;

i tryed that but could not get it to 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 24, 2004, 4:18pm UTC](https://forum.kirupa.com/t/as-text-effect/59581/42 "2004-08-24T16:18:24Z")

</div>

> [@rlLife](#):
>
> i am now starting to look into that. would that be just changeing the startoff=(“my text at start”); to startoff = myVar;
> 
> i tryed that but could not get it to work

you would have to put it in your loadVars.onload event  
lv.onLoad = function() {  
startOff(this.myVar);  
//And if you want it to keep repeating  
finterval = setinterval(startoff, 5000, this.myVar);  
};

---

<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 24, 2004, 4:32pm UTC](https://forum.kirupa.com/t/as-text-effect/59581/43 "2004-08-24T16:32:29Z")

</div>

thanks i will try that when i get home from work.  
rL

---

<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 25, 2004, 9:23am UTC](https://forum.kirupa.com/t/as-text-effect/59581/44 "2004-08-25T09:23:42Z")

</div>

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

thanks for the fla stringy…it’s perfect that’s what i want actually…

---

<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 25, 2004, 10:15pm UTC](https://forum.kirupa.com/t/as-text-effect/59581/45 "2004-08-25T22:15:51Z")

</div>

> [@pixeldude](#):
>
> thanks for the fla stringy…it’s perfect that’s what i want actually…

you are welcome

---

<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 26, 2004, 7:29am UTC](https://forum.kirupa.com/t/as-text-effect/59581/46 "2004-08-26T07:29:26Z")

</div>

Hi Stringy,

I’ve been following this thread. Good works!

I understand how to set the interval, and import the sound for this case study.

In my project, the sound that I imported is actually, the naration of the sentences. My question: Is that possible to set different interval for different sentences ( according to the length of the mp3 sound imported?)

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 26, 2004, 9:17am UTC](https://forum.kirupa.com/t/as-text-effect/59581/47 "2004-08-26T09:17:50Z")

</div>

I think you are probably looking at this the wrong way. You could adjust the length of time the letters shift by passing a variable to counter but another way would be to use onSoundComplete() to end the function.  
Have a look at this, might help you get going.  
[http://www.gifsrus.com/testfile/fadeinout/longt.zip](http://www.gifsrus.com/testfile/fadeinout/longt.zip)

---

<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 26, 2004, 9:22am UTC](https://forum.kirupa.com/t/as-text-effect/59581/48 "2004-08-26T09:22:49Z")

</div>

Ah,…that’s just awesome. Million Thanks!

---

<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 26, 2004, 9:56am UTC](https://forum.kirupa.com/t/as-text-effect/59581/49 "2004-08-26T09:56:35Z")

</div>

Hi Stringy,

Sorry to bother you again. For my project, I don’t really need the random appearance of each string. I just want the text appear ( no fancy effect like fade-in, out or something). In this way, people will see/read the text, while in the background the sound is playing.

I have tried to delete the random in this function :

```auto
function messup(son) {
	counter++;
	mystring = "";
	for (i=0; i<displayLength; i++) {
		b = +displaytext.substr(random(displayLength), 1);
		mystring += b;
	}

```

to this :

```auto
function messup(son) {
	counter++;
	mystring = "";
	for (i=0; i<displayLength; i++) {
		b = +displaytext.substr((displayLength), 1);
		mystring += b;
	}

```

but now the text appear after the sound is finished. Can you show me where should I change to make the text appear first without waiting the respective sound successfully being loaded.

I do really appreciate your help

---

<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 26, 2004, 1:49pm UTC](https://forum.kirupa.com/t/as-text-effect/59581/50 "2004-08-26T13:49:28Z")

</div>

> [@Beebs](#):
>
> Ah,…that’s just awesome. Million Thanks!

you are welcome. I guess you solved your other problem but i just did quickly(same file)  
myArray = ;  
k = 0;  
mySound1 = new Sound();  
mySound1.attachSound(“s1”);  
mySound2 = new Sound();  
mySound2.attachSound(“s2”);  
mySound3 = new Sound();  
mySound3.attachSound(“s3”);  
myArray.push([“hello hello”, mySound1]);  
myArray.push([“all cows eat grass”, mySound2]);  
myArray.push([“when in rome”, mySound3]);  
function startoff(v1, v2) {  
clearInterval(finterval);  
mystring = v1;  
v2.start();  
v2.onSoundComplete = function() {  
k++;  
if (k == myArray.length) {  
k = 0;  
}  
finterval = setinterval(startoff, 50, myArray[k][0], myArray[k][1]);

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