A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: FlashMX : Auto Typing Question!

  1. #1
    Junior Member
    Join Date
    Feb 2002
    Posts
    16

    Smile

    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

  2. #2
    Senior Member
    Join Date
    May 2002
    Posts
    248
    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

  3. #3
    Junior Member
    Join Date
    Feb 2002
    Posts
    16
    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

  4. #4
    Member
    Join Date
    Oct 2001
    Posts
    96

    Did you...

    Take a look at http://www.flashkit.com/tutorials/Text_Effects/ and see if it has what you neeed.

  5. #5
    Senior Member
    Join Date
    May 2002
    Posts
    248
    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

  6. #6
    Senior Member
    Join Date
    Mar 2001
    Posts
    428
    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.


  7. #7
    Senior Member
    Join Date
    May 2002
    Posts
    248

    Smile

    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

  8. #8
    Senior Member
    Join Date
    Mar 2001
    Posts
    428
    Thanx Tom...that is awesome!

  9. #9
    Junior Member
    Join Date
    Feb 2002
    Posts
    16
    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

  10. #10
    Senior Member
    Join Date
    May 2002
    Posts
    248
    Can you post a link to the movie so we can see?

    -Dan

  11. #11
    Junior Member
    Join Date
    Feb 2002
    Posts
    16
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center