Skip to main content
Known Participant
January 22, 2011
Answered

Screenwriting text editor

  • January 22, 2011
  • 1 reply
  • 556 views

These forums have been a great help to us noobie programmers.  Thank you all for contributing.

I'm working on a screenwriting text editor and I'm swimming in water way over my head... which is where I tend to learn the most.

I'm needing a particular button, let's call it "Character" to do a number of things when pressed.  I need it to drop down a line, center align and all caps.  I've looked at a number of different ways of making this happen including, importToFlow, insertText and simply trying to add a child paragraph and span to the textFlow.  I've come up blank on each of these because I'm not truly gifted when it comes to understanding TLF.  Could someone point me in the right direction?

The one that made the most sense to me is importToFlow of an XML formatted paragraph and trying to convert that but I don't know what the heck I'm doing.

Thanks!

This topic has been closed for replies.
Correct answer robin_briggs

I would suggest using the methods in the EditManager class (e.g., applyFormat). If you have a TextFlow object, it has an interactionManager, and the interactionManager of an editable TextFlow is an EditManager. Using the EditManager, you can apply formatting properties directly to the text. It will apply the properties by default to whatever text is selected, but you can override this if you want by providing your own range you would like the the changes to apply to.

I would suggest looking at the SimpleEditor sample application, which is posted on our blog at:

http://blogs.adobe.com/tlf/2010/11/tlf-1-1-and-2-0-textlayouteditor-demo-source.html

I would point you in particular to the SimpleEditorPanel class, where you can see functions such as changeTextAlign.

Hope this helps,

- robin

1 reply

robin_briggsCorrect answer
Adobe Employee
January 24, 2011

I would suggest using the methods in the EditManager class (e.g., applyFormat). If you have a TextFlow object, it has an interactionManager, and the interactionManager of an editable TextFlow is an EditManager. Using the EditManager, you can apply formatting properties directly to the text. It will apply the properties by default to whatever text is selected, but you can override this if you want by providing your own range you would like the the changes to apply to.

I would suggest looking at the SimpleEditor sample application, which is posted on our blog at:

http://blogs.adobe.com/tlf/2010/11/tlf-1-1-and-2-0-textlayouteditor-demo-source.html

I would point you in particular to the SimpleEditorPanel class, where you can see functions such as changeTextAlign.

Hope this helps,

- robin