A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: "dropped capitals"

  1. #1

    Question "dropped capitals"

    Is it possible (with TLF or any other format) to set a textfield as "dropped capitals": That is, with the very first letter set big and the rest of the text set round it?

    Thanks

  2. #2
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Make an Input Textfield (Classic Text, not TLF), give it an instance name of, txt, and use this code on our frame, depending on your Actionscript version:

    ~ ACTIONSCRIPT 2.0 ~

    Actionscript Code:
    txt.onChanged = function(){
        if(txt.text.length > 0){
            txt.replaceText(0, 1, txt.text.charAt(0).toUpperCase());
        }
    }

    ~ ACTIONSCRIPT 3.0 ~

    Actionscript Code:
    import flash.events.Event;

    txt.addEventListener(Event.CHANGE, firstCapital);

    function firstCapital(e:Event){
        e.target.replaceText(0, 1, e.target.text.charAt(0).toUpperCase());
    }

    Hope this helps
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  3. #3
    Thanks, I was thinking something more like this:

    http://www.w3.org/TR/2010/WD-xslfo20...e-initials.png
    Attached Images Attached Images

  4. #4
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    that I am not sure of, and also not sure if is possible, because that kind of formatting isn't possible in Flash, based on my experience with Classic Text, but I may be wrong, 'cause I haven't tried TLF text!
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  5. #5
    ok thanks

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