diding w Calculating status...
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()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\compose\BaseCompose.as:2221]
at flashx.textLayout.compose::BaseCompose/createTextLine()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\compose\BaseCompose.as:892]
at flashx.textLayout.compose::ComposeState/createTextLine()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\compose\ComposeState.as:410]
at flashx.textLayout.compose::ComposeState/composeNextLine()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\compose\ComposeState.as:352]
at flashx.textLayout.compose::BaseCompose/composeParagraphElementIntoLines()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\compose\BaseCompose.as:711]
at flashx.textLayout.compose::BaseCompose/composeParagraphElement()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\compose\BaseCompose.as:608]
at flashx.textLayout.compose::ComposeState/composeParagraphElement()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\compose\ComposeState.as:297]
at flashx.textLayout.compose::BaseCompose/composeBlockElement()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\compose\BaseCompose.as:317]
at flashx.textLayout.compose::BaseCompose/composeBlockElement()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\compose\BaseCompose.as:331]
at flashx.textLayout.compose::BaseCompose/composeBlockElement()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\compose\BaseCompose.as:322]
at flashx.textLayout.compose::BaseCompose/composeBlockElement()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\compose\BaseCompose.as:331]
at flashx.textLayout.compose::BaseCompose/composeBlockElement()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\compose\BaseCompose.as:322]
at flashx.textLayout.compose::BaseCompose/composeInternal()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\compose\BaseCompose.as:593]
at flashx.textLayout.compose::ComposeState/composeInternal()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\compose\ComposeState.as:143]
at flashx.textLayout.compose::BaseCompose/composeTextFlow()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\compose\BaseCompose.as:410]
at flashx.textLayout.compose::ComposeState/composeTextFlow()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\compose\ComposeState.as:106]
at flashx.textLayout.compose::StandardFlowComposer/http://ns.adobe.com/textLayout/internal/2008::callTheComposer()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\compose\StandardFlowComposer.as:678]
at flashx.textLayout.compose::StandardFlowComposer/internalCompose()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\compose\StandardFlowComposer.as:762]
at flashx.textLayout.compose::StandardFlowComposer/updateToController()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\compose\StandardFlowComposer.as:558]
at flashx.textLayout.compose::StandardFlowComposer/updateAllControllers()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\compose\StandardFlowComposer.as:519]
at flashx.textLayout.edit::EditManager/updateAllControllers()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\edit\EditManager.as:774]
at flashx.textLayout.edit::EditManager/handleUpdate()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\edit\EditManager.as:805]
at flashx.textLayout.edit::EditManager/finalizeDo()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\edit\EditManager.as:640]
at flashx.textLayout.edit::EditManager/doOperation()[C:\Vellum\dev\output\openSource\textLayout\src\flashx\textLayout\edit\EditManager.as:589]
Thanks.
1764 Views
6 Replies
Latest reply:
Dennis Flanagan, Jan 10, 2012 11:57 AM



