A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: How do you type and show realtime fonts?

  1. #1
    Senior Member
    Join Date
    Jul 2001
    Posts
    125
    I'm trying to find an example or tutorial that shows how a user can select a font, it's color, size, etc. ... then to type text in a text box...then for it to show up immediately (in realtime) in a sample box.

    Please check out this web site that does it using Java:
    http://decalstore.com/java/makedecal.htm

    Thanks for any and all help!

    --Darcie

  2. #2
    Member
    Join Date
    May 2002
    Posts
    62
    Darcie,
    Here's an experiment I played with a few weeks back that may be of some help...

    The test Item:
    http://www.weirdstuffwemake.com/misc...ctexttest.html

    The Fla:
    http://www.weirdstuffwemake.com/misc...ictexttest.fla

    Hope it's helpful...

    Cheers

  3. #3
    Member
    Join Date
    May 2002
    Posts
    62
    Oh Yeah...
    And don't forget to look in the flashMX help under "TextFormat". I had lots of fun playing with all the various text properties!

  4. #4
    Senior Member
    Join Date
    Jul 2001
    Posts
    125
    LaurasDog --

    Thanks so much for your help! Sorry I didn't respond sooner (been away). I was able to download your .fla and then make a .swf which was helpful. Unfortunately, it seems the .fla is corrupted. Afterwards, when I went in to play with it and check the code, the file won't allow me to do anything. It seems if I select nothing immediately opening the file, then I can access the menu (hence I was able to make a SWF). BUT if I try to select anything in the movie, the file seems to bog down to a stand still and I can't do anything but CTRL-ALT-DEL.

    Do you still have the file and possibly can email it to me? I was so excited to see your FLA, but sad that I couldn't check the coding.

    Thanks if you can!

    --Darcie

  5. #5
    Member
    Join Date
    May 2002
    Posts
    62
    It had quite a few fonts embedded, and that seems to cause problems sometimes if someone else tries to open the FLA and doesn't have the fonts on their machine. I've had trouble with that already...
    I posted a revised version that only has Arial and Times New Roman Embedded. See if these work for you:
    http://www.weirdstuffwemake.com/misc...ctexttest.html
    http://www.weirdstuffwemake.com/misc...ictexttest.FLA

    If not, I'll need your email address.

  6. #6
    Senior Member
    Join Date
    Jul 2001
    Posts
    125
    LaurasDog,

    THanks again for the help! Your file worked a lot better, but was still a little boggy. I'm sorry to do this AGAIN, but I just can't figure out how to use your coding for ComboBoxes. I've been trying for the past week (and have left other posts), but can't figure it out.

    I want to do exactly what you're doing with the text box automatically update depending on what you choose...but yours is done with RadioGroup and I'm being a complete dunce with figuring it out with Combo...

    Any hints?

    I'm sorry again for being such a nudge, but I don't know where else to go.

    Thanks!

    --Darcie

  7. #7
    Member
    Join Date
    May 2002
    Posts
    62
    I want to do exactly what you're doing with the text box automatically update depending on what you choose...but yours is done with RadioGroup and I'm being a complete dunce with figuring it out with Combo...

    Hey Darcie,
    Hmmm, well, I haven't played with comboboxes yet, so i don't have any help at this time but it seems like a good time to learn...
    Todays schedule is jammed full, and tomorrow I have a bunch of salmon to smoke, but if I get a chance sunday I'll play around a bit and see what I come up with.
    If I don't post anything by monday afternoon, shoot me a reminder!

  8. #8
    Member
    Join Date
    May 2002
    Posts
    62
    Heehee... well I found a few minutes to "play" and tried using a combo box for the first time. Didn't seem too painful. It's almost the same as using the radio buttons.
    Here's the same stuff as before, except using combo instead of radio:
    http://www.weirdstuffwemake.com/misc...texttest2.html
    and the FLA:
    http://www.weirdstuffwemake.com/misc...ctexttest2.fla

    On that one I put the color values right into the combo box
    data. That may not be the smartest way to do... Here's a slight variation that puts the colors in an array instead:
    http://www.weirdstuffwemake.com/misc...texttest3.html
    http://www.weirdstuffwemake.com/misc...ctexttest3.fla

    Cheers!

  9. #9
    Senior Member
    Join Date
    Jul 2001
    Posts
    125
    LaurasDog!

    THANK YOU! You've been an incredible help and I've made a ton of progress (well..for me I have, that is). But I'm still having problems. I can change the text color, but still can't figure out changing fonts, a bkgd color of a MC, and other junk.

    I uploaded the files here:
    http://www.darcielawson.com/clueless/

    If you happen to have a few minutes to check out my file, I'd be forever in your debt (well, I'm forever in your debt...just make it forever plus ONE...hehe).

    I'm doing this for a friend (cause I thought I COULD do it) and he needs it sometime Friday (tomorrow). I don't suppose you could check it out for me, please?

    Thanks again and I know how busy you are, and if there's anyway I can pay you back, please let me know how.

    --Darcie

  10. #10
    Member
    Join Date
    May 2002
    Posts
    62
    Darcie,
    not much time today, but I fixed a couple items on your FLA. Note the use of mc.setRGB for movie clips. That gets the backgrounmd color working.
    I also got the change font function working. The major issue is that you need to embed the fonts you use. Goto the library and click the little squiggly icon near the top right of the library. Choose "new Font", then select the font to embed it and give it a name so you can call it up with actionscript. You will need to do this with EVERY font you intend to use, including bold and italic variants.
    Please note that this makes the .swf MUCH larger, since font outlines can be kinda big. If you use a lot of fonts, your files will get huge, but that's the way it works.
    I will be out and about most of today, but I'll try and check back this afternoon if I can and see how it's going...

    As far as payment goes, if you get the chance to help someone else out, either here on FK or anywhere else, do it.
    It all comes around in the end...

    You'll find your revised FLA here:
    http://www.weirdstuffwemake.com/misc/typeface2b.fla

    Cheers!

    Cheers

  11. #11
    Junior Member
    Join Date
    Aug 2002
    Posts
    2
    Hi guys,

    I was having a look at the examples you posted. I am also looking to do a similar thing, but I was wondering if you have found a way to dynamically load the fonts using Flash (MX)?

    or... I notice that the Java applet seems to dynamically load fonts - is the code for that applet available?

    Alastair

  12. #12
    Junior Member
    Join Date
    Aug 2002
    Posts
    1
    Hi,

    I've just seen these demo's and Im after changing the color of a text box like your swf does. However I have only got Flash 5 and it won't load your .fla

    What is the actionscript code to change the colour of text in a text field?

    Thank in advance for all your help :-)

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