Solved

How do I bold text dynamically in AS3

Posted on 2011-02-23
7
618 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
Industry Leaders: 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

724 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