Answered
TextFlow and Controller Being Created Too Early?
I've successfully rolled my work with the TextFlow into a
Canvas component, made it into an SWC, and made that part of the
application it was originally designed for. No problems. Alright,
now time to re-use my work in another app. that could benefit from
a rich text component. Went through the usual motions and got all
of my UI for my text component to render except the TextFlow!
Then what I discovered is when I resized the browser window that hosting my Flex app, the cascade of resize events got the TextFlow to finish rendering, the scroll bars got adjusted properly, and it was ready to accept input with the blinking cursor.
Here is a dump from some trace statements I have in my code, I'm trying to work out the order in which events are happening and when the text flow gets proper measurements:
Composer -> Resize -> New TextFlow Dimensions -> W: 0 H: 0
Composer -> Creating Display Controller -> TextFlow Dimensions -> W: 754 H: 0
Composer -> Created
MessageEditorBase -> Created
MessageEditorBase -> Event Fired -> Resize
MessageEditorBase -> Event Fired -> Show
Composer -> Resize -> New TextFlow Dimensions -> W: 754 H: 0
MessageEditorBase -> Event Fired -> Resize
Composer -> Resize -> New TextFlow Dimensions -> W: 1328 H: 274
MessageEditorBase -> Event Fired -> Resize
Composer -> Resize -> New TextFlow Dimensions -> W: 1328 H: 275
MessageEditorBase -> Event Fired -> Resize
Composer -> Resize -> New TextFlow Dimensions -> W: 1329 H: 276
MessageEditorBase -> Event Fired -> Resize
Composer -> Resize -> New TextFlow Dimensions -> W: 1334 H: 277
MessageEditorBase -> Event Fired -> Resize
Composer -> Resize -> New TextFlow Dimensions -> W: 1350 H: 279
"MessageEditorBase" is a canvas (used as a tab) that gets displayed to the user. Within that Canvas are lots of components including the "Composer" which is basically a toolbar of elegant buttons and format functions, and then a blank canvas which holds a UIComponent and becomes the DisplayObjectController. Works great in my other app, the code is nearly line for line with Adobe's examples.
Notice how it starts 0,0; then gets a width measurement of 754; finally when I the user resize the entire application do the rest of the proper dimensions get computed.
I don't think it's a TextFlow problem, but I can't say I understand the Flex rendering hierarchy enough to have implemented TextFlow and its controller in the right way with this app.
Any thoughts? If you need more information just ask and I'll try to explain as best as possible.
Then what I discovered is when I resized the browser window that hosting my Flex app, the cascade of resize events got the TextFlow to finish rendering, the scroll bars got adjusted properly, and it was ready to accept input with the blinking cursor.
Here is a dump from some trace statements I have in my code, I'm trying to work out the order in which events are happening and when the text flow gets proper measurements:
Composer -> Resize -> New TextFlow Dimensions -> W: 0 H: 0
Composer -> Creating Display Controller -> TextFlow Dimensions -> W: 754 H: 0
Composer -> Created
MessageEditorBase -> Created
MessageEditorBase -> Event Fired -> Resize
MessageEditorBase -> Event Fired -> Show
Composer -> Resize -> New TextFlow Dimensions -> W: 754 H: 0
MessageEditorBase -> Event Fired -> Resize
Composer -> Resize -> New TextFlow Dimensions -> W: 1328 H: 274
MessageEditorBase -> Event Fired -> Resize
Composer -> Resize -> New TextFlow Dimensions -> W: 1328 H: 275
MessageEditorBase -> Event Fired -> Resize
Composer -> Resize -> New TextFlow Dimensions -> W: 1329 H: 276
MessageEditorBase -> Event Fired -> Resize
Composer -> Resize -> New TextFlow Dimensions -> W: 1334 H: 277
MessageEditorBase -> Event Fired -> Resize
Composer -> Resize -> New TextFlow Dimensions -> W: 1350 H: 279
"MessageEditorBase" is a canvas (used as a tab) that gets displayed to the user. Within that Canvas are lots of components including the "Composer" which is basically a toolbar of elegant buttons and format functions, and then a blank canvas which holds a UIComponent and becomes the DisplayObjectController. Works great in my other app, the code is nearly line for line with Adobe's examples.
Notice how it starts 0,0; then gets a width measurement of 754; finally when I the user resize the entire application do the rest of the proper dimensions get computed.
I don't think it's a TextFlow problem, but I can't say I understand the Flex rendering hierarchy enough to have implemented TextFlow and its controller in the right way with this app.
Any thoughts? If you need more information just ask and I'll try to explain as best as possible.
