ActionScript 3.0 :: HtmlText Resetting TextFormat Font?

Jul 4, 2008

So this only happens with text fields that are set directly on the stage at author time. Not text fields that are dynamically created through code. While yes, creating them through code is an awesome solution sometimes that's not really an option for me.

Code:
import flash.text.*;
// txt is a text field created on the stage with it's font set to "Verdana"

[code]......

View 5 Replies


Similar Posts:


ActionScript 2.0 :: Convert HtmlText Info To TextFormat Object?

May 26, 2010

conversion of htmlText ( which contains all the formatting info ) to an equivalent TextFormat object.. so that I can transfer the htmlText info ( with formatting ) to a TextFormat object and then apply them to any textfield..

You may wonder why this approach when it can be done directly using the htmlText? Cos I am trying to manipulate the text field by resizing it ( with a user-controlled handle )..It works fine when I use normal text, but when I use the html=true, the resize seems to go haywire... ( if any one has tried this earlier.. I would like to hear about getting around this )

I need to apply the formatting at the same time make it resizable ( by user ) as expected.. which could be done if the html formatting info can be applied as a TextFormat object to the text field.. rather than set the htmlText="someFormattedText".

In short, I am looking for a parser that would read the htmlText info and convert it to TextFormat object(s).

Working on AS2 - Flash 8.

View 1 Replies

TextFormat - Change The Font Size

Jan 14, 2011

In my movie, I have a dynamic textfield on the timeline starting the first frame and going to the end. At various points during the movie, I change the text in the textfield (and that works just fine), but I also want to change the font-size when I do that. I've tried using setTextFormat to a different TextFormat object, but that doesn't seem to work. Maybe someone has a better idea?

[Code]....

View 2 Replies

ActionScript 3.0 :: Set The TextFormat's Font Property?

Feb 22, 2009

i have a mc with a IDE created text field that has embedded fonts. can I use the same embedded fornt in a actionscript created textield without embedding it as a font in the library? if so what string do i set the TextFormat's font property as?

View 2 Replies

ActionScript 2.0 :: TextFormat - Customized Font Not Working?

Mar 30, 2008

I'm using a non-window default font (installed on my PC) to show in a text field. This font is also present in my library with appropriate linkage name. Now if i use this font in the TexFormat the font does not show, instead the text is shown in default 'Times' font.But if i use "Arial" as TextFormat font then the textfield's text appear in arial font, although the arial font is not present in the library.

Code:
var myformat:TextFormat = new TextFormat();
myformat.font = "MyradPro"; //"Arial" works fine.

[code]........

View 3 Replies

ActionScript 3.0 :: Change Font Size TextFormat In TextField?

Oct 11, 2010

Project: Simple Click Counter of two separate buttons.

Problem: Font size of clicks needs to be changed/increased.

link to .fla
 
Not sure where to place this code in the script below.(inserting it causes font to initially to be correct size of 20 but changes back to default when a mouse click is issued)[code]...

View 6 Replies

ActionScript 1/2 :: Text Fields Resetting Characteristics (font - Size) When Tabbing To Them And Changing

May 2, 2010

When I set up 3 input text fields, I allow the user to change the font and size of those fields. If the user selects each one with the mouse and modifys them then no problems are seen. But if the user first changes the size and font of text field 2, then tabs to that text field and starts to change the text. The font and size properties revert back to the default.

View 1 Replies

ActionScript 1/2 :: Text Fields Resetting Characteristics (font, Size) When Tabbing To Them And Changing

Jun 7, 2010

When I set up 3 input text fields, I allow the user to change the font and size of those fields. If the user selects each one with the mouse and modifys them then no problems are seen. But if the user first changes the size and font of text field 2, then tabs to that text field and starts to change the text.  The font and size properties revert back to the default.

I could re-apply the formating everytime the text field changes, but that seems like a bandaid to the problem.

View 1 Replies

ActionScript 2.0 :: HtmlText With An Embedded Font?

Jan 8, 2007

I have an html text field that I want to use as an ongoing chat field (dynamic) and since flash has alignment issues with images inside text, I thought I'd embed a nice picturesque font and then just code them apart

e.g <p><font face='_sans' size='12'>Hello </font><font size='21'> there</font></p>

The embedded font is the default font for the textbox, so only the non graphical text needs to have a font face. So in that example "Hello" would be in text and "there" would be the graphical font.

Problem is, after much trouble even getting the font to embed and appear, that the sans text never appears.Also, Iam constranied in that I have to publish as flash 6.

View 3 Replies

ActionScript 3.0 :: Label And HtmlText To Change A Font?

Jan 19, 2010

I have a timeLabel that is an instance of Label. When I trace the htmlText properties of that timeLabel I get:
 
<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">0%</FONT></P>
 
How on Earth can I change the color of this font?

View 1 Replies

ActionScript 3.0 :: HTMLText FONT Tag Doesn't Work?

