Flash :: Focus Out Event For TLFTextField?
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
Similar Posts:
Sep 14, 2010
can I set the keyboard focus for a TLFTextField? I tried stage.focus = myTLF but there is no cursor...
View 2 Replies
Jul 7, 2010
I have been trying to understand why it will not work for me. I am working on the timeline in FLASH CS5.
View 1 Replies
Jan 17, 2011
Is it possible to override the default focus event on the in-built TextField class? So for example when a textfield gains focus a custom event is triggered rather than the default one? I know we can use the onSetFocus event, however we have over 1200 swfs that use TextFields so want to do it on a global scope rather than having to modify each individual swf.
The idea is that on an Android tablet selecting a TextField brings up the android keyboard that not only shrinks the flash content, but defaults to the alpha keyboard when all we want is numeric (it's a Maths app).
View 1 Replies
Jan 15, 2011
My Sprite class keeps losing focus when I click with the mouse - specifically after the MOUSE_DOWN event (before the click is complete).
I have set mouseEnabled to false on the children, no change. I added a listener for FOCUS_OUT and noticed that the FocusEvent.relatedObject property is NULL, which is confusing me - doesn't that mean there is no new focus target, the focus is just getting lost?
The exact sequence of events I get, by tracing them, as I click:
[FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=null shiftKey=false keyCode=0]
[MouseEvent type="mouseDown" bubbles=true cancelable=false eventPhase=2 localX=355
[Code]....
View 2 Replies
Jul 18, 2011
Is there a 'onFocus' event for individual radio buttons, or is it limited to the radiobutton group ?If there is a focus event for the buttons, how to I set it up ? I've set up an event listener with an 'onFocus' event, 'gotFocus' event, 'focus' event and nothing is triggered...
View 3 Replies
Jan 17, 2011
Is it possible to override the default focus event on the in-built TextField class? So for example when a textfield gains focus a custom event is triggered rather than the default one? I know we can use the onSetFocus event, however we have over 1200 swfs that use TextFields so want to do it on a global scope rather than having to modify each individual swf. that on an Android tablet selecting a TextField brings up the android keyboard that not only shrinks the flash content, but defaults to the alpha keyboard when all we want is numeric (it's a Maths app).
View 1 Replies
Sep 1, 2008
I have a simple form that I'm building. It has a variable length list of entries, and I'm using a TextInput for each entry.
Because the list is variable in length, I'm allowing the user to delete elements from the list. One of the ways they can do this is to press the backspace key when the cursor is in an empty TextInput. I am handing KeyboardEvent.KEY_DOWN and checking for the backspace key, to accomplish this.
The problem I am having is that after I remove the deleted TextInput, I want to leave the focus in the TextInput above. I can do this using 'setFocus', and that works fine, however it seems that the backspace is still processing, and so after the focus is set, the content of the TextInput is delete which I don't want.
To get around this, I've created a one-shot timer with a 0ms delay which changes the focus after the KeyDown event has completed.
My workaround is successful, but feels very heavy handed. Is there a better way to achieve the same effect?
View 1 Replies
Oct 16, 2011
I'm trying to add a focus event to a text box. For some reason the Focus_in works fine, but when I go to add the focus_out event it tells me that the name I am trying to assign to the listener is an undefined property???? of course it is I just created it and the one I created just before this for the same text box works just fine. here is the code: midTermGrade_txt.addEventListener(FocusEvent.FOCUS_IN, onFocusBevel);midTermGrade_txt.addEventListener(FocusEvent.FOCUS_OUT, offfocusbevel);As stated alread the first line of code works perfectly
View 10 Replies
Dec 18, 2009
I have a custom TitleWindow component that is registered to listen for keyboard events from the user (so that esc closes the window, enter saves, etc.). However, in my testing I've found a couple cases where my keyboard event handlers don't fire. My best guess as to why this is happening is that there is some child component somewhere that has stolen focus and is stopping the keyboard events from propagating.
Unfortunately, due to the large number of components in my TitleWindow, I have no good way of knowing who has stolen the focus. My question then is, are there any good tips / techniques / tools for debugging focus issues and event propagation in Flex? Basically, I need something that will tell me who has the focus at any given time and who's handling an event at any given time... is that possible?
View 1 Replies
Sep 16, 2010
I have done an ovveride of the standard TextInput component In this component I have :
addEventListener( FocusEvent.FOCUS_OUT, handleFocusOut ); My method is trigerred when the field loose focus for another field (nice)Problem : It is trigerred alose when the whole flex application lose focus (when my field has the current focus inside my form)
View 2 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
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
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
Mar 8, 2011
[Code]...
when i have this line active(the red one) it gives me automatic focus, so no clicking to be able to detect key input so i got that going for me which is nice BUT when i have it active(not commented out) i get this big yellow line which goes away when i click it(seeBelow)
View 1 Replies
Jul 13, 2009
Does anyone know how to do this in AS3?
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
Mar 16, 2009
I have a TextField called textField on the first frame of the main timeline, and this simple code.
Code:
import flash.events.KeyboardEvent;
import flash.events.FocusEvent;
[code]......
View 2 Replies
Feb 2, 2011
I am attempting to dynamically display standard "symbol" fonts in a TLFTextField using the AS3 code below:
import fl.text.TLFTextField;
var tf:TLFTextField = new TLFTextField();
tf.tlfMarkup = "<TextFlow xmlns="http://ns.adobe.com/textLayout/2008" fontSize='14'>
[code].....
View 1 Replies
Jun 22, 2010
I am using linked TLFTextField in flash cs5 and want to access the text of a particular TLFTextField within the chain. Is there a way to access the text in a TLFtextField within a chain
View 0 Replies
Apr 28, 2011
I am trying to use a font in a loaded font SWF with a TLFTextfield, but I have been unable to get it to work. I am developing on a Mac with Flash CS5 and admittedly don't have much experience with the Text Layout Framework API.[code]...
View 0 Replies
Aug 24, 2010
I am unable to use getTextFormat on a TLFTextField. I keep getting the error TypeError: Error #1009: Cannot access a property or method of a null object reference. at fl.text::TLFTextField/getTextFormat() at Untitled_fla::MainTimeline/frame1() Here's my sample code import fl.text.TLFTextField;import flash.text.*;
[Code]...
View 2 Replies