Skip to main content
June 18, 2009
Question

Can i attach custom data to a paragraph?

  • June 18, 2009
  • 1 reply
  • 626 views

I'd like to be able to add some custom fields to the paragraph formatting in a TextFlow and have those fields serialized/deserialized when importing/exporting using TextFilter. Can I extend the classes to do this?

This topic has been closed for replies.

1 reply

Participating Frequently
June 18, 2009

Every FlowElement has a userStyles:Object property to hold user-defined styles. I think you're supposed to call flowElement.setStyle("foo", "bar") to set them and flowElement.getStyle("foo") to retrieve them. I believe the TEXT_LAYOUT_FORMAT importer also will accept unknown attributes like <p foo="bar"> and put them into the userStyles.

Gordon Smith

Adobe Flex SDK Team

June 18, 2009

Awesome!