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.
Thanks a lot.
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”);
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);
dude your the best
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 = [];
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() {
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 dont need any of the mop references but that won
t make a lot of difference (clean them up anyway).It doesnt 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?
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
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
i know one way is to just set the interval to a very long number
All you have to do is delete the finterval=blaaaaaaaaaaa
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:
see if this helps
That is great!! Thanks stringy!!!
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.