« Text Layout Framework Follow Up PureMVC SolutionIntroduction to the Text Layout Framework »

3 comments

  1. § Ken Toley Email said on :
    You need to use the edit manager to get a proper undo/redo stack.

    So if you apply a character format like bold you would do so through the edit manager to assure it can be "undone" by the edit manager.

    So apply a format:
    var cf:CharacterFormat = new CharacterFormat();
    cf.fontWeight ='bold';
    IEditManager(_textFlow.interactionManager).applyCharacterFormat(cf);

    Then Undo the last change (won't matter if it is a format):
    EditManager(_textFlow.interactionManager).undo();

    Hope that helps,

    -Ken
  2. § Richard Leggett® Email said on :
    Hi Ken thanks for the post. I've used the TLF UndoManager as you show above, but the post relates to using a seperate application-wide undo stack that every other operation in the app is using (so some-how hooking it up to use the TextFlow/EditManager), the disparity between the two is the conundrum, I can't use two seperate UndoManager because I only have one Undo button/menu option, so hooking the two up is required, bearing in mind I also have to select or re-instantiate (if deleted) the correct TextFlow and so on (but that's already in place).

    I'm thinking the cleanest solution may just be to add another undo operation that contains a TLF Operation instance (via begin/endCompositeOperation(), but still tying this up to PureMVC's Undo extension is the tricky bit and I'm keen to see if anyone at Adobe is using PureMVC (or similar), or anyone else in the community is using TLF with it.

    In short, the problem with using the built in TLF undo-manager is its integration with other undo operations in your application, which won't manifest itself in the demos but will in a full scale application?
  3. § Richard Leggett® Email said on :
    I've posted an update with a solution to this problem here:

    http://richardleggett.co.uk/blog/index.php/2009/02/19/text_layout_framework_part_3

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)
Contact. ©2010 by Richard Leggett. blog tool / UK web hosting / evoTeam.
Design & icons by N.Design Studio. Skin by Tender Feelings / SkinFaktory.