Solved

How do I bold text dynamically in AS3

Posted on 2011-02-23
7
603 Views
Last Modified: 2013-11-11
Question 1:
I would like to call data from a mysql database using php to the variable "var cookbookText:String".
Below I manually entered the text from the database. How is this done?

Question 2:
I would also like to dynamically bold and underline specific text after called from the database.
For example, I would like to bold/underline the word "Doritos". How is this done?

var cookbookText:String = "3 chicken breasts, boiled, cubed, reserve broth" + "<br>" +
"1 med. onion, chopped" + "<br>" +
"1/2 stick butter" + "<br>" +
"1 can cream of mushroom soup" + "<br>" +
"1 can cram of chicken soup" + "<br>" +
"1 1/2 tbsp. chili powder" + "<br>" +
"1 (16 oz.) bag Nacho cheese Doritos, crushed" + "<br>" +
"8 oz. Cheddar cheese, grated" + "<br>" +

Output to textfield is as follows:
                     LabelRecipetxt.border = true
      LabelRecipetxt.multiline = true
      LabelRecipetxt.wordWrap = true
      LabelRecipetxt.htmlText ='<font size = "12">' + cookbookText +'</font>';

Thanks in advance
0
Comment
Question by:eager_to_learn
  • 5
  • 2
7 Comments
 
LVL 20

Expert Comment

by:ChristoferDutz
ID: 34961327
Use a dynamic textbox and set it to "Render as HTML" and you should be good to go to use the html codes "<b>" and "<i>"
http://www.smartwebby.com/Flash/html_textbox.asp
0
 
LVL 20

Expert Comment

by:ChristoferDutz
ID: 34961350
Here comes some info on the underlining (It's done differently):
http://www.permadi.com/tutorial/flashTextUnderline/index.html
0
 
LVL 20

Expert Comment

by:ChristoferDutz
ID: 34961363
To your first question: What type of sever are you using? Java, PHP, ASP? Depending on the server-side technology the answer will be different.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:eager_to_learn
ID: 34961489
The server side technology is PHP.
0
 
LVL 20

Accepted Solution

by:
ChristoferDutz earned 500 total points
ID: 34961584
0
 

Author Comment

by:eager_to_learn
ID: 34961588
ChristoferDutz: Thanks for the quick response

The articles are helpful with understanding the behaviors of html in a dynamic textbox. But my start point is a little hazy...

How would I bold a specific word from a database to a textfield without having to manually input <b> or <i>?
0
 
LVL 20

Assisted Solution

by:ChristoferDutz
ChristoferDutz earned 500 total points
ID: 34961614
Ok ... well in this case, I'd use a regualr expression to replace the string "word" with "<b>word</b>"
http://www.actionscript.org/forums/showthread.php3?t=160065
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now