Dec 27, 2011

1. I need to put different font style in one single dynamic textfield. For example,the text is :"Welcome, Fred" and I want Fred to be bold and use "Vernada" as its font while others are left as "Arial"2. I am using embeded fonts and htmltext here, the strings are loaded from external xml files3. I found in the doc that the font tag could do this. So I set the embeded fonts to "Arial" for the dynamic textfield and add <FONT ACE="Vernada">Fred</FONT>in the xml files, but it will not show "Fred" at all4. Of course I added both "Arial" and "Vernada" into the library.5. The problem is when I change the embeded fonts into "Vernada" for the dynamic textfield and modify the xml like <FONT FACE="Vernada" SIZE="25">Fred</FONT>, it works this time. I mean the character size changed to 256. My conclusion is that the font tag only works when its font-family setting for its textfild is as the same that you want to set.

View 13 Replies

Html :: Remove Font Tags From HtmlText?

Jan 16, 2012

I'd like to remove the font tags from the htmlText string produced by a TextField leaving the surrounding nodes and any bold etc tags within intact.

Example partial output of htmlText:

<P ALIGN="LEFT"><FONT FACE="ChampagneLimo" SIZE="18" COLOR="#000000" LETTERSPACING="0" KERNING="0">Lorem Ipsum</FONT></P>

My plan was to avoid trying anything with regex and create an XML object.

However if I create a new XML object containing a root node and then attempt to appendChild the htmlText string so that I have a valid XML object to manipulate I run into a problem with html entities, see example below:

<html>&lt;P ALIGN="LEFT"&gt;&lt;FONT FACE="...

How can the font tags be stripped from htmlText and how can I create a valid XML object from the htmlText string? My plan was to use the XML replace() method

View 1 Replies

AS3 :: Flash - HtmlText Is Rearranging Font Tags By Itself

Feb 27, 2012

I have the following code in AS3:

var str:String = '<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Arial" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">Lo<FONT COLOR="#0000FF">re<FONT FACE="GG Superscript">m</FONT></FONT><FONT FACE="GG Superscript"> Ip</FONT><FONT COLOR="#990000"><FONT FACE="GG

[Code]....

It seems htmlText is rearranging the html tags. Even though the output is the same, I need the original html back since I am making a text editor and the AFTER htmlText is messing up my tag calculations.

View 1 Replies

ActionScript 3.0 :: Add A New Font For Use In HtmlText And Its Not Working - Flash CS5

Nov 12, 2010

why does font embedding in Flash have to always be so difficult? I'm trying to add a new font for use in htmlText and its not working. I have a dynamic text box on the stage. I have Helvetica Medium, Helvetica Bold and Futura Bk and Futura Bk Bold fonts embedded using the Font Embedding panel. All four of these fonts work fine when I do the following:

[Code]...

View 9 Replies

ActionScript 3.0 :: Embedded Font In TextField.htmlText

Sep 24, 2009

I have 3 embedded fonts in my library and I have given them a class name.Now I would like to use these fonts in HTML in a TextField object.How do I do this? I created a stylesheet and entered the font name, but it still picks it from my harddrive, because it doesn't work on other computers where the font is not installed.I have a font embedded named "Edo", and gave it the classname Edo.[code]

View 12 Replies

ActionScript 3.0 :: Flash HtmlText Embedded Font?

Mar 19, 2011

I'm in the middle of the painful transition to AS3, and have encountered a stonewall. In AS2 you could export any font for actionscript and use its identifier (for example "Font 1") in htmlText:

my_text.htmlText = <font face="Font 1" size="20">"+Some text+"</font>"

But what's the procedure in AS3, as fonts doesn't have identifiers, only a class name?

View 1 Replies

ActionScript 3.0 :: HTMLText - Add The Font Color - Open In The Same Window

Jan 7, 2010

First off when I test this out, "Fixed!" becomes underlined too, and that only happens after I add the font color, second how do I get it to open in the same window?

[Code]...

View 1 Replies

Actionscript 3 :: HtmlText Not Showing Bold Or Italics Font?

May 11, 2010

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?

View 3 Replies

ActionScript 3.0 :: Embed Font With Inline Css For Textfield Htmltext?

Aug 20, 2010

I am having a major issue with a textfield. I have a dynamic text field which receives html so its htmlText I cant use the regular textFormat as the overrides the bold tags in the html. So I need to use css. Minor complication I have to do inline css as I cant load external data due to the project specs. Not a problem I have done inline css pretty easy. But they want a non web safe font. Again no prob I can embed fonts via the library. The problem is getting the css to use the embed font from the library. I have tried adding the font as a object to my code and then in the css referencing it via myfont.fontName, as a string etc.. 5

View 2 Replies

ActionScript 3.0 :: Flash PrintJob Ignores HTMLText With Font Face Declaration

Nov 21, 2011

