Can you use Squiggly with a TLF text container or TextFlow? - actionscript-3

I'm creating my own TLF container as described in the TLF documentation but I want to use the Squiggly spell checker. I found a tutorial that describes how to use Squiggly but it does not show how to work with a TextFlow only TextArea. How do I use Squiggly with a TextFlow?

There is a class called, "SpellUIForTLF" that supports TLF spell checking where you can pass in a reference to the TextFlow:
import com.adobe.linguistics.spelling.SpellUIForTLF;
SpellUIForTLF.enableSpelling(_textFlow, "en_US");

Related

if statement skipped , uppercase letters not displaying

I'm making a mini game for my multimedia class using Adobe Animate with ActionScript 3.
The first question requires the user to fill in the blanks to print "hi" like in python.
the question looks like this
_____("hi")
then you would fill in the blanks and click on a check answer button.
Then to check if the answer is correct I use an if-else statement like so :
import flash.events.MouseEvent;
stop();
checkBtn1.addEventListener(MouseEvent.CLICK, checkClick);
function checkClick(event:MouseEvent): void
{
if(input1.text == "print")
{
ans1.text = "Correct!";
}
else
{
ans1.text = "Wrong answer!";
}
}
However, even if the input is correct, it will skip the if part of the code and run straight into else.
It also won't display uppercase letters?
It'll display "rong answer!" ignoring the uppercase "W".
Any ideas?
#Organis is right; The font needs to be embedded.
Flash Professional CS5 (and later) automatically embeds any characters used by text fields on the Stage. However, if you are using Dynamic or Input text fields, the project may also need to include characters for the font that aren't specifically contained in instances on the Stage during authoring. If you do not embed the necessary characters and text elements are programmatically displayed or entered by the user, the characters may be missing and the application may appear broken.
Common Mistakes Working with Fonts and Text Objects in Flash
For help embedding fonts, refer to the Adobe documentation on it.
Embedding Fonts with ActionScript
Embedding Fonts in Adobe Animate (Flash)

AS3 - Turn classic textfield into TLF textfield

I have a classic textfield on stage that I would like to turn into a TLF textfield. How can this be done?
Thank you. Uli
If on the stage in Flash Pro, you could simply change the control.
From classic text:
To TLF text:
Programmatically I don't believe there's typecasting between flash.text.TextField and fl.text.TLFTextField.
Both share a .text property; however, are different in terms of capability such as html and text flow.

Updating Flash textbox text via ActionScript

I created a text area on my stage using the text tool, then converted it to a MovieClip symbol. I called it ScoreLabel and I clicked "Export for ActionScript". I named the instance of the text area scoreLabel. However, when I do this in my code:
scoreLabel.text = this.score;
it doesn't change. That line is in my Main.as file, which is the document class. How can I change the text shown in this text area using ActionScript? Maybe I need to import a library?
Thanks.
Like I said, don't export for ActionScript - it's not necessary in your case.
You also need to assign a String to the .text property, so you have do something like this if score is a Number type:
scoreLabel.text = score.toString();
Do you get any errors, and is scoreLabel within scope from your document class, or nested in another container?

Actionscript 3 loading Chinese symbols into TextField using Actionscript

I am having trouble loading Chinese Symbols into a TextField from another TextField.
I have a dynamic drop down box that loads its text from a string within the actionscript code, however the actionscript code cannot contain chinese symbols.
I thought the easiest way around this problem would be to load the text from another TextField, however it seems to appear blank, failing to load the text.
example
base1_mc.header1.textbox_txt.text=q1.text;
base1_mc.header1.textbox_txt.text = dynamic drop down textbox.
q1.text = chinese symbols inside TextField on the stage.
I thought this would have been a simple problem, however it doesnt appear to be so.
If I try to load it using this
base1_mc.header1.textbox_txt.text=q1;
it loads some text declaring a new and empty function.
Can anyone help me out here?
Try to turn off embedFonts for TextField. I.E.:
textbox_txt.embedFonts = false.

How to stop/convert TLF textfield used in flash files when you have list to search?

My designer provides me lots of MovieClips containing buttons and its states and most of them contain a TLF TextField.
Now I do not want to check each MovieClip where a TLF TextField is used.
Can I know exactly in which MovieClips and buttons a TLF TextFields has been used so that I can convert them to a classic TextField, or any method to convert all TLF TextFields to classic automatically by the compiler itself?
I tried deleting the TLF library from publish settings: it starts giving me an error, but still not pointing me to where TLF TextFields are being used.
You can change publishing settings to Flash Player 9. TLF wasn't around then, so the IDE will automatically convert them to classic text. Note, this DOES change the visual appearance of the text, AND it may have other effects on your FLA.