A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [MX04] Dynamic Text input -> animated text

  1. #1
    Senior Member
    Join Date
    Mar 2001
    Location
    Location : Location
    Posts
    131

    [MX04] Dynamic Text input -> animated text

    Hi

    Does anyone have any help regarding converting dynamically input text into animated text. Probably a bit like flashtyper but the site is down and I can't see it in action. I want to be able to change the font, colour and size of the input text and then allow simple animations to be performed on it as part of the movie ....

    Any help gratefullt recieved ..
    Last edited by TechNoiZ; 05-27-2007 at 08:00 AM. Reason: disabling signature - old link :)

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    this might help you on your way
    add 2 new fonts to your Library with linkahe identifiers - f1 and f2
    add code to main timeline to create textfield inside a movieclip
    use onEnterFrame to animate (and change)

    this is purely an example and should be modified to suit your project
    Code:
    fm1 = new TextFormat();
    fm1.size = 32;
    fm1.font = "f1";
    
    fm2 = new TextFormat();
    fm2.size = 22;
    fm2.font = "f2";
    
    this.createEmptyMovieClip("holder",100);
    holder._x = holder._y = 50;
    ref = holder.createTextField("txt",101,0,0,100,35);
    ref.type = "input";
    ref.autoSize = true;
    ref.border = true;
    ref.embedFonts = true;
    ref.borderColor = 0xFF0000;
    ref.textColor = 0x0000FF;
    ref.text = "F1 FONT";
    ref.setTextFormat(fm1);
    
    this.onEnterFrame = function(){
    ref._x += 1;
    ref._x > 30 ? func1() : null;
    ref._x > 60 ? func2() : null;
    ref._x >100 ? this.onEnterFrame = null : null;
    }
    
    function func1(){
    ref.autoSize = true;
    ref.borderColor = 0x00FF00;
    ref.textColor = 0xFF0000;
    ref.text = "CHANGE TO F2 FONT";
    ref.setTextFormat(fm2);
    };
    
    function func2(){
    ref.autoSize = true;
    ref.borderColor = 0xFF0000;
    ref.textColor = 0x0000FF;
    ref.text = "ORIGINAL FONT";
    ref.setTextFormat(fm1);
    };
    hth

  3. #3
    Senior Member
    Join Date
    Mar 2001
    Location
    Location : Location
    Posts
    131
    Hey thank you modified dog ...

    looks good ... thanks. I'll give it a go and adapt as required.

    cheers

    TechNoiZ
    this[MCr.i + 'm_not_ok']._lyric = "you sing the words but you don't know what they mean";

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