pucca
September 3, 2004, 2:22pm
1
Hi
I got this scripting from one of your guys, but how do you apply it to a button, created in flash?
myArray = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" , "'" , " "];
word = "hello it's me again ha ha ha";
for (i=0; i<word.length; i++) {
myClip = attachMovie("mc", "mc"+i, i);
myClip.ivar = i;
myClip._y = 100;
myClip._x = 0+myClip.ivar*myClip._width;
myClip.targ = word.charAt(myClip.ivar);
myClip.myText.text = myArray[random(myArray.length)];
myClip.counter =random(10)
myClip.onEnterFrame = change;
}
function change() {
this.counter++
if (this.myText.text != this.targ && this.counter<15) {
this.myText.text = myArray[random(myArray.length)];
} else {
this.myText.text = this.targ;
delete this.onEnterFrame;
}
}
system
September 3, 2004, 2:53pm
2
pucca:
Hi
I got this scripting from one of your guys, but how do you apply it to a button, created in flash?
myArray = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" , "'" , " "];
word = "hello it's me again ha ha ha";
for (i=0; i<word.length; i++) {
myClip = attachMovie("mc", "mc"+i, i);
myClip.ivar = i;
myClip._y = 100;
myClip._x = 0+myClip.ivar*myClip._width;
myClip.targ = word.charAt(myClip.ivar);
myClip.myText.text = myArray[random(myArray.length)];
myClip.counter =random(10)
myClip.onEnterFrame = change;
}
function change() {
this.counter++
if (this.myText.text != this.targ && this.counter<15) {
this.myText.text = myArray[random(myArray.length)];
} else {
this.myText.text = this.targ;
delete this.onEnterFrame;
}
}
Looks like something i might have done. have a look here http://www.kirupaforum.com/forums/showthread.php?t=65050 I made a few examples so you may find what you are looking for. If not, I`ll try and adapt it for you.
system
September 6, 2004, 8:16am
3
Yehm thats exactly what i’m looking for. that http://www.yugop.com/ thingie.
But I’ve created a button in flash, and want to add the script to my button, but don’t know how? When I open that flash file its only scripting. Sorry I know I sound dumb…
;(
system
September 6, 2004, 10:38am
4
Put the loop in a function
myArray = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "'", " "];
word = "hello it's me again ha ha ha";
function makeRandomtext() {
for (i=0; i<word.length; i++) {
myClip = attachMovie("mc", "mc"+i, i);
myClip.ivar = i;
myClip._y = 100;
myClip._x = 0+myClip.ivar*myClip._width;
myClip.targ = word.charAt(myClip.ivar);
myClip.myText.text = myArray[random(myArray.length)];
myClip.counter = random(10);
myClip.onEnterFrame = change;
}
}
function change() {
this.counter++;
if (this.myText.text != this.targ && this.counter<15) {
this.myText.text = myArray[random(myArray.length)];
} else {
this.myText.text = this.targ;
delete this.onEnterFrame;
}
}
and call that function with your button
on(release){
makeRandomtext();
}
scotty(-:
system
September 6, 2004, 11:47am
5
Thanks alot, its working now, but now I wanna know how they manage to change the width and put the “___” in at http://www.yugop.com/
thanks!:cap:
system
September 6, 2004, 4:44pm
6
system
September 7, 2004, 11:52am
7
YEEEEEEEAAAAHH!!:party: How do you do that?
system
September 7, 2004, 4:36pm
8
Its basically the same code as one of the attempts in the other post.
system
September 10, 2004, 8:55am
9
Thanx alot Stringy, got one problem though, the underscores doesn’t show. Why not?
function startoff(lets, T) {
myText.text = "_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _";
displaytext = lets;
displayLength = lets.length;
dupdisplaylength = 60
myinterval = setInterval(messup, 20, T);
counter =50
}
function messup(T) {
mystring = "_";
for (i=0; i<dupdisplayLength; i++) {
b = displaytext.substr(random(displayLength), 1) != " " ? displaytext.substr(random(displayLength), 1) : "_";
mystring += b;
}
if(dupdisplaylength>displaylength){
dupdisplaylength--
myString.slice(dupdisplaylength-1,dupdisplaylength)
T.text = mystring.substr(0,dupdisplaylength);
}
counter--;
if (counter==displayLength) {
counter = 40;
clearInterval(myInterval);
myString = displaytext;
T.text = mystring;
}
}
myButton.onPress = function() {
startoff(" welcome ", myText);
};
btn1.onPress = function() {
startoff(" services ", myText);
};
btn2.onPress = function() {
startoff(" contact us ", myText);
};