-
Hi,
i asked this question a few weeks ago and lost the file that had the code in, i searched again for my post on here and nothing.
i was wondering, on some websites it has text which auto types on its own, like someone is typing at the other end. Can someone please give me the code so it will work. Also it has to be in frame1 so will this work in frame 1 of a movie or frame 1 of the whole flash file only?
Thanks
-
In Frame 1 set a variable to the phrase you want typed out, and another counting variable to 0. Like<pre>phrase = "Hello world.";
index = 0;</pre>Then put this in the frame where you want the phrase typed:<pre>textField = phrase.charAt(index);</pre>And in the next frame:<pre>if (index < phrase.length - 1) {
index++;
gotoAndPlay(_currentframe - 1);
} else {
stop();
}</pre>You can change the stop() to whatever you want to happen after the phrase is done typing out.
-Dan
-
Hi M8,
Thanks for replying,
I have tried what you said, but being new to this stuff i have unable to get it working.
There was another way i think using a similar actionscript.
Thanks anyway
-
Did you...
Take a look at http://www.flashkit.com/tutorials/Text_Effects/ and see if it has what you neeed.
-
The script I wrote should work. The only reason it wouldn't is if you changed any of the variable names or forgot to make a dynamic text field called "textField" in the same timeline as the script!
-Dan
-
TomServo I am trying what you said because it seems like a good trick to know instead of animating it by hand like I usaully do..
I am having a bit of trouble...could you take a look at my test FLA and fix it and email it to me so I can see how you did it...I'd appreciate it...
http://www.timsantor.com/devtests/devtest.html
Email it back to tim@timsantor.com Thanx.
-
Well, sadly I have a mistake in my posted script. The equal sign in the line "myField = phrase.charAt(index);" should actually be a +=, so as to read "myField += phrase.charAt(index);".
However, in your file you gave the text field an instance name instead of a variable name.
I sent a working version to your e-mail address.
Sorry about that!
-Dan
-
Thanx Tom...that is awesome!
-
Hi M8,
I have tried the new variable but get
[type Function]
It types out exactly how i like it but i get the above before the text !
Can anyone please help?
Thanks
-
Can you post a link to the movie so we can see?
-Dan
-
Doesnt matter now m8, done it
thx anyway
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|