Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formating Dynamic Text with HTML

Status
Not open for further replies.

AudreyLucy

Technical User
Jul 19, 2002
42
0
0
US
PLease respond, if you can help. I've been trying to figure this out on my own for several days now to no avail. I've made this post before and I haven't recieved a response. Perhaps it is because it is a common question and you are tired of answering it. Please point me in the general direction, I will figure out the rest. I would REALLY apprieciate ANY help :( .

Here is a short explaination of what I am attempting to do, and the first few steps I have taken to achieve this goal:

I have created a scrolling, dynamic text box within a movie clip. I would like to BOLD the headings within the dynamic text. I have used HTML within the TEXT FILE (not the field). For example:
var7=<B>Subject Heading</B>

Question #1: Did I apply the HTML in the correct way? And is it o.k. to place the HTML tags in the TEXT FILE?

Should It look like this instead:
var7.text.htmlText=<B>Subject Heading </B>

I then highlighted the TEXT FIELD in the movie clip and selected &quot;render text as HTML&quot; in the Properties Pane.

Next I attempted to embed &quot;ArialBold&quot; Font. But when I tried to export the Bold Font I ran into some difficulties. I selected Options>Linkage and in the Symbol Linkage Properties dialog box, I could not figure out which option to choose (Export for ActionScript, Export for runtime Sharing, Import for runtime Sharing). The book I am using &quot;ActionScript the definitive guide&quot; by Colin Moock says to select &quot;Export this Symbol&quot;. I am using MX and I belive this book predates MX. I'm assuming that I should choose &quot;Export for runtime Sharing&quot;. But it requires a URL before Exporting. This file is for a C.D. that will not appear in a browser window. What should I do about the URL I am being asked to inclued before export? And do I also have to embed the normal Arial font in addition to the &quot;ARIAL BOLD&quot;?

When The .fla is exported it loads the text perfectly, the only problem is that the <B> and </B> appear within the text field as well.

What step am I missing or confusing? Thank you for responding to my post.

 
It's perfectly fine to place the HTML tags in the text file. Are you using loadVars or loadVariables to pull your text?

You actually shouldn't have to export the fonts (in the past, this has sometimes caused dynamic fields to not display at all). Select &quot;Character&quot; from your text field's properties, and select &quot;All characters&quot;, and you should be set.
 
I'm using loadVarsText
Here's the code if it helps:

loadVarsText= new LoadVars();
loadVarsText.load(&quot;corpident.txt&quot;);
loadVarsText.onLoad = function(success) {
if (success) {
trace(&quot;done loading&quot;);

_root.corporateidtext_mc.corpid.text = this.var7;
} else {
trace(&quot;not loaded&quot;);
}
};

stop();

 
I tried your suggestion and It still displays the HTML tags in the text field. Do you happen to know why this might be occuring? I've clicked the &quot;Render as HTML&quot; button. I' m using Flash MX. Are the previous versions of Flash different when it comes to the process of formating using HTML?
 
Change

_root.corporateidtext_mc.corpid.text=this.var7

to

_root.corporateidtext_mc.corpid.htmlText=this.var7

Best,
D6
 
D6,
Thanks for your help. Please let me know what this is supposed to do before I try it.

Thanks again,

-Jen
 
DiamondSyxx is right! You have to use htmlText to dislay html formated text.

_root.corporateidtext_mc.corpid.htmlText=this.var7;

Regards,

oldman3.gif
 
Setting the content with .text uses standard formatting, regardless of what the text field is set to. For HTML, you'll need to use .htmlText to get MX to parse the tags.

You can also add
_root.corporateidtext_mc.corpid.html=true
before that to make sure the text field is formatted for HTML (if you've already set this manually, it shouldn't matter).
 
Thank you for your help. I didn't mean to question your knowledge of the ActionScript. I wanted to make sure I understood why this was the answer to the situation, so I wouldn't make this mistake again in the future.
Thank you very much. :0)
Jen
 
By all means, you should feel free to question my knowledge of ActionScript! ;o) I sure do sometimes... =o)

Glad it worked!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top