Solved

How do I bold text dynamically in AS3

Posted on 2011-02-23
7
601 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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 what frame rate is, how to control it and what effect it has on the video.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

757 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

22 Experts available now in Live!

Get 1:1 Help Now