|
|
Subject:
Flash - Change font size and colour dynamically
Category: Computers > Graphics Asked by: softcom-ga List Price: $5.00 |
Posted:
17 Feb 2003 09:20 PST
Expires: 19 Mar 2003 09:20 PST Question ID: 162548 |
I have a Flash animation that displays text in a dynamic text field based on an ASP script. I would like to not only pass the text to be displayed but also the font size and colour. So that when the Flash file loads, it will get the Text, size and color and display it accordingly. Any ideas? I currently use Flash MX, but I would prefer code that would run on a earlier version. |
|
Subject:
Re: Flash - Change font size and colour dynamically
Answered By: skorba-ga on 21 Feb 2003 16:55 PST Rated: |
Dear softcom - Lucy for you the problem is easily solved. From flash 5 and up swf-movies support html-formatting of text-fields. (This you can easily verify by creating a dynamic textfield named "test" on the stage. Remember to tick off the "HTML" option beside the text field! Also, please create a button with this action: on (release) { test = "<font color=\"#ff0000\" size=\"10\">testing</font>"; } Export and press the button - voila, you got red text. What remains for you to do is simply to html-format the text you send from your server. And remember to URL-encode the values of that text! Example: This is how the 'testing' variable above would look when URL-encoded: test=%3Cfont%20color%3D%22%23ff0000%22%20size%3D%2210%22%3Etesting%3C/font%3E Here is a link to Macromedia Tech notes: http://www.macromedia.com/support/flash/technotes.html Here you will find more on URL-encoding and HTML-formatted text fields. Good luck! | |
| |
|
softcom-ga
rated this answer:
Thanks for all the help, it worked great. |
|
Subject:
Re: Flash - Change font size and colour dynamically
From: theta-ga on 17 Feb 2003 10:41 PST |
Hi softcom-ga, It appears that dynamically changing the text size and colour may not be possible with dynaamic text fields. The following is an extract from the chapter 9 of Macromedia's ELearning PDF Articles (http://www.macromedia.com/desdev/education/articles/mx_elearning/mx_elearning_ch9.pdf) : "... When you build dynamic text fields, you shouldhave in mind the nature of the different strings. Are they body text? Headlines?Short, long, or mixed?The reason that you need to ask these questions is that you have to format the text fieldas soon as you create it. All of the strings put in it will inherit that formatting. Whilethere is some flexibility, as you will see, there isn't much of it. If the text field uses Arialsize 10, all of the text dynamically added to the text field will also be displayed in Arialsize 10. Beyond that limitation, actually creating dynamic text is pretty easy" I hope a Researcher is able to find you some way around this limitation. Best Of Luck! Regards, Theta-ga :-) |
Subject:
Re: Flash - Change font size and colour dynamically
From: softcom-ga on 17 Feb 2003 11:25 PST |
Hi theta-ga Thanks for the comment. OK, if that's the case. Can I dynamically generate a text field that displays text passed to the Flash file with a passed color and font size, while still having a font embedded. What I'm trying to do is have a Title on a web page. The title will be either stored in a database which a user will be able to edit on a different screen. I already have this part working. The problem is that I want the user to be able to specify the font size and color. So I thought that Flash would be the answer because I can embed a font and have a tranparent background. If there is another way to put the text on the screen another way, I'd definitely be interested. Thanks |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |