Solved

How do I bold text dynamically in AS3

Posted on 2011-02-23
7
611 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
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.

749 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