Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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? :(

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
266 views
Welcome To Ask or Share your Answers For Others

1 Answer

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...