Skip to main content
Known Participant
August 31, 2009
Question

Break stack undo in RichEditableText when I make one or more operations ApplyFormatOperation sequentially

  • August 31, 2009
  • 1 reply
  • 735 views

I found a bug with undo when I make one or more operations ApplyFormatOperation sequentially. this breaks the stack of undo, not undoing the other operations when press control-z, or call undo();

<s:RichEditableText width="500" height="500" content="Lorem ipsum dolor sit amet" id="rt" />

function applyFormat(){

     var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
     textLayoutFormat.fontSize = 20;
     textLayoutFormat.color = 0xFF0000;
     rt.setFormatOfRange(textLayoutFormat);

}

applyFormat();

//Then after I select another part of the text and call again

applyFormat(); //or more

OR

function applyFormat(){
     var cf:TextLayoutFormat = new TextLayoutFormat();
     cf.fontSize = 20;
     IEditManager( rt.textFlow.interactionManager ).applyLeafFormat(cf);

}

applyFormat();

//Then after I select another part of the text and call again

applyFormat(); //or more

This topic has been closed for replies.

1 reply

Known Participant
September 2, 2009

Hello,

Please look at this error, becouse this seems to be a bug, it made a lot of testing here and this error always happens

Thanks.

Adobe Employee
September 2, 2009

I don't doubt its a bug.  Interpreting the instructions and creating an actual bug is a bit of work.  It'd be a lot simpler if you could fill in an AS3 example program with the actual details so that running it just reproed the bug.  It will get attention much faster that way.

Follows is an AS3 template.

That would be much appreciated.

Richard

////////////////////////////////////////////////////////////////////////////////
//
//  ADOBE SYSTEMS INCORPORATED
//  Copyright 2008-2009 Adobe Systems Incorporated
//  All Rights Reserved.
//
//  NOTICE: Adobe permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
//////////////////////////////////////////////////////////////////////////////////
package
{
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
   
    import flashx.textLayout.BuildInfo;
    import flashx.textLayout.container.ContainerController;
    import flashx.textLayout.conversion.TextConverter;
    import flashx.textLayout.edit.EditManager;
    import flashx.textLayout.elements.TextFlow;
       
    public class SimpleExample extends Sprite
    {
       
        private var textFlow:TextFlow;
        private var controller:ContainerController;       
        public function SimpleExample()
        {
            stage.align = StageAlign.TOP_LEFT;
            stage.scaleMode = StageScaleMode.NO_SCALE;
           
            trace(flashx.textLayout.BuildInfo.kBuildNumber);
           
            var s:Sprite = new Sprite();
            s.x = 100;
            s.y = 100;
            addChild(s);
           
            // PUT YOUR CONTENT HERE
            var importData:String = '<?xml version="1.0" encoding="utf-8"?><TextFlow fontSize="14" paddingLeft="4" paddingTop="4" textIndent="15" whiteSpaceCollapse="preserve" xmlns="http://ns.adobe.com/textLayout/2008"><p paragraphSpaceAfter="15"><span>point text</span></p></TextFlow>'
            textFlow = TextConverter.importToFlow(importData, TextConverter.TEXT_LAYOUT_FORMAT);
           
            // Set WIDTH AND HEIGHT on CONTAINER CONTROLLER AS DESIRED
            controller = new ContainerController(s,300,300);
            textFlow.flowComposer.addController(controller);
            textFlow.interactionManager = new EditManager();
            textFlow.flowComposer.updateAllControllers();
           
            // ADD YOUR STUFF HERE MODEL CHANGES CALLS TO EDITMANAGER, CALLS TO COMPOSE, WHATEVER
        }
    }
}