1 Reply Latest reply: Nov 17, 2011 2:17 PM by theRealEllurido RSS

    cut and paste error

    theRealEllurido

      In our project (using AdobeSpellingUITLF.swc version .6) we have an editable textFlow.

      If If the user has text in the textflow that contains underlined characters, and the user cuts and pastes text x amout of times (pasting before the underline), it generates an error.

      The error is:

       

      RangeError: Error #2006: The supplied index is out of bounds.

      at flash.text.engine::TextLine/getAtomBidiLevel()

      at flashx.textLayout.compose::TextFlowLine/adjustEndElementForBidi()

      at flashx.textLayout.compose::TextFlowLine/makeSelectionBlocks()

      at flashx.textLayout.compose::TextFlowLine/http://ns.adobe.com/textLayout/internal/2008::calculateSelectionBounds()

      at flashx.textLayout.elements::FlowLeafElement/http://ns.adobe.com/textLayout/internal/2008::getSpanBoundsOnLine()

      at flashx.textLayout.elements::FlowLeafElement/http://ns.adobe.com/textLayout/internal/2008::updateAdornments()

      at flashx.textLayout.compose::TextFlowLine/http://ns.adobe.com/textLayout/internal/2008::createAdornments()

      at flashx.textLayout.compose::TextFlowLine/http://ns.adobe.com/textLayout/internal/2008::recreateTextLine()

      at flashx.textLayout.compose::TextFlowLine/getTextLineInternal()

      at flashx.textLayout.compose::TextFlowLine/getTextLine()

      at flashx.textLayout.compose::TextFlowLine/getBounds()

      at com.adobe.linguistics.spelling.ui::TLFHighlighter/drawSquigglyLineAtIndex()

      at com.adobe.linguistics.spelling.ui::TLFHighlighter/drawSquigglyLineForRange()

      at com.adobe.linguistics.spelling.ui::TLFHighlighter/squiggleWord()

      at com.adobe.linguistics.spelling.ui::TLFHighlighter/drawSquiggleAt()

      at com.adobe.linguistics.spelling::SpellUIForTLF/spellCheckRangeTLF()

      at com.adobe.linguistics.spelling::SpellUIForTLF/doSpellingJob()

      at com.adobe.linguistics.spelling::SpellUIForTLF/spellCheckScreen()

      at flash.events::EventDispatcher/dispatchEventFunction()

      at flash.events::EventDispatcher/dispatchEvent()

      at flashx.textLayout.elements::TextFlow/dispatchEvent()

      at flashx.textLayout.compose::StandardFlowComposer/http://ns.adobe.com/textLayout/internal/2008::callTheComposer()

      at flashx.textLayout.compose::StandardFlowComposer/internalCompose()

      at flashx.textLayout.compose::StandardFlowComposer/updateToController()

      at flashx.textLayout.compose::StandardFlowComposer/updateAllControllers()

      at flashx.textLayout.edit::EditManager/updateAllControllers()

      at flashx.textLayout.edit::EditManager/handleUpdate()

      at flashx.textLayout.edit::EditManager/finalizeDo()

      at flashx.textLayout.edit::EditManager/doOperation()

      at flashx.textLayout.edit::EditManager/pasteTextScrap()

      at flashx.textLayout.edit::EditManager/editHandler()

      at flashx.textLayout.container::ContainerController/editHandler()

        • 1. Re: cut and paste error
          theRealEllurido Community Member

          I am able to reproduce what I believe to be a related error (RangeError: Error #2006: The supplied index is out of bounds.)

          by creating a swf using:

          ////////////////////////////////////////////////////////////////////////////////////////// /////////

          textFlow = new TextFlow();

             textHolder = new Sprite();

             var markup:XML = <TextFlow xmlns='http://ns.adobe.com/textLayout/2008'><p><span>I know  </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(textHolder, 200, 200));

             textFlow.flowComposer.updateAllControllers();

            

             textFlow.interactionManager = new EditManager();

            

             addChild(textHolder);

             SpellUIForTLF.enableSpelling(textFlow, "en_US");

          ////////////////////////////////////////////////////////////////////////////////////////// ////////

           

          Compile it then select the very first position, then repeadedly paste the string:

           

          901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678 901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678 901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678 901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678 901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678 901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678 901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678 901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678 901234567890123456789012345678901234567890112345678901234567890123456789012345678901234567 890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567 890