Skip to main content
Participating Frequently
Sep 16, 2009 9:45 AM UTC
Question

TLF scrollPolicy

Hi Guys,

talking about the verticalScrollPolicy,

I had a movie where I used TLF component for Flash CS4, in this movie I used this code to enable vertical scroll:

---------------------------------------------------

tt=new TextLayout;

tt.verticalScrollPolicy="on";

this.addChild(tt);

---------------------------------------------------

Now I'm working with the textLayout.SWC from Flex SDK and I have problems to enable verticalScroll:

---------------------------------------------------

oTextFlow = new TextFlow();

oTextFlow = TextFilter.importToFlow(oXML, TextFilter.TEXT_LAYOUT_FORMAT);

oTextFlow.flowComposer.addController(new ContainerController(this, oWidth, oHeight));
oTextFlow.flowComposer.getControllerAt(0).verticalScrollPolicy = ScrollPolicy.ON;
oTextFlow.flowComposer.getControllerAt(0).setCompositionSize(oWidth, oHeight);
oTextFlow.flowComposer.compose();

oTextFlow.flowComposer.updateAllControllers();

--------------------------------------------------

When the height of textFlow is to small to contain the text the vertical scroll doesn't appear....

Can someone help me? thank you...

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

Participating Frequently
Sep 16, 2009 7:16 PM UTC

Try

oTextFlow.interactionManager = new SelectionManager();

or

oTextFlow.interactionManager = new EditManager();

But, vertical scroll bar will not appear because verticalScrollPolicy is just a policy that allows you to scroll. So, you need to create it by yourself.

Yoshiki Okawa

Translate
llnnAuthor
Participating Frequently
Sep 18, 2009 9:40 AM UTC

Sorry,

I'm sure does not depent on that.... when I use verticalScrollPolicy=on in TLF component for Flash CS4 it works and generates scrollbar...

Translate
Participating Frequently
Sep 18, 2009 12:33 PM UTC

Sorry for misunderstanding of your problem.

I have created my custom scrollbar which synchronizes with ContainerController.horizontalScrollPosition, and it works perfectly.

So, if you are working with a custom made scrollbar, check if TextFlow.flowComposer.composeToPosition() is called before getting an actual size of your text field by ContainerController.getContentBounds().

If not, please tell us which scrollbar you are using and, if possible, post your codes.

Yoshiki Okawa

Translate