Copy link to clipboard
Copied
I understand that "TLFTextField" class is currently under construction but anywhere I googled, I found some talks about the language direction thing which is not yet implemented... but I wonder if other properties are also not working? like .selectable?
this is my code and the TLFTextField won't be selected and I can't make it into type INPUT!
var textFormat:TextFormat = new TextFormat();
textFormat.font = "Arial"
textFormat.size = 15;
textFormat.color = 0x000000;
//_textFormat.direction = "ltr";
var theText:TLFTextField = new TLFTextField();
theText.autoSize = TextFieldAutoSize.LEFT;
theText.antiAliasType = AntiAliasType.ADVANCED;
theText.embedFonts = true;
theText.selectable = true;
theText.type = TextFieldType.INPUT;
theText.defaultTextFormat = textFormat;
theText.tabIndex = this._index;
theText.text = "some text";
this.addChild(theText);
Copy link to clipboard
Copied
TLF itself no longer includes anything called TLFTextField.
Flex 4 has an FTETextField which implements a subset of TextField functionality -- no scrolling, selection, editing, or hyperlinks.
Flash Pro CS5 has a TLFTextField which implements most of TextField functionality, including 'selectable'.
Gordon Smith
Adobe Flex SDK Team
Copy link to clipboard
Copied
Thanks for the reply. so do you mean that we have to wait till CS5 is launched?
What are my other choices if I want to use all those features that the old fashioned TextField class did? as you said and I also tried, FTETextField in flex SDK also doesn't support editing and selecting right now and we also don't have those features for the textFlow class. so what would you suggest if I want to have those features (MaxChars, showAsPassword, etc) with my RTL script? you know, the biggest issue is that when I got to know the TLF project, I told my client and they are expecting this, so I must find away which now I am disappointed and I'm hoping if there's an alternative here?
Thanks,
Hadi
Copy link to clipboard
Copied
> do you mean that we have to wait till CS5 is launched?
If you want the TLFTextField in Flash Pro CS5, you either have to get a beta of it or wait until it ships.
> editing and selecting ... we ... don't have those features for the textFlow class
Yes, you do. If you are using TLF by itself, just give the TextFlow an interactionManager that is either a SelectionManager or an EditManager.
And if you are using TLF inside of Flex 4 components, they support selection and editing, including in bidirectional text, because they take care of, for example, setting the interactionManager when you set the 'selectable' or 'editable' properties.
> maxChars, displayAsPassword
These aren't implemented by TLF, but TLF makes it possible for the Flex 4 components to implement them. If you want to use TLF outside of our components, take a look at how we implemented maxChars and displayAsPassword in, say, the Spark TextInput.
Gordon Smith
Adobe Flex SDK Team
Copy link to clipboard
Copied
Gordon, I read where a beta of CS5 was not going to be made available. Has this changed ?
Copy link to clipboard
Copied
After some googling, it looks like you're right... no CS5 beta.
Gordon Smith
Adobe Flex SDK team
Copy link to clipboard
Copied
Now that cs5 is here, maybe we can update this discussion.
Looks like you can now edit and select! http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fl/text/TLFTextField.html#type
Copy link to clipboard
Copied
yes, that would be so exciting to have the TLFTextField... besides waiting for FLash CS5, I wonder if the classes can be used/downloaded with any flex SDK?
Copy link to clipboard
Copied
Although http://www.eonflex.com/flex/4.1/langref/mx/core/FTETextField.html#type says INPUT is supported, in practice it is not supported.
public function set type(value:String):void
{
var message:String;
// TextField throws this RTE when invalid values are set.
if (value != TextFieldType.DYNAMIC &&
value != TextFieldType.INPUT)
{
message = getErrorMessage("badParameter", "type");
throw new ArgumentError(message);
}
if (value == TextFieldType.INPUT)
{
message = getErrorMessage("unsupportedTypeInFTETextField");
throw new Error(message);
}
}
Which leads me to believe that TLFTextField will have the same issue.
Copy link to clipboard
Copied
(I am new to understand the hierarchy of flex / TLF components, so I apologize for my ignorance).
After seeing that FTETextField cannot support text input, and then seeing Tour de Flex [4] clearly supporting text input, I dug around in the source and found SkinnableTextBase is used by Tour de Flex [4]. I guess FTETextField is only for legacy support (by means of same api) for no-input textfield objects?
My question to the flex/TLF teams --> is there a plan to make either TLFTextField or FTETextField support text input?
Copy link to clipboard
Copied
TLFTextField is part of Flash Pro and I believe it does support input. The Flash Pro team had a goal of exposing TLF's capabilities in an API like that of TextField, because they believed that designers and developers using Flash Pro would prefer this.
FTETextField is part of Flex and does not support input. It was developed to serve a narrower purpose: to allow certain legacy Halo components like <mx:Button> that expect to use a non-interactive TextField to use FTE instead. Consequently, it doesn't support all of TLF. The Flex team believed that Flex developers would prefer to use TLF in a more direct way, rather than hidden behind an older API. Therefore we developed Spark components like <s:RichEditableText>, <s:TextInput>, and <s:TextArea> which support most of TLF -- including input -- in a Flex-like way (such as using CSS styles to set default formatting).
Gordon Smith
Adobe Flex SDK Team
Copy link to clipboard
Copied
Thank you much for your comprehensive answer. That is very helpful!
(I googled around for "TLFTextField.as", hoping to find a version from CS5 out there somewhere and found http://opensource.adobe.com/svn/opensource/flex/sdk/sandbox/viatropos/trunk/frameworks/projects/spar... which just ended up confusing myself more! I assume this is a temp file from someone (hence sandbox, and it complaining when trying to compile). I should know better than to just assume what some random code is for.).
Copy link to clipboard
Copied
At one point, Flex's FTETextField was called TLFTextField, but it got renamed to avoid confusion with the one that was being developed for Flash Pro.
Gordon Smith
Adobe Flex SDK Team