Hi
I’m trying to get the bt text over effect here:
I’ve set-up a simple mc button and applied the text effect script (below) to the over state in the mc - But I can’t get it 2 work.
Grateful for any input going - .fla attached
Thanx
d
textEffectF(yourTF);
Array.prototype.shuffle = function() {
for (var ivar = this.length-1; ivar>=0; ivar--) {
var p = random(ivar);
var t = this[ivar];
this[ivar] = this[p];
this[p] = t;
}
};
a = "abcdefghijklmnopqrstuvwxyz 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()-_+=[]{};\':\"<>?\\,./";
A = a.split("");
B = A.concat();
B.shuffle();
function textEffectF(tf) {
var origS = tf.text;
cnt = -1;
changeI = setInterval(changeF, 1, tf, 0, origS);
}
function changeF(tf, ind, s) {
cnt++;
if (cnt>=A.length) {
cnt = 0;
}
for (var j = ind; j<tf.text.length; j++) {
if (j>ind) {
tf.text = tf.text.substring(0, j)+B[(cnt+j)%A.length]+tf.text.substring(j, s.length-1);
} else {
tf.text = tf.text.substring(0, j)+A[cnt]+tf.text.substring(j, s.length-1);
if (s.charAt(j) == A[cnt]) {
clearInterval(changeI);
ind++;
if (ind<s.length) {
changeI = setInterval(changeF, 1, tf, ind, s);
}
}
}
}
updateAfterEvent();
}