ActionScript 3.0 :: 10 Emedded Fonts, HTMLText Formatting Q?
Jun 17, 2009
There is something that i have been trying to figure out for a while which is stumping me.I have a setup where an air app dynamically reads files, and throws the contents to an SWF inside of it. This SWF is a Flash 10 file and contains a textField where the contents are then displayed.
I want to display the text as htmlTest so i can have it formatted. However, without embedding fonts, the htmlText is jagged and unprofessional.
Though it is a pain to figure out, I am able to embed fonts and display regular dynamic textField text, however i have not been able to a) embed fonts and b) display htmlText without the text disappearing.
View 0 Replies
Similar Posts:
Nov 6, 2008
I (well, a rather angry client) found an oddity I would like to consider a bug in formatting htmlText coming fom XML's toString() method with css.
If somehow an empty tag ends up in XML like <h1></h1>, all of the following text in the field is formatted to the CSS defined props of h1. In the (simplified DocumentClass) code below I have an XML object which has an empty h1-tag after the first sentence of the first paragraph. Placing the XML it in the field renders the text following the empty tag as bold and with the fontsize set for h1.
Strangely, if the html source is initialized as a string and put straight in the textField (see commented code), all formatting is OK.
View 10 Replies
Dec 23, 2009
how could we remove auto tag adding by htmlText Property because when we apply htmlText for a textfield it automatically add <p> and <font> tag. In my project i am saving one textfield property <p align='right'> in server but when i am assigning this value from server its changing to <p align='left'>. So how could we remove this auto formatting by htmlText? As in [URL] link there is written also "When its htmlText property is traced, the output is the HTML-formatted String, with additional tags (such as <P> and <FONT>) automatically added by Flash Player." i want to remove this auto adding tag.
View 3 Replies
Jun 23, 2009
i'm trying to format a textfield with css.in case i'm using systemfonts like arial etc it works, but other fonts won't be embedded.with embedFonts = true nothing will be displayed. why?considering the filesize, the font IS embedded..var embeddedFontClass:Class = getDefinitionByName( "Myfont" ) as Class;Font.registerFont( embeddedFontClass );
View 3 Replies
Jul 26, 2004
i'm bringing text in from an xml file and: Code:textField.html = true;textField.htmlText = myText;i use html tags in my xml file and it works great. however, assoon as i set embedFonts to true, i lose it. how can i get around this?in addition, i have another text field that i am loading xml data into. via actionscript, i attach the movie (which has a text field in it with html turned on), and set myText.htmlText = my variable. but in this case it's still not showing up. there is no issue with embed fonts here.
View 3 Replies
Feb 24, 2010
How can I embed my custom font and it's bold variant (and it's faux italic variant, because there is not real italic version) and get the b and i tags working in a htmlText field?I can use the htmlText field with system fonts (with b and i tags working) ... or I can use 1 of the embedded fonts for the whole text.but I can't seem to get flash to understand the bold and italic variants are also embedded.
createTextField("dynamic_txt", 2, 40, 170, 350, 350); dynamic_txt.embedFonts = true; var emphatic:TextFormat = new TextFormat(); emphatic.size = 40; emphatic.color = 0xFFFFFF; emphatic.font = "EurostileT"; dynamic_txt.html = true;[code]...
View 2 Replies
May 19, 2010
when the embedFonts is removed, it works perfectly as expect. Otherwise when an image is clicked, it selects the whole text around it.
testtext.htmlText="Curabitur dolor eros<a href='event:test'><img src='003.jpg'></a>eget odio.</p>";
testtext.embedFonts=true;
did anyone come across this before? is there another way to make an image clickable inside a dynamically loaded xml text?Alternatively can anyone suggest a method to style dynamic textfields instead of using html?I've tried with many different fonts, and many different stylesheets, its still the same.
View 1 Replies
Feb 25, 2010
my web site has a lots of text field. it is xml based site.it is locally run perfectly but after i upload it to my server it's text fields' fonts replace to default fonts.some text gone down.so its confused to me.i used Myridpro font.now it is replace to default font .can u tell what is the solution for that..? [URL]
View 1 Replies
Jul 11, 2010
I save my (embedded) fonts in an external file (fonts.swf) that gets loaded at runtime. Pretty standard. I also use a bunch of UI artwork generated in the Flash IDE. Some of this artwork contains static textfields (thus, not proper TextFields that can change. Just frozen glyphs). Here's the problem: if I use the same font in any static textfield and then embed that same font into my collection of runtime fonts, the runtime font will refuse to render. It's the same effect you get if you set a textfield with embeddedFonts=true to use a font that isn't embedded. If I change the static textfields to use a different font, the runtime fonts work just fine.
[Code]...
View 2 Replies
Dec 22, 2010
Edited Short Version:The Adobe Flash docs list a property embedFonts on TextAreas:
A Boolean value that indicates whether the font specified in fontFamily is an embedded font. This style must be set to true if fontFamily refers to an embedded font. Otherwise, the embedded font is not used. If this style is set to true and fontFamily does not refer to an embedded font, no text is displayed. The default value is false. Regarding the "If this style is set to true and fontFamily does not refer to an embedded font, no text is displayed" statement: How can I detect in ActionScript when this scenario happens?
TL;DR Original Version: I have a flash application which loads external .swf files containing embedded fonts, so that these fonts can be used within the main application. We're accomplishing this by using the following ActionScript code on anything which uses custom fonts:
[Code]...
View 1 Replies
Jul 21, 2010
Right I can upload the font to the server.But the only examples I can find - require registerFont(Verdana);Which means I'll need to create a new SWF with the new font embedded and reupload to the server. I need an automated way of doing this or perhaps something different altogether?
View 2 Replies
Mar 29, 2009
I've recently had to format my computer and now having a problem with the flash actionscript window: the actionscript text looks like bold, or in a different font. The problem is that when I search for something like "flash" and "fonts", no matter which other words I use, always comes a lot of things about fonts for flash files, or for flash embedding fonts, but never for the program itself. Wich font is missing in my system that flash CS3 needs?
View 1 Replies
Jan 12, 2011
if I use an <img src='images/pic.jpg' /> within a text box that is using classic text, dynamic text as its settings, it has been assigned "render text as html" and has been set to multiline, it works great, that is when my image is in the top of the text area. When I move the image to the end of the scrolling text, it makes my text block larger to accommodate the text instead of making it just scroll more.
View 2 Replies
Feb 29, 2012
context: flashplayer 9, in the same folder as the .fla I have an images folder and inside that the png I wish to display
For the life of me I can't get the img tag to work in a textfield Here is my code, what the bleep am I missing here!! (the other html tags seem to work but not image)
import flash.display.Sprite;
import flash.text.StyleSheet;
import flash.text.TextField;
[Code].....
View 2 Replies
Feb 3, 2009
I have been working with htmlText and everything is loading and appears fine with one minor exception. For some reason there is no space between paragraphs defined by the <p> tag. There will be a line break, but not the extra space between the paragraphs.
View 2 Replies
Apr 26, 2011
I been doing more programming in other languages through the past two flash changes and am now using CS5 (and AS 2.0) for work. Tell me, why doesn't this work:
Code:
this.createTextField("test",1,100,100,500,500);
test.html = true;
test.htmlText = "Hi<br><br>Hi";
No breaks show up - it appears as "HiHi"
I've tried <br /> and <BR> etc. embedFonts && regular.
View 2 Replies
Jul 2, 2009
layout mess up if use css in htmlText.ike if I do
<p><span style='display:inline;color:#6b97fe'>Tel:</span>1234567</p>
there would be a line break after </span>
OR
[code].....
View 2 Replies
Jul 21, 2010
I am having an issue using getCharBoundaries() with htmlText. In the following code, I am trying to get the location of <img> tags, so that I can then move the image to where the <img> tag in the text, rather than the image being placed on the next line. getCharBoundaries returns an actual rectangle when I use plain text, but when it's htmlText, the function returns null (I put in a trace statement just to make sure of whether I was getting null or not). I've read that getCharBoundaries() can be unpredictable; does anyone know of a workaround or why this might be happening?
[Code]...
View 3 Replies
Feb 23, 2011
I have a htmlText Field, and I wanna embed a Movieclip from my library into the text.I've tried everything for about 5 hours, nothing worked, even though the Adobe Help stated that it's possible:src: Specifies the URL to an image or SWF file, or the linkage identifier for a movie clip symbol in the library. This attribute is required all other attributes are optional. External files (JPEG, GIF, PNG, and SWF files) do not show until they are downloaded completely.
View 9 Replies
Apr 6, 2011
I am populating a dynamic text box with some information that comes from an xml.
//fill in the text
infoBox.informationText.htmlText=
"<font size='16' color='#FFFAF0'>"+calledMarkerIndex+[code]....
I am also placing an image in the text box which you can see from the url above.I would like this url to be dynamic just like the other variables that are filling in the text box calledMarkerIndex, calledMarkerDate, calledMarkerDescription.
I have another variable which specifies the url I'd like named calledMarkerContent. I've tried simply chaning the text piece for this but it does not work.
"<img src='calledMarkerContent'/>"+
I feel like maybe I am just making a scripting error. Or maybe I cannot use a dynamic variable in this place.
View 1 Replies
Mar 2, 2010
I have the following setup:wo textfields on the stage with Arial normal and Arial bold, both embedded. I then have another textfield which I am setting like so:tb.htmlText = "Test <b>Test</b>";For some reason, the bold text is not displaying as bold, but as regular weight. I have tried embedding the fonts in the library, using the [Embed] meta tag and even resorted to using CSS to force the fontFamily. Weirdly, I can use Font.enumurateFonts and see both fonts are embedded, but the textfield refused to use the bold version inside the < b > tags.I've been told this is a problem with Flash CS4 on a mac and that it will work on PC. I refuse to believe this is the case, however. Surely Adobe would have fixed this by now?
View 3 Replies
Jul 21, 2010
I am having an issue using getCharBoundaries() with htmlText. In the following code, I am trying to get the location of <img> tags, so that I can then move the image to where the <img> tag in the text, rather than the image being placed on the next line. getCharBoundaries returns an actual rectangle when I use plain text, but when it's htmlText, the function returns null (I put in a trace statement just to make sure of whether I was getting null or not). I've read that getCharBoundaries() can be unpredictable; I've attached the code as a txt file. Update: Even if I try calling getCharBoundaries on a character a few positions before the img tag, so that it's an actual character and not markup, I still get a null value returned.
View 1 Replies
May 30, 2007
problem stated in my title. Attach is my code.
Code:
this.createTextField("myText",this.getNextHighestDepth(),23,72,300,400);
//bgPic._alpha = 25;
var titleS:TextFormat = new TextFormat();
titleS.font = "TradeGothic";
[Code]...
View 3 Replies
Mar 14, 2008
I am trying to create a menu with htmlText. That is, using a textField with several "html links" that call a function (<a href='asfunction:......).I have an array with the menu's options and I use a FOR loop to create each "html link".The problem is that I need the links in one line (at least until the maximum length of the textfield's line is reached..). I was doing this:content.htmlText += "<a href:asfunction...>..." ...but the line breaks. I tried to do:
content.htmlText = content.htmlText + "<a href:asfunction...>..." ...
but it does not work, either. And, if I do:
content.htmlText = content.text + "<a href:asfunction...>..." ...
[code].....
View 1 Replies
Jun 4, 2009
I am reading some CDATA text from an XML file. This text has HTML tags in it.I want to place this text into a dynamically created textfield that has embedFonts set to true. However,when I set this to true, the html formatting doesn't work. Instead, I only see the text without any of the formating.
Now, when I comment out my embendFonts = true statement, the html formatting works, but I loose my linked, library font. (Since the font Futura is on my machine, it stil uses a jaggy (system?) version of it, I'm assuming this would be a problem on a different machine).Is it possible to use embedFonts with htmlText? Am I calling this stuff in the wrong order?
Code:
copyTformat.font = myFont.fontName;
copyTformat.size = 18;
var tf:TextField = new TextField();[code].....
View 4 Replies
Jun 10, 2009
Im my html webpage I'm using this code
Code:
<div id="example"></div>
Code:
<script type="text/javascript">
flashembed("example",
[code]....
and I wonder if i could still get this effect trough htmltext. or does it has to be done in another way
View 4 Replies
Jul 21, 2010
I am having an issue using getCharBoundaries() with htmlText. In the following code, I am trying to get the location of <img> tags, so that I can then move the image to where the <img> tag in the text, rather than the image being placed on the next line. getCharBoundaries returns an actual rectangle when I use plain text, but when it's htmlText, the function returns null (I put in a trace statement just to make sure of whether I was getting null or not). I've read that getCharBoundaries() can be unpredictable; does anyone know of a workaround or why this might be happening?
Even if I try calling getCharBoundaries on a character a few positions before the img tag, so that it's an actual character and not markup, I still get a null value returned.
[Code]...
View 1 Replies
Oct 8, 2010
I'm trying to use flashmo_225_bar_slider and the html description text works in flash cs3 but not cs5,
View 1 Replies
Nov 24, 2004
I have a xml-file wich content I need to push into an array, and afterwards i need to make a selection and add that specific array-value to the htmlText of my textfield, but he doestn looks to it as html input
Code:
xmlContent = xmlRoot.childNodes[xmlTeller].firstChild;
-->
MainArray[xmlTeller][2] = xmlContent;
[Code]....
View 1 Replies
Sep 24, 2004
I have a dynamic text field that I am loading html into. Ok... that works great. My problem lies in the use of the image tag. How do I do something like this: <p>blah dslfjskdjflskdjf </p> <img src="pic1.jpg" width="320" height="180" /> <p>more filler</p> So that the text renders, the pic renders on the line below and the next <p> renders on the line below the picture.
View 4 Replies