further info, even though I suspect that I am the last one on earth using this 
framework ………

//      init
var fmt:TextLayoutFormat = new TextLayoutFormat();
var tmpInt:ISelectionManager = field.textFlow.interactionManager;
var editManager:EditManager = new EditManager();
field.textFlow.interactionManager = editManager;
//      wrap up the format change in a composite operation
var fmtSelectionState:SelectionState;
//      select the desired text and apply the new paragraph format
fmtSelectionState:SelectionState = new SelectionState(field.textFlow, 
beginIndex_p, endIndex_p);
editManager.applyParagraphFormat(fmt, fmtSelectionState:SelectionState);  
//      create the list
editManager.createList(null, fmt, fmtSelectionState:SelectionState);
//      restore the original interaction manager
field.textFlow.interactionManager = tmpInt;

See my intent ?
instead of
editManager.createList(null, fmt, fmtSelectionState:SelectionState);

I want to replace that line with:
editManager.removeList(null, fmt, fmtSelectionState:SelectionState);

would be amazing! (I am ready to kill any nested lists inside a list, so I am 
not /that/ keen :) )

anyone's up for a ride in space with me ?

> So I have this complex TLFTextField vortex where I try to let user format 
> text with … Bullet Lists for example.
> So … so so …. I have got this overly complex and deep question to whether 
> some did write this API or was it thrown together by some spaghetti monster ? 
> (ok, this is some intentional pun towards bad Adobe documenters not doing 
> their work)
> Here goes my question/remark/complaint/doom:
> Why is it /so/ hard to remove a ListElement ?
> If you wish to answer, don't bother reading, just get that:
> How can I remove a bullet list I added with EditManager.createList ?
> I see EditManager.createList (which works perfectly) but why on earth no one 
> did a 'EditManager.removeList' ???
> How can I remove a bulleted list I added with code ? Why is it not available 
> per se in the EditManager public methods ? Since when do we use a Class to 
> createSomething, and totally fail to provide the removeSomething part ?
> The only almost feasible way I found was using ListElement.moveChildren … but 
> maaaan: this only happens to be a success if you don't add button that let 
> the user decide when he/she wants to format some part of some text …
> This TLFTextField is quite a debacle. I wonder if Adobe people know that no 
> one can handle such bad APIs and documentation :'(
> Cedric, all in flames.
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Flashcoders mailing list

Reply via email to