I am trying to print a string with html formatting. Part of the formatting includes font face. I have found that my print job will not print any string that includes a font face declaration. I'm guessing because the font isn't embedded, but I'm not positive.

This works:
string = "<b>bold</b> not bold";

Doesn't work:
string = "<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Arial" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">this is my string</font></p></textformat>";

How can I get around this. I need the ability to print any font on a users computer.

View 1 Replies

Css :: Embedding Font In Flex Locally With A Installed Font Works, But With Url To Refer To A Ttf Font File Doesn't

Feb 7, 2011

I'm trying to embed a font in my project by using url("font.ttf") rather than local("Font Name"), but it doesn't seem to pick it up. The font in question is called "Gotham Bold". When i view the details of the font, the font weight is regular, however when i use local("Gotham Bold") in the css i have to specify fontWeight: bold or else it wont pick it up. But when I use url("folderGotham-Bold.ttf"), and specify fontWeight: bold, it says that font weight is not found for that TTF. If i remove the fontweight, there's no errors, but the font is not applied to the text.

View 2 Replies

Variable Changing But Then Resetting

May 25, 2011

I'm very new to Flash, but I have been learning loads and getting some good results so far. Browsing these forums has been a massive help. However today I have hit a problem in what should be almost the simplest line of code I know how to write (variable = x), and could do with some advice. I have a simple program containing a button which will change a variable when pressed. There is also a text-box that will output that variable. However when I press the button, the variable will change, but then immediately revert to it's previous value.

[Code]...

View 3 Replies

ActionScript 3.0 :: Variable Resetting Itself?

Jan 1, 2011

I made a simple class that's keeping a history of strings, updating it with a push() method (like an array) and with a possibility to navigate with next() and previous().Therefore my class has an array and a integer indication the current position in the array. (See full code below)Now something very strange is going on. When coming into the push() method the position variable has some value, which I can change, but everytime I try to read that variable, it gives me a 0. I've never had this kind of problem before and I simply cant find out what's wrong.The push() method

ActionScript Code:
public function push(entry:String):void [code]......

View 3 Replies

Actionscript 3.0 :: My Score Keeps Resetting

Jan 14, 2010

I have a character on the stage in my fla that when hitting a particle created in an a particle.as removes the particle. I have the code for removing the particle and also a score counter that adds one everytime a particle is removed (located in my particle.as). My problem is the score keeps resetting or I get sporadic results (not sure which) for example here I traced the results[code]...

View 1 Replies

ActionScript 2.0 :: Resetting The Scrollbar?

Mar 11, 2004

How do you reset the scrollbar in Flash? (I'm using the component, not a cusom scrollbar.)If you go here, scroll ALL the way to the bottom and then click on "Donations" - you'll see the scrollbar stays in place.How do I get it to refresh each time new text is loaded? I've tried refreshPane() and a few other things, but nothing works.

View 7 Replies

ActionScript 2.0 :: Resetting Comboboxes?

Jul 16, 2003

How do you reset combo-boxes?I have this form with combo-boxes and input textfields, and I want a button that can reset the form.The input textboxes are easy:TextBox1.text = "";

View 5 Replies

ActionScript 3.0 :: Embedded Font Into The Flash Library In An FLA File The New Font Symbol Dialog Box

Oct 1, 2009

I have imported a font into the Flash library in an FLA file this way in the New font symbol dialog box:

[Code]....

I'd like to assign this font to a TextFormat instance, but as you can see, something is wrong or missing. But what?

View 3 Replies

ActionScript 3.0 :: Change The Font Of Each Individual Label In The Combobox To Match The Font It Is Named?

Jan 16, 2010

In my application, I allow the user to change the font of a text field. They use a combobox component to select the font. Can I change the font of each individual label in the combobox to match the font it is named? Like, Microsoft Word style.

View 2 Replies

Professional :: No Dynamic Bold Font If Regular Static Font Present On Stage (CS5)?

Apr 16, 2011

I have a strange issue where a dynamic text field will not show a bold version of a font (Gerstner BQ) if the regular version is on the stage in a static text field.Remove the static text field and the dynamic text field displays the bold font correctlyI have created a test FLA to reproduce this and by turning the layer with the static text field on and off (Publish settings -> Flash -> include hidden layers [unchecked]), the issue is quite clearhis issue is so big for me that I have had to abandon a project in CS5 and start again in CS4 just to work around this.

View 19 Replies

Flex :: Embedded Font In Alert Font-family Property Doesn't Working In 4

Jan 21, 2011

I'm using Flex 4. I'm trying to apply a embedded font in all Alert components of the application, to get the same style that all the app, of course. I code in my CSS file:

[Code]...

The font-family worked to all componentes, but not to the Alert component. In alert the text message and title got unvisible. If I change to other font-family it works correctly, just the embedded font doesn't work on Alert component. Anyone got this problem? Obs: The embedded font worked in all the app, just the Alert no.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved