Skip to main content
Known Participant
February 26, 2009
Answered

verticalScrollPolicy = 'off' don't keep cursor in focus.

  • February 26, 2009
  • 3 replies
  • 3293 views
When you set DisplayObjectContainerController.verticalScrollPolicy = 'off', and Configuration.manageEnterKey = false, and type until the cursor end of the container, the cursor continues out of view, and the horizontalScrollPosition is not updated. With verticalScrollPolicy at it's default, it does keep the cursor in focus. Also is there a property to prevent line breaks from being displayed? Setting these 2 properties still allows you to paste text with line breaks and mess things up. I want line breaks to be ignored altogether.

Thanks,
Sean.
This topic has been closed for replies.
Correct answer brian_thomas2
Hi Sean,

There is no option to disable line breaks at the moment. You may need to look at stripping out all line breaks manually. Does anyone else have a better solution for this?

This is the functionality I am seeing, let me know if this what you are considering the bug: With lineBreak = 'explicit' and DisplayObjectContainerController.verticalScrollPolicy = 'off', horizontal scrolling will not occur as result of typing regardless of the value of DisplayObjectContainerController.horizontalScrollPolicy.

I am reporting this as a bug, let me know if you are seeing something different.

3 replies

Adobe Employee
April 7, 2009

Can you recheck this in a build after 393? If verticalScrollPolicy is off, we won't be able to scroll vertically to keep the cursor in view, but if the cursor goes off to the left or right and horizontalScrollPolicy is on or auto, then we should be scrolling. If this is still a problem for you, or if your expectations were different, please let us know.

Thanks!

- robin

Participant
April 8, 2009

sorry for the late reply.. this is actually what I want

I am using flex SDK 3.3.0.4852

I have a canvas with

canvas.horizontalScrollPolicy = "off";

canvas.verticalScrollPolicy = "off";

This canvas has an image in it, and I set the horizontal and vertical scroll positions programitically.

canvas.horizontalScrollPosition = canvas.maxHorizontalScrollPosition;

canvas.verticalScrollPosition = canvas.maxVerticalScrollPosition;

then I save the scroll values in an xml file, and then on reopening of the xml file.. I do the following

canvas.addEventListener("creationComplete", setScrollPositions);

and in the method setScrollPositions(event) i do the following again

canvas.horizontalScrollPosition = canvas.maxHorizontalScrollPosition;

canvas.verticalScrollPosition = canvas.maxVerticalScrollPosition;

But unfortunately it does not show any change in the scroll positions visually, and the default scroll positions persists. Though if i call an alert

Alert.show(canvas.verticalScrollPosition.toString()); //it does show me some value, e.g. 56

Now if i only set horizontal and vertical scrollPolicy = "on" ... all works fine. But the problem is that I want to hide my scrollbars and there is no other way I can do it. So please if there is any solution to it or if there is any workaround, do let me know. Thanks.

Known Participant
February 26, 2009
I have lineBreak set to 'explicit', but that's not what I want, I want line break to have an option for none.

For the bug, the problem is that the cursor does not stay visible. When you type in an html input, the text scrolls horizontally to keep the cursor in focus. This happens when you set lineBreak = 'explicit' and verticalScrollPolicy = 'auto', but not when you set verticalScrollPolicy to 'off'/'on'.

Thanks,
Sean.
brian_thomas2
Adobe Employee
brian_thomas2Correct answer
Adobe Employee
March 6, 2009
Hi Sean,

There is no option to disable line breaks at the moment. You may need to look at stripping out all line breaks manually. Does anyone else have a better solution for this?

This is the functionality I am seeing, let me know if this what you are considering the bug: With lineBreak = 'explicit' and DisplayObjectContainerController.verticalScrollPolicy = 'off', horizontal scrolling will not occur as result of typing regardless of the value of DisplayObjectContainerController.horizontalScrollPolicy.

I am reporting this as a bug, let me know if you are seeing something different.
brian_thomas2
Adobe Employee
Adobe Employee
March 13, 2009
This bug is fixed as of build 393.
Adobe Employee
February 26, 2009
If you don't want the text to wrap at the end of the line, set lineBreak="explicit" on the TextFlow. By default this is "toFit".

I'm a little confused by your earlier statement about scrolling. Is this scrolling vertically, but you expected it to also scroll horizontally?

Thanks!