list remove
Is there any function to remove the list?
// I can modify the list, but I don't know how to remove the list. it seems that there is no function to remove
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:ai="http://ns.adobe.com/ai/2009"
xmlns:d="http://ns.adobe.com/fxg/2008/dt"
xmlns:flm="http://ns.adobe.com/flame/2008"
creationComplete="initApp()">
<fx:Script>
<![CDATA[
import flashx.textLayout.BuildInfo;
import flashx.textLayout.compose.IFlowComposer;
import flashx.textLayout.compose.TextFlowLine;
import flashx.textLayout.conversion.TextConverter;
import flashx.textLayout.edit.IEditManager;
import flashx.textLayout.edit.SelectionFormat;
import flashx.textLayout.edit.SelectionState;
import flashx.textLayout.elements.FlowGroupElement;
import flashx.textLayout.elements.ListElement;
import flashx.textLayout.elements.ListItemElement;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.elements.SpanElement;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.formats.ITextLayoutFormat;
import flashx.textLayout.formats.ListMarkerFormat;
import flashx.textLayout.formats.ListStylePosition;
import flashx.textLayout.formats.ListStyleType;
import flashx.textLayout.operations.SplitParagraphOperation;
import spark.components.TextArea;
import spark.utils.TextFlowUtil;
protected function initApp():void {
var version:String = "";
version += "TLF version: " + BuildInfo.VERSION + "<br/>"+"TLF Build number: " + BuildInfo.kBuildNumber;
var s:String = "";
s += "<TextFlow version='2.0.0' xmlns='http://ns.adobe.com/textLayout/2008'>";
s += "<p>Flex framework"+version+"</p>";
s += "<p>Flex is a free, open source framework for building highly interactive, expressive web applications that dep</p>";
s += "<p>Flex framework</p>";
s += "<p>Flex framework</p>";
s += "<p>I am a new paragraph and I'd like to start at the left below the image</p>";
s += "</TextFlow>";
messageTA.textFlow = TextConverter.importToFlow(s, TextConverter.TEXT_LAYOUT_FORMAT);
}
protected function doSetList():void
{
var interactionManager:IEditManager = messageTA.textFlow.interactionManager as IEditManager;
var selStart:int=interactionManager.anchorPosition
var selFinish:int=interactionManager.activePosition
interactionManager.selectRange(selStart,selFinish)
var lm:ListMarkerFormat=new ListMarkerFormat();
lm.listStyleType=ListStyleType.CHECK;
lm.tabStops="e20 s24";
lm.listStylePosition=ListStylePosition.INSIDE;
lm.paragraphEndIndent=5;
interactionManager.createList(null,lm)
}
private function ClearAllFormats():void{
var interactionManager:IEditManager = messageTA.textFlow.interactionManager as IEditManager;
var selStart:int=interactionManager.anchorPosition
var selFinish:int=interactionManager.activePosition
//interactionManager.selectRange(selStart,selFinish);
//interactionManager.selectAll();
//interactionManager.moveChildren()
var sState:SelectionState=new SelectionState(messageTA.textFlow,selStart,selFinish)
//interactionManager.setSelectionState(sState)
var fontF:ITextLayoutFormat=interactionManager.getCommonCharacterFormat()
var paraF:ITextLayoutFormat=interactionManager.getCommonParagraphFormat()
var conF:ITextLayoutFormat=interactionManager.getCommonContainerFormat()
interactionManager.clearFormat(fontF,paraF,conF,sState)
}
]]>
</fx:Script>
<s:VGroup left="5"
right="5"
top="10"
bottom="82">
<s:Button label="Set List At cursor position"
click="doSetList()"/>
<s:Button label="ClearAllFormat"
click="ClearAllFormats()"/>
<s:TextArea id="messageTA"
width="100%"
height="100%"
editable="true"/>
</s:VGroup>
</s:WindowedApplication>
I use clearformat function , but do nothing.........
What's more , if i want do following :
format["listStyleType"]=ListStyleType.NONE
will get an error:
ArgumentError: Error #2004: One of the parameters is invalid.
at Error$/throwError()
at flash.text.engine::TextBlock/createTextLine()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at GlobalSWFContext/callInContext()
at flashx.textLayout.compose::BaseCompose/createTextLine()
at flashx.textLayout.compose::ComposeState/createTextLine()
at flashx.textLayout.compose::ComposeState/composeNextLine()
at flashx.textLayout.compose::BaseCompose/composeParagraphElementIntoLines()
at flashx.textLayout.compose::BaseCompose/composeParagraphElement()
at flashx.textLayout.compose::ComposeState/composeParagraphElement()
at flashx.textLayout.compose::BaseCompose/composeBlockElement()
at flashx.textLayout.compose::BaseCompose/composeBlockElement()
at flashx.textLayout.compose::BaseCompose/composeBlockElement()
at flashx.textLayout.compose::BaseCompose/composeBlockElement()
at flashx.textLayout.compose::BaseCompose/composeBlockElement()
at flashx.textLayout.compose::BaseCompose/composeInternal()
at flashx.textLayout.compose::ComposeState/composeInternal()
at flashx.textLayout.compose::BaseCompose/composeTextFlow()
at flashx.textLayout.compose::ComposeState/composeTextFlow()
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()
Thanks.
