1

How do I check if two paragraph elements or two spans have the same formats?

I have two paragraphs and when I export them they have the exact same attributes:

<p fontWeight="bold"><span>Hello world</span></p>
<p fontWeight="bold"><span>Hello world</span></p>

I can find a way to get the string with regex and do a string compare but I'm sure there was a method like this which seems more robust:

paragraph1.formatsMatch(paragraph2);
ketan
  • 19,129
  • 42
  • 60
  • 98
1.21 gigawatts
  • 16,517
  • 32
  • 123
  • 231

1 Answers1

0

I think this is the answer:

var same:Boolean = myParagraph.equalUserStyles(myOtherParagraph);

It is always showing true so I have to run some more tests. But I think it only checks users styles and not textlayout format or computed format.

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flashx/textLayout/elements/FlowElement.html

1.21 gigawatts
  • 16,517
  • 32
  • 123
  • 231