Skip to main content
Inspiring
Jun 4, 2009 11:57 AM UTC
Question

StatusChangeEvent sent twice?

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

2 replies

Inspiring
Jun 4, 2009 5:25 PM UTC

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();

}

Translate
mxcAuthor
Inspiring
Jun 4, 2009 6:37 PM UTC

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

Translate