Skip to main content
Inspiring
June 4, 2009
Question

StatusChangeEvent sent twice?

  • June 4, 2009
  • 1 reply
  • 635 views

Hi again

I have noticed that the StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGE calls my event handler twice.

Is this the way it is supposed to work or something in my code?

I have placed the listener on the textFlow after the call to updateAllControllers.

By the way is the code for this text editor (where I am now typing my question) available somewhere?

I am especially interested in the method for inserting the graphic smiley.

regards

Micheal

This topic has been closed for replies.

1 reply

Adobe Employee
June 4, 2009

The StatusChangeEvent can be sent multiple times - more than twice in fact.

I reccomend writing the handler like this:

private function graphicStatusChangeEvent(e:StatusChangeEvent):void

{

    if (e.status == InlineGraphicElementStatus.READY || e.status == InlineGraphicElementStatus.SIZE_PENDING)

        e.element.getTextFlow().flowComposer.updateAllControllers();

}

mxcAuthor
Inspiring
June 4, 2009

Thanks for your reply. Thats the solution I arrived at after so experiments so glad to hear its the right way to do it

regards

Micheal