Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 02-06-2003, 07:53 AM   #1
farafiro
Addicted To FLASH
 
farafiro's Avatar
 
Join Date: Dec 2001
Location: Egyptian in UAE
Posts: 12,436
Send a message via MSN to farafiro Send a message via Yahoo to farafiro
Default Making a Font list like MS, Dynamicly

I have an idea of making a text Editor for a long time now, but 'till I do it, here is a piece of code that I was inspired with, of making a font list that changes the font on the run within the text field. he main Idea was from MM site, but I've changed all the scripts upside down, will add it later in the Library
ActionScript Code:
//Code and all Credits belongs to Farafiro, created Feb. 06/2003 //First, grab a combo box to the stage, then delete it, or grab it only to the library //attaching the ComboBox to the root _root.attachMovie("FComboBoxSymbol", "fontList", -1000, {_x:50, _y:50}); //To make the ComboBox Editable, to accept writting the first letter fontList.setDataProvider(TextField.getFontList()); //sorting the fonts fontList.sortItemsBy("label", "asc"); //Creating a text field that showes the current font _root.createTextField("fontLable",50,75+fontList._width,50,75,fontList._height) with(fontLable){     border = true     autoSize = true     } //Creating the main text field _root.createTextField("myField", 100, 50, 100, 350, 400); with (myField) {     type = "input"     text = "Add any text and chose any font ......"     border = true;     borderColor = 0x336699; } //Making our text formating tf = new TextFormat(); //The script that controlls the font's Changing _root.onEnterFrame = function() {     fontList.onKillFocus = function() {         selecting = false;     };     fontList.onSetFocus = function() {         selecting = true;     };     if (selecting) {         _root.fontLable.text = fontList.getValue();         tf.font = fontList.getValue();         myField.setTextFormat(tf);     } else {         fontList.setValue(_root.fontLable.text);     }     myField.setNewTextFormat(tf); };
You can use this as you want, but u can gimmie some credit too
__________________
‚€* GOD Is Near ‚€*
Questions Don't PM for Questions . Thanks
An eye for an eye, make the whole world blind
_____________________________________________GHANDI
farafiro is offline   Reply With Quote
Old 02-06-2003, 08:06 AM   #2
l-i-n-k
Registered User
 
Join Date: Feb 2003
Posts: 4
Default Great idea and code!

Add the
ActionScript Code:
multiline = true; wordWrap = true;
parames to the main textfield and you can write a letter

Thank you.

Last edited by l-i-n-k; 02-06-2003 at 08:10 AM.
l-i-n-k is offline   Reply With Quote
Old 02-06-2003, 08:10 AM   #3
farafiro
Addicted To FLASH
 
farafiro's Avatar
 
Join Date: Dec 2001
Location: Egyptian in UAE
Posts: 12,436
Send a message via MSN to farafiro Send a message via Yahoo to farafiro
Default

done, thx
__________________
‚€* GOD Is Near ‚€*
Questions Don't PM for Questions . Thanks
An eye for an eye, make the whole world blind
_____________________________________________GHANDI
farafiro is offline   Reply With Quote
Old 02-07-2003, 10:31 AM   #4
Mortimer Jazz
Thing
 
Mortimer Jazz's Avatar
 
Join Date: Jun 2001
Location: UK
Posts: 2,418
Default

bug: just thought I'd let you know.
Doesn't seem to work with many fonts (even if I place a textbox onstage and embed the font outlines for that font). Fonts like Arial and Arial Black work but many others don't.
__________________
............................
FLEX/FLASH BLOG
Previous Flash Tutorials

............................
Mortimer Jazz is offline   Reply With Quote
Old 02-09-2003, 04:33 AM   #5
farafiro
Addicted To FLASH
 
farafiro's Avatar
 
Join Date: Dec 2001
Location: Egyptian in UAE
Posts: 12,436
Send a message via MSN to farafiro Send a message via Yahoo to farafiro
Default

I will check it out, but it worked here with all the fonts in my system
__________________
‚€* GOD Is Near ‚€*
Questions Don't PM for Questions . Thanks
An eye for an eye, make the whole world blind
_____________________________________________GHANDI
farafiro is offline   Reply With Quote
Old 02-09-2003, 04:37 AM   #6
farafiro
Addicted To FLASH
 
farafiro's Avatar
 
Join Date: Dec 2001
Location: Egyptian in UAE
Posts: 12,436
Send a message via MSN to farafiro Send a message via Yahoo to farafiro
Default

I tried it again over the web and it went very well, even with the odd fonts like Coptic and Greek
http://www.geocities.com/a_fayek/fun...y_fontList.swf
__________________
‚€* GOD Is Near ‚€*
Questions Don't PM for Questions . Thanks
An eye for an eye, make the whole world blind
_____________________________________________GHANDI
farafiro is offline   Reply With Quote
Old 02-09-2003, 12:18 PM   #7
Mortimer Jazz
Thing
 
Mortimer Jazz's Avatar
 
Join Date: Jun 2001
Location: UK
Posts: 2,418
Default

I'm getting a 404 on that link Faffy.

Oh, maybe it's just me then. It didn't work locally for me at all. It said it was displaying certain fonts, but they wern't the corrent ones. Maybe some other people can test it and see if its a platform related or flash plugin version problem.
__________________
............................
FLEX/FLASH BLOG
Previous Flash Tutorials

............................
Mortimer Jazz is offline   Reply With Quote
Old 02-09-2003, 12:49 PM   #8
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
Default

that works a treat for me

mac osx ie5.2

very nice indeed!
__________________
Billy
Online Galleries
iPhone Safety App - iStaySafe
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Old 02-09-2003, 12:52 PM   #9
farafiro
Addicted To FLASH
 
farafiro's Avatar
 
Join Date: Dec 2001
Location: Egyptian in UAE
Posts: 12,436
Send a message via MSN to farafiro Send a message via Yahoo to farafiro
Default

Quote:
Originally posted by Billy T
very nice indeed!
thx mate
__________________
‚€* GOD Is Near ‚€*
Questions Don't PM for Questions . Thanks
An eye for an eye, make the whole world blind
_____________________________________________GHANDI
farafiro is offline   Reply With Quote
Old 02-09-2003, 01:06 PM   #10
jimburton
no sleep til bedtime
 
jimburton's Avatar
 
Join Date: May 2001
Location: Brighton
Posts: 1,322
Default

looks good to me:

winxp

opera 7.1 & ie 6.0

player is 6.0.22
jimburton is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:24 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.