1

In CS6, I am trying to apply the Squiggly functionality to a TLFTextField in a movie clip. I've read the thread here: Using Squiggly in Flash CS5 and followed the setting recommendations, except my AS3 class is on the movieclip not the document. But there is no spell-checking and there is no compiler or run-time errors.

The movie clip that contains the TLF has a AS3 class called UserInput.

package  {
    import flash.display.MovieClip;

    import fl.text.TLFTextField;
    import flashx.textLayout.edit.EditManager;

    import com.adobe.linguistics.spelling.SpellUIForTLF;

    public class UserInput extends MovieClip {

        // stage instances
        public var userInput:TLFTextField;

        public function UserInput() {
            // add spell checking
            userInput.textFlow.interactionManager = new EditManager();
            SpellUIForTLF.enableSpelling(userInput.textFlow, "en_US");
        }
    }

}

I can enter text but there is no spell-checking. Am I missing something?

Thanks for your help.

Community
  • 1
  • 1
Braeburn
  • 21
  • 1
  • 6
  • Did you copy the xml and dictionaries folder as stated in the other question you linked to? If nothing else works, you might try and mimic the code in the example you linked to: instead of using the existing `TextFlow` from the `TLFTextField`, maybe you could create a new `TextFlow`, configure it, and then assign that text flow back to the text field. – Sunil D. Sep 24 '13 at 21:09
  • I did have the directories and the xml where as described. As an experiment, I changed the directory path specified in the xml to something bogus and started to get file IO errors, proving the xml is being read and the directories was found when the path was correct. Creating my own TLFTextField would be an alternative, but I thought the current should work and I must have overlooked something. – Braeburn Sep 24 '13 at 23:37
  • In Apache Flex, trying to use the existing `TextFlow` from a TLF based text field (like you're doing above) doesn't work... hence my thought that you should supply your own `TextFlow`. The solution might be as simple as: `var flow:TextFlow = new TextFlow(); flow.interactionManager = new EditManager(); SpellUIForTLF.enableSpelling(flow, "en_US"); userInput.textFlow = flow;` I'm just guessing, however, and I know next to nothing about Squigly... – Sunil D. Sep 25 '13 at 02:50
  • I misread your first comment. I thought you suggested creating my own `TLFTextField`. Now I tried creating a new `TextFlow`, both with `new TextFlow()` as you suggested and the code from the other thread. I assigned the new `TextFlow` to `userInput.textFlow`. They still didn't work. – Braeburn Sep 25 '13 at 03:34
  • I got the spell-checking to work with `var flow:TextFlow = new TextFlow(); flow.flowComposer = new StandardFlowComposer(); flow.flowComposer.addController(new ContainerController(userInput, userInput.width, userInput.height)); flow.flowComposer.updateAllControllers(); flow.interactionManager = new EditManager(); SpellUIForTLF.enableSpelling(flow, "en_US");` But there are two cursors in the field, I think, one from the new TextFlow, one from the original TextFlow. – Braeburn Sep 25 '13 at 05:44
  • Nice work! The docs don't say that you cannot replace the existing TextFlow, so I assume that is OK to do (like it is with Flex components). I'm not sure if this is the right approach or if what you saw is just a bug in the component :( – Sunil D. Sep 25 '13 at 11:38

0 Answers0