flash - How do you remove styles from a FlowElement in TLF? -


i'm using following code apply padding inlinegraphicelement seems applying value , not removing it.

imagefloat = inlinegraphicelement.float; newformat = new textlayoutformat();  if (imagefloat==float.left || imagefloat==float.start) {     newformat.paddingright = 5;     inlinegraphicelement.paddingright = 5; } else if (imagefloat==float.right || imagefloat==float.end) {     newformat.paddingleft = 5;     inlinegraphicelement.paddingleft = 5; } else {     newformat.paddingleft = undefined;     newformat.paddingright = undefined; }  absolutestart = inlinegraphicelement.getabsolutestart(); textcontainermanager = richeditabletext.mx_internal::textcontainermanager richeditabletextcontainermanager; textcontainermanager.applyformatoperation(newformat, null, null, absolutestart, absolutestart+1); 

it looks ignores undefined values. i'm not sure how reset padding none.

update:
found clearformat method in edit manager class:

editmanager = richeditabletext.textflow.interactionmanager ieditmanager; currentformat = new textlayoutformat(); currentformat.paddingleft = 1; currentformat.paddingright = 1;  editmanager.clearformat(currentformat, null, null); 

i'm not sure right though. if seems work i'll add answer.

i found clearformat method in edit manager class:

editmanager = richeditabletext.textflow.interactionmanager ieditmanager; currentformat = new textlayoutformat(); currentformat.paddingleft = 1; currentformat.paddingright = 1;  editmanager.clearformat(currentformat, null, null); 

you have give value properties want undefined. values in new textlayoutformat object undefined. remove styles on flowelement, set style value other undefined , call clearformat(mytextlayoutformat) passing in object properties want remove.


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -