IDE :: Loading Contents From Text File - Bold / Italics Not Displaying
Jan 31, 2009
I'm loading content from a text file into a text field in Flash. In that text file I have some simple html tags like <b>, <i>, and <img>. I'm setting the textfield as html text:
myTextField.htmlText = myContent
The img tags work fine, but for some reason the bold and italics are not displaying...the tags are being correctly stripped from the text, but there is no bold or italic text. I'm embedding all the characters I need, but do I need to somehow embed the bold/italics versions of those characters?
I've seen this a few times and I've tried all the "fixes" but I'm still missing something here. I have "[CDATA[" tags and render as HTML turned on. My AS has HTML "true" and childNodes. However I still can't get my text to render fonts in either BOLD or italic. [URL].
I'm using HTML text formatting with a Textfield. At the moment the <u> underline tag works fine but the <b> bold tags don't work or the italics tag doesn't work either. I read somewhere that a font with bold and italics needs to be "available". I'm just using a textfield with Arial as the font - which is embedded.
I have a .doc file. I want to load the text from that file into Flash. So I convert it into a .txt using a website like this one: http:[url]..... I add in the little code at the beginning (myTextField=) and then Flash loads it fine. The only problem is any marked up text (italics, bold, underline) is lost. Is there any way to prevent this from happening? Or for Flash to load text from something other than a .txt? Or to manually reinsert html tags to the .txt and get Flash to understand them? Or something else I'm not considering?
I have a .doc file. I want to load the text from that file into Flash. So I convert it into a .txt using a website like this one: [URL] I add in the little code at the beginning (myTextField=) and then Flash loads it fine. The only problem is any marked up text (italics, bold, underline) is lost. Is there any way to prevent this from happening? Or for Flash to load text from something other than a .txt? Or to manually reinsert html tags to the .txt and get Flash to understand them? Or something else I'm not considering?
My text field correctly displays the text in the "PrimaryText.txt" file. The first line of the text shows like this: <b>Testing this text</b> instead of just showing up bold. And the "Render text as HTML" is checked.
I have a shared fonts.swf file containing a variety of fonts that my main swf uses. I have a movieclip within the fonts.swf file which is exported for runtime sharing. In my main swf i have the fonts.swf imported for runtime via a movieclip. This all works fine and allows me to use the fonts within the fonts.swf file in my main swf. All of my text fields are dynamic and created/updated via AS. I use the following method to style my text boxes(additional code removed for succinctness, this is just so you can see the overall methodology)[code]...
So I have a MovieClip asset with a dynamic textfield sitting inside of it. I export my .fla as a .swc to use within Flash Builder 4, and create instances of the asset with code, populating the text dynamically from XML.
My issue is that even though I have htmlText enabled, bold and italics tags don't appear to be working. I have a feeling it is because when I created the asset in Flash CS4, the text field makes you specify the font, and the subset of that to use (Regular, Bold, Oblique, etc).
Is there any way to get the htmlText to render bold and italics tags properly without having to completely rethink the way I'm creating all these fields?
I'm trying to load the content of a .txt file dynamically... If I leave the .txt file in the same root with the .swf it works perfectly, but I tried moving the .txt files into another folder and it stopped working...
Code: var path ="/info/myInfo.txt"; var my_lv = new LoadVars(); my_lv.onLoad = function(success) { if (success) { // actions go here... } else { trace("error load text files"); }}; my_lv.load(path);
"info" is the name of the folder the .txt file is in... I even tried upload it to my server and giving the absolute address like [URL] but nothing...
I have a dynamic text box for 3 lines of text. I styled part of the text to be bold and part of it to be regular. When i click on the button to display the text it looks right the first time but if i click on it a second time then all of the text shows up bold instead of just the few lines i assigned the bold tag to.
I have a dynamic textfield being populated with an xml files' content. I then have a css stylesheet loaded into format the text. This all works great, but what doesn't work is the ability to bold some of the words in that text. I have both the regular and bold versions of the font embedded into the swf, I can test out just a bold block of text and it works fine. The css is also working as it will change the size of the text that I tell it to. Everything is working, but for some reason I am not able to get the bolder version of the font to display in the same text box as the regular one. I have also tried to change fonts but had the same outcome.
I opened up a file that was created in cs3 flash with cs5 flash and we have some text that is bold in our actionscript code. now when i load that file with cs5 the bold text drop's out of bold and is just plain text. Does anyone know if there is a quick fix for this because what was there before the <b></b> is not working now.
I am using XML file to pass text into a SWF. How can I use styles, either inline or external, to make certain text in the middle of a sentence appear italic or colored or bold, etc. A character or somethinng that you can put right in the XML file.
Code: <mainText>You have the email message with two domain names: character here hackistan.edu character here and >kevinsgym-uoh.co<. Below is a list of resources to discover more information. Match the web site with the type of information you would expect to find.</mainText>
I have loaded text on flash from an external txt. file. But when it comes to adding html to the files such as "font face" or to simply bold the text it won't work, I have check to have the html clicked on Flash, but the text just wont change.
I've got a movieclip with a blank dynamic textbox inside. On frame 1 of this movieclip, I have the actionscript to load the contents of an external .txt file into the dynamic textbox. The problems are:
1. I have an <img> tag in the external .txt that doesn't work (actually, the text does wrap around where the img is supposed to be in the dynamic textbox, but the img itself is not appearing. 2. All <p> tags don't work, but <br> does. 3. I have an ampersand (&) in the .txt file and all text is cut off at that point when loaded into the dynamic textbox. I've tried escaping it (&) and using & to no avail.
I have built a simple Flash application that will be presented using a projector, the application will show messages in the form of questions that will come from a simple flat-file text file or XML file.
In addition to this I would also like to be able to add my own messages using a simple HTML form.
I've been looking around the web for some resources, but have been struggling to find what I am looking for. The basic idea is that the flash application will loop through these different messages from the XML, but then when a user types in a message that will also appear within these messages. Think of it as a sort of dynamic tag cloud.
I have a block of html text which is displayed to the user in a TextArea. Currently, the I have embedded the HTML as an XML object within one of my classes, but this seems like a terrible design. I would like to put the HTML in an embedded file and load it into an XML or String object.
I've tried to search for how to do this, but my searches return information on embedding images and fonts, not text which can be loaded into Strings.
Is it possible to embedded text or xml files and load them into variables in Flex?
I'm reading text from a text file and displaying it into a text field. The problem is when i read it doesn't display the text as it is in a text file. For ex - See below imageNow , as you can see, second line in the text file starts right where first line ends.But flash doesn't display it like that. I have hundreds of lines and in most cases flash spaces consumes less space then a text file. The font in both text field in Flash and notpad is to Arial so the font shouldn't be a problem.
I am trying to obtain the variables/contents of a php or a text file from my server using loadVars(), and the problem is that flash can get data from almost every server but from mine. (some shared hosting service) I just tried the code provided in the help files:
Code:
var my_lv:LoadVars = new LoadVars(); my_lv.onLoad = function(success:Boolean) { if (success) {
[code]....
I'm sure that I did no mistake in typing the URL, for it works fine in the browser (also no spaces, no freaky chars), and when i change the URL to another domain (and put the txt file on that server) everything works fine. I tried both possibilities "network access" and "local access" as well as running from an exe projector. But no chance.
I have just successfully displayed the contents of my 'gallery' xml in a grid layout to my stage. My issue is I have a fairly small area to work with and I need to put these inside a custom scroller. The custom scroller I have atm displays only text (via a TextField and URLLoader) from a txt file and I'm confused how to alter it to load my gallery images (from my xml) instead. Can I load images from the XML into the textfield? Is there an easier way of doing it.
How would one go about diplaying text from the html file within which the swf movie is embedded?
Basically i have a rotating banner on a page (jquery isn't right for this one) and wish to have the text messages within the diferent slides of the animation load from the html page.
this is a requirement from upstairs for SEO reasons.
ive been trying to build a small internet radio player and it works fine besides displaying what current song is playing to some dynamic text we have it set up to upload a plain .txt file to our website every time the song is changed it is displayed for example
Rick Astley - Never Gonna Give You Up
like i said plain text, this is the code i have that displays it, and it HALF works
I'm tring to import a text file and have a dynamic text field display a random line from that file (picture a quote-of-the-day type scenario). I've been able to import the file, but I have yet to find a way of displaying a random line from the file.
I have been asked to add support to a xml based website. I have been looking into it and have realised that it is not going to be very straight forward. The text does have english phrases in when describing products being used.
After doing some research I have found that CS3 does not 'support' rtl text. I also read that CS4 has added support, is this worth looking into? I read that it was buggy.
I found FlarabySWF which does what I think I am after, but not for all the languages I need, and only at design time rather than runtime.
I also found Gchats TextBox 3.0.0 but this didn't seem to work.
I also found some solutions using CSS, but these didn't seem to work with multiline text. See this example. It also didn't work as the text I am trying to display is bi-directional ..
Actualy, importing Arabic text is not a problem, but dealing with bidirectional text of Arabic and English within the same line is a big one.
All of the text in my dynamic text fields displays inconsistently, that is, some of the character strokes are full color and others are pale. This is with white text on a black background. I'm loading all of my text from an XML file. The smaller the font the worse it looks. The text only looks consistent if I use 24 point or larger. I've embedded the fonts in each field. The problem seems to affect all fonts.
I have a basic flash file with a button, when you hover over it, an object with dynamic text appears. Now I want text from an XML file to be pulled from it into my dynamic text box. This is what my code in my actionScript looks like so far... Code: function DisplayInfo(){ var title = items[i].firstChild; var items = channel_xml.firstChild.firstChild.childNodes; box.text1.text = title.firstChild.firstChild.nodeValue; menu_md._visible = false; box._visible = true; [Code] ..... How to simply grab the info in the description tags and whack it in my dynamic text field?