Skip to main content
Participating Frequently
April 29, 2009
Question

Error #1009, Is this a bug?

  • April 29, 2009
  • 2 replies
  • 1737 views

I am using latest build of TLF (418),  when I tried to bind textFlows to the textFlow setter in SimpleEditorPanel(the Adobe example), the textFlows are from an ArrayCollection, the binding looks like:

<local:SimpleEditorPanel id="simpleEditor"
                    textFlow="{TextFilter.importToFlow(this.myModel.userResponse.pageContent.getItemAt(this.myModel.userResponse.currentPageNum).content, TextFilter.TEXT_LAYOUT_FORMAT)}" />

Basically, I need to dynamically add pages, each page stores in a textFlow,

I also added a listener to listen the damageEvent, if a textFlow's got changed, then the listener function exports the textFlow to the ArrayCollection,

I've got the following error when I tried to edit a textflow:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at flashx.textLayout.edit::EditManager/finalizeDo()
    at flashx.textLayout.edit::EditManager/doOperation()
    at flashx.textLayout.edit::EditManager/flushPendingOperations()
    at flashx.textLayout.edit::SelectionManager/enterFrameHandler()

Is this a bug? any suggestions to work around?

Thanks in advance.

This topic has been closed for replies.

2 replies

Adobe Employee
May 8, 2009

I'm not sure I have a good answer for that -- I'm not a PDF expert. Are you needing to do this from within the ActionScript application? I guess you could print it to PDF printer driver creation tool, like Acrobat. Try putting the TextFlow in the browser window using Flash Player, and then get the browser to print, targeting the Acrobat/PDF printer driver.

Hope this helps,

- robin

Adobe Employee
April 30, 2009

The DamageEvent is not a good time to export the textFlow. This should be noted in the docs for the damage event, and I have added a bug for us to update that. Basically, in response to damage event you should invalidate your state, and once the changes are complete, then you can export the flow. At the time of the damage event the text is an intermediate state in the middle of the changes. The damage event really expects an invalidation model, and is there to support a workflow where the client checks for invalidation once things are stable (e.g. on enterFrame) and does a redraw or whatever is necessary then.

Luke DuAuthor
Participating Frequently
May 1, 2009

Thank you for the reply.

I changed from DamageEvent to CompositionCompletionEvent, and it is working fine now.

Another question:

What would be the best way to export multiple textflows to a pdf file? any code samples would be really helpful.

Thanks in advance.

Luke DuAuthor
Participating Frequently
May 1, 2009

A problem I have discovered:

I saved textFlow objects in an arraycollection, when I reloaded  an object back into the editor, how comes the flowComposer property become to a null value?

Then I tried deepCopy of the textFlow object and downcasted the returned flowElement object to textFlow object, now, the textflow object has value for flowComposer property, but the interactionManager property becomes a null value.

Is this something supposed to work this way? or it's another bug?