-2

This is going to seem quite a lame question - basically we have downloaded a package called Squiggly - http://labs.adobe.com/technologies/squiggly/ - and we are trying to implement it into Flash (using AS3, CS5). And none of us are very good at flash, and have no clue how to do it, the actionscript in the .as is as follows:

package
{
    import flash.display.Sprite;

    import flashx.textLayout.container.ContainerController;
    import flashx.textLayout.elements.TextFlow;
    import flashx.textLayout.conversion.TextConverter;
    import flashx.textLayout.edit.EditManager;

    import com.adobe.linguistics.spelling.SpellUIForTLF;

    public class SquigglyTLFExample extends Sprite
    {
        public function SquigglyTLFExample()
        {
            var markup:XML = <TextFlow xmlns='http://ns.adobe.com/textLayout/2008'><p><span>I know &nbsp;</span><span fontStyle='italic'>Enlish</span><span>. Use the context menu to see the suggestions of the missbelled word.</span></p></TextFlow>;
            var textFlow:TextFlow = TextConverter.importToFlow(markup, TextConverter.TEXT_LAYOUT_FORMAT);
            textFlow.flowComposer.addController(new ContainerController(this, 500, 600));
            textFlow.flowComposer.updateAllControllers();

            textFlow.interactionManager = new EditManager();

            SpellUIForTLF.enableSpelling(textFlow, "en_US");
        }
    }
}

I have a blank swf, and just want to know how to implement it to a text area. Why do people still use flash? :(

rickyduck
  • 4,030
  • 14
  • 58
  • 93
  • 1
    I'm not sure questioning Flash and why people use it in the Actionscript-3 tag on SO will do you any good. Also it's not sufficient to question the usage of Flash just because you or your colleagues can't use it. Regarding your 'real' question. What is the error you're getting and how is the output from the code you posted different from your expected output? – Bakapii Jul 22 '11 at 13:01
  • Hi Bakapii. Guess I was frustrated, however this is something that would take me 5 minutes using JavaScript.. I don't understand why Adobe have made their documentation so shoddy and including a library so hard. There is no error message (there was before), I have set the lib path correctly and the src path correctly, and my actionscript file is included in the same dir as the fla. It appears all adobe want to support with this plugin is Air and Flex, unfortunately I don't have sufficient knowledge of flash to understand how it works. – rickyduck Jul 22 '11 at 13:23
  • Looks like regular old Flash is supported, I'll give it a test run. – Bakapii Jul 22 '11 at 13:29
  • Thanks very much Bakapii, I look forward to your response! – rickyduck Jul 22 '11 at 13:50
  • Hi Bakapii, just wondering if you managed to find a solution to my problem ? – rickyduck Jul 25 '11 at 10:39

2 Answers2

2

Here's how I got it running in a new FLA file in Flash CS 5:

1) In Flash, go into 'Advanced Actionscript 3.0 Settings' and change to the Librarys path tab on the middle of that pane.

2) Add the AdobeSpellingUITLF.swc.

3) When the SWC has been added, select it in the list and click the little 'I'-icon(when you hover it, it should say: 'Set linkage options for a library').

Change the link type to 'Merged into code'.

4) Add the code you posted (SquigglyTLFExample) as your Document class.

5) Remember to copy the 'AdobeSpellingConfig.xml' and the 'dictionaries'-folder to the same folder as the generated SWF-file.

The configuration in Flash should look something like this: How to properly setup the, ActionScript, Squiggly TLF Example in Flash CS 5

Bakapii
  • 1,014
  • 1
  • 7
  • 12
  • Okay, got it working, it autopopulates with "I know Enlish. Us e the context menu to see the suggestions of the missbelled word", however there is no context menu / red underline under the misspelt word or any added thereafter – rickyduck Jul 25 '11 at 15:55
  • Ok, finally got it working, the xml file & dictionary folder should be in the root relative to the FLA. Cheers Bakapii, bounty to you (in 19 hours when it lets me) – rickyduck Jul 25 '11 at 16:05
  • 1
    I added an extra step to the guide which mentions the need to copy the xml-file and the dictionaries folder. – Bakapii Jul 25 '11 at 16:23
1

i have built a class based on squiggle a while ago: http://apdevblog.com/actionscript-spell-checking-with-squiggly-as3-only-and-flash-9-compatible/

it's very easy to use and compatible with normal textfields >flash9.

cheers

Philipp Kyeck
  • 18,402
  • 15
  • 86
  • 123