Skip to main content
Jun 18, 2009 3:07 PM UTC
Question

Can i attach custom data to a paragraph?

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 is closed to new replies. Start a new post to keep the conversation going.

2 replies

Participating Frequently
Jun 18, 2009 7:54 PM UTC

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

Translate
Jun 18, 2009 8:25 PM UTC

Awesome!

Translate