Actionscript 3 :: Flash - SetTextFormat Crashes On TLFTextField?
Nov 7, 2011
We have a library with a bunch of TextFields inside MovieClips. During runtime, we make an instance of one of these, run getTextFormat on it to get the formatting, then create a bunch of TextFields in code and run setTextFormat on them to give them the same formatting.
I'm trying to do the same thing but with TLFTextFields. I have the following:
var text:TLFTextField = new classFromLib();
text.selectable = true; //required for getTextFormat to work, flash bug
textFormat = text.getTextFormat();
[Code]....
If I set textFormat.leading and textFormat.letterSpacing to null before I run setTextFormat, then everything works, but obviously the text fields don't get the leading and letter spacing that the one in the library had.
View 1 Replies
Similar Posts:
Jul 30, 2011
i am trying to apply setTextFormat function for my dynamic text filed in as 3, but its not taking. look at my code and suggest me where i am going wrong.
[Code]...
View 1 Replies
Jul 9, 2010
I'm having an issue where I don't get a "FOCUS_OUT" event called when I click around the stage. I do get the "FOCUS_IN" event when I click the TLFTextField.Here is some of the code I have:
txt_search.addEventListener(FocusEvent.FOCUS_IN, onFocusIn);
txt_search.addEventListener(FocusEvent.FOCUS_OUT, onFocusOut);
private function onFocusOut(e:FocusEvent):void[code]...
View 1 Replies
May 23, 2011
I'm using Flash CS5. I've got an embedded font loaded from an external SWF. As far as I can tell, it's embedded properly - it used to work before I switched from the classic TextField - but I needed to switch because I need the advanced ligature support. My code is:
//setting up...
var text:TFLTextField = new TLFTextField();
text.width = 530;
text.height = 330;
[Code]....
Edit: Just tried to switch the font to Arial, and it fell back to Times New Roman again. So apparently the problem is not with the embedding, but with the way I assign the font - meaning this may be less complicated than I originally thought. Scratch that, Arial worked after I changed embedFonts to false.
View 2 Replies
Nov 4, 2011
All I want to do is get the formatting properties of a TLFTextField and apply it to another TLFTextField. This was simple using the classic TextField:
var textFormat:TextFormat = text1.getTextFormat();
text2.setTextFormat(textFormat);
TLFTextField has a getTextFormat and setTextFormat function, but they are both very buggy. getTextFormat only works if you change the selectable property to true, otherwise it generates a null object error. setTextFormat generates a NaN error when some of the properties of the TextFormat object are not null.
The TextLayoutFormat object is supposed to be used instead for TLFTextFields. You set the object by doing the following:
var text1:TLFTextField = new TLFTextField();
var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
var textFlow:TextFlow = text1.textFlow;
[Code]....
But this just returned null. Does anyone know how to get the TextLayoutFormat so I can apply it to another TLFTextField?
View 1 Replies
Apr 3, 2012
For my project I am using the following:FlashDevelop 3.3.4 RTMFlash Pro CS 5 (libraries only, no code)Some time ago we started using TLFTextfields. One of the things I had to do was include the tlfruntime.swc file from the Adobe Flash CS 5 folder in the FlashDevelop project. Note that I copied this file to the project folder and included it, I didn't just include the file straight from the CS5 path. I have since been given a new computer that has Flash CS 5.5. I recompiled one of my swf libraries in CS 5.5, and now when I run the program, I get:Illegal override of createTextLine in flashx.textLayout.compose.ComposeStateI figure the tlfruntime.swc being included in the FlashDevelop project is out of date and needs to be updated with the one from CS 5.5. So I copied the tlfruntime.swc from the CS 5.5 path, include it in the FlashDevelop project (instead of the older file), but now I get this:
Illegal override of softKeyboardActivatingHandler infl.text.container.TLFContainerController.Can anyone assist with what else I need to do to get TLFTextfields working again in CS 5.5?UPDATE: I have updated FlashDevelop to 4.0.1 RTM, and now I get this error:Illegal override of createGeometry in flashx.textLayout.elements.FlowGroupElement.
View 1 Replies
Jul 15, 2010
Can anyone tell me what's the problem with this code ?
PHP Code:
var dataTextField:TLFTextField=new TLFTextField();
addChild(dataTextField);
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);
this.loaderInfo.addEventListener(Event.COMPLETE, onComplete);
function onProgress(e:ProgressEvent):void
[Code]...
it's a preloading code and it's simple, the code used to be with "TextField" and it worked OK, then I changed it to be with "TLFTextField" class but it doesn't work now. Maybe the solution is simple but I'm not familiar with the new "TLFTextField" class
View 7 Replies
Sep 30, 2010
I've a assets swc file that contains several TLFTextField objects, each one with it's style (font, color, size).
I use the following code to set a link:
var text_tf : TLFTextField;
var url : String = "www.stackoverflow.com";
text_tf.htmlText = "<a href='http://" + url + "' target='_blank'>"+url+"</a>";
This works as expected, but it changes the color of the text to blue;
What's the easiest way to configure the color of the text, without having to recreate all the TLF mechanism (ContainerController, Configuration, TextLayoutFormat, TextFlow, ParagraphElement, LinkElement, SpanElement, ...);
I was expecting something like this to work:
text_tf.textFlow.linkNormalFormat = { color:0x00ffFF, textDecoration:TextDecoration.NONE };
text_tf.textFlow.linkHoverFormat = { color:0x00ffFF, textDecoration:TextDecoration.NONE };
View 2 Replies
Dec 21, 2010
I have a TLFTextField created in Flash Professional and I'm attempting to alter it's appearance via code, in Flash Builder.
I want to retain all formatting rules already applied to the TLFTextField unless I specifically change them, however the following code:
var format:TextFormat = textField.getTextFormat();
format.align = TextFormatAlign.RIGHT;
textField.defaultTextFormat = format;
[Code]....
how to alter individual formatting properties on a TLFTextField without affecting those already set?
View 1 Replies
Nov 4, 2011
The library swf has about 280 symbols which are exported for AS3. All works fine until I make a new movieclip containing a TLFTextField, as opposed to a TextField. When I build the swf, there are no warnings or errors, but at runtime, I cannot load any asset from the library swf. The hasDefinition always returns false for every single asset. I gave the swf to a colleague who used 010 Editor to see all the definitions in the swf, and he said there were no symbols in it. I deleted the TLFTextField, rebuilt the swf, and gave it to him again. He said now it has 280 symbols in it. Somehow making a TLFTextfield and compiling is screwing up every single symbol in the swf, even though get no warnings or errors at compile time.
View 1 Replies
Oct 14, 2010
I am trying to use TLFTextField to display Hebrew language, unfortunately it is not displaying correctly. This is the code I used
[Code]...
View 3 Replies
Jan 16, 2012
I would add a scrollbar to a TLFTextField, I know that should be possible because in the official documentation scrollTarget is DisplayObject.When I try to do that, Flash CS5 gets compiler error telling me that scrollTarget only accepts standard TextField.
Code:
var txt:TLFTextField=new TLFTextField();
var scrollBar:UIScrollBar=new UIScrollBar();
scrollBar.scrollTarget=txt; //error
View 4 Replies
Apr 21, 2011
I'm compiling a Flash project to an iPhone IPA file from the command line. I have an editable TLFTextField on the stage, but whatever I do, the softKeyboard on iOS won't pop up. Trying to set "needsSoftKeyboard" on the TLFTextField gives me an error when testing the movie via Flash: "property not found". The movie does load correctly on iOS, but still no keyboard pops up. It also doesn't matter if I put "pan" in the application descriptor file or not.
Basically I just want a keyboard to pop up to fill in text in an input field. What am I missing?
View 3 Replies
Aug 31, 2010
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::SimpleButton@28cfdfa1 to fl.text.TLFTextField. at editor/setmyFormat().There is no SimpleButton in this project, so I cannot figure this one out.this is the line of code causing the problem.
var mainText:TLFTextField = TLFTextField(e.target);
View 3 Replies
Feb 22, 2009
Im looking for a script to set a textFormat on characters between < and >...ive tried a wild guess:
inputText.setTextFormat("<",">",myTextFormat);
View 1 Replies
Jan 17, 2010
i've a text with a very long list of words to highlight and calling setTextFormat() one for each word takes ages. There's some way to speedup this operation ? i've tried with a TextField not instantiate in the DisplayObject's list, to bypass the rendering stage but i've founded that the performance are the sam
View 3 Replies
Jul 21, 2010
My array looks like this[code]...
im getting that? what is the proper way of passing the myFormat to the setTextFormat.
View 1 Replies
Sep 2, 2009
I set a textformat and apply it with setTextFormat, this is fine when my movie runs however when I try and change the text (with a mouse over of a button) this formatting disappears and have to set it again after I have changed the value of the text box. Why does it resort back to the original formatting? Is there not a way to set a textfield and keep it set?
function setText(evt:MouseEvent) {
clientText.text = "hello2";
clientText.setTextFormat(myFormat);
}
View 1 Replies
May 23, 2011
I created a text editor in AS3 to administer a site online, but i have a problem when i select a word, put it in bold, save the text and load it, all the text after this word becomes bold too. (to put a word in bold i select that world and use a button that turn this word in bold)Here is my code
Code:
var formatGlobal12:TextFormat = new TextFormat ("_serif", 12);
txt_references_springbok_fr.setTextFormat (formatGlobal12);
[code].....
View 2 Replies
Jan 10, 2011
This is a very common issue but is still pissing me off.I've this code:
item.addEventListener(MouseEvent.CLICK, function(e) { var style:TextFormat = new TextFormat(); style.underline = true; e.currentTarget.label.text.setTextFormat(style);
[code]......
View 1 Replies
Jun 2, 2011
I am trying to get setTextFormat working, but I can't seem to get it to work. The textfield appears and has the text I want, however, the font is just not changing.Here is my code:
package {
import flash.display.MovieClip;import flash.text.TextField;import flash.text.TextFormat; public class Photograph extends MovieClip {
[code]........
View 12 Replies
May 4, 2011
i'm unsuccessfully attempting to assign a textFormat to two different parts of the same string, but the second time it doesn't register and remains the default text format. both styles (regular and bold) of the font are embedded.
[Code]...
View 1 Replies
Dec 3, 2011
I've written some code that uses setTextFormat to apply formatting to textFields. I need to change it now so if a textfield has a particular title it adds to the formatting (capitalizing it). There's several workarounds I could use but ideally I would like to either create an override for the setTextFormat or textFormat classes that checks the name of the textfield and if it's a particular name before applying all the other specified formatting capitalises it. I know how to override a setter such as (width or height) but can't find any info on overriding a specific property.
View 2 Replies
Jul 21, 2009
Is it possible to maintain the style format I've applied to my dynamic textfield when using css?What I'm trying to accomplish: I'm trying to get the url links in my cdata from my xml file ( <a href="">link</a> ) to underline, and if even more so possible, to bold or change font color for that link. And I'd like to avoid just using the <u> tag in the cdata instead.I know you can just use a stylesheet to accomplish that, but I've already set up my script to use the setTextFormat method and when I try to combine the two, it seems that I lose my embedded font.Heres what I have now for my textfield, which is also successfully pulling the style from a xml file.[code]
View 0 Replies
Dec 21, 2011
I create 30 text fields dynamically on the stage and want to set text format for all text fields. I use 'setTextFormat'. It works fine for single text box. But not working if I give this in loop. See the code below. It creates thirty input text boxes on the stage. But it assigns text format only to the last text box. When code Copied and placed in frame 1. The stage size should be 800 x 600. Execute the program and type in the last text field. I want that to happen for all text boxes.
ActionScript Code:
var xtpos:Number = 10;
var ytpos:Number = 10;
var i,j:Number=0;
var depth:Number = 100
var k:Number=0;
[Code] .....
In the above it traces only the last text field.
View 3 Replies
Jun 24, 2009
Is there a way of changing the styles of parts of a text using stylesheets, but without giving each part its own class? (Like you can do with setTextFormat by supplying the start and end character indexes). Or is there just another way of achieving the same result without using setTextFormat because you can't use it on a textfield that has a stylesheet applied to it?
View 2 Replies
Jun 29, 2009
Sometimes one works while the other doesn't, and vice versa.
View 2 Replies
Dec 29, 2011
Flash CS5.5 crashes when testing this movie using CTRL-ENTER a few times. Sometimes, a message warning that the Java Virtual Machine is running out of memory appears. I would like to know whether it is the FLA or my Flash installation that is corrupt.
see the following FLA file. [URL]
View 3 Replies
Jan 21, 2009
My flash cs3 is crashing every time I try to publish a file, why? I run vista business 32 bit I didn't have problems until today,using flash cs3 for the[code]...
View 9 Replies
Jul 18, 2009
We created a flash site, which crashes on IE. It works fine on Firefox.The problem seems to happen when the swf tries to load some MP3 files, with 'Sound.loadSound' method.
View 7 Replies