I'm not clear on what you are trying to accomplish. Could you perhaps provide an illustration?
I have a very dynamic application: the windows and components come and go, and I don't know in advance how many there will be, what the styles will be, etc.
So I want to create all components with Actionscript classes.
This is the MXML code that creates what I want.. This works fine, scrolls, mouse-wheel, all controls are effective.
<s:Scroller id="myScrollerA" width="300" height="100">
<s:RichEditableText id="myTextA" paddingTop="20">
<s:p fontWeight="bold">This is paragraph 1.</s:p>
<s:p>This is paragraph 2.</s:p>
<s:p>This is paragraph another.</s:p>
... more code here with more text
This is the Actionscript I'm starting with, but the linking between the vertical scroll bar and the text scrolling is not functioning, and there are various surprises.
sxText is an instance of my custom class which subclasses RichEditableText, with more text than will fit into the scroller.
group = new Group();
scroller = new Scroller();
scroller.viewport = group;
The scroll bar does scroll the content area, but NOT the text -- the text disappears off the top, but the revealed area at the bottom is background color: no text content.
Mouse wheel on the text area functions, but the scrolling is not reflected in the scroll bar.
Also puzzling: the thumb component of the scroll bar changes to a large vertical size, on first click into any scroll bar component.
What else do I need to do to tightly couple the scrolling of the text area and the use of the vertical scroll bar? Am I missing some skinning methods?
Thanks for your attention.
You could just create an MXML component which has the XML structure you pasted above, and use ActionScript to dynamically set the properties of it at runtime. MXML components can be instantiated just like any ActionScript class.
Thanks. I followed that path. and it works. Still some mysteries, but I'll live with them.
I'll post some sample code soon.