I want to make a flash effect for typing.
I want to make a typing effect, that is, words come out one by one, just like typing!
Answer: Darren
Level: Wise
April 23 Add a dynamic text box to the scene
Name output_txt
Create a new layer for the
Write at the first frame of this layerCode:
I = 0; // set the initial value of I. I is used to control the character position of the text.
TEXT = "abcdefghijklmnopqrstuvwxyz"; // write the words you want to enter here.
====================================
TEXT = "how is this done !! ";
Max = length (text );
I = "1 ";
Write code in the second frame:
If (I <= text. Length) {// If I <= abcdefghijklmnopqrstuvwxy, run
I ++; // I ++ indicates reading the next character
Output = text. substr (0, I); // substr () indicates that the read starts from 0
} Else {
Stop (); // if you have read this text, it ends.
}
========================================================== ======
I = Number (I) + 1;
Screen = substring (text, 1, I );
Write the code in the fourth frame (other frames can be used, and the latter the frame is, the slower the typing speed ).
Gotoandplay (2); // repeat the second frame of code to read all the characters.
========================================================== ======================
If (number (I)> Number (max) {
stop ();
}else {
gotoandplay (2 );
}< br>