0

/t5/animate-discussions/as3-scrollpane-component-and-scrollbar-position/td-p/513859
Dec 18, 2007
Dec 18, 2007
Copy link to clipboard
Copied
Hi there:
I'm using AS3 to import, add and populate a scrollbar with textfields. I'd like to position the vertical scrollbar on the left side rather than the right side. How do I go about this using AS3?
I've searched in these and other forums, not to mention the Flash help, to no avail. If I'm missing something obvious, anyone is welcome to point it out... :)
Thanks!
Patrick

TOPICS
ActionScript
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
Advisor
,
Dec 18, 2007
Dec 18, 2007
oh okay. if you would like to adjust the position of the
scrollbar in a ScrollPane, it may be possible with a bit of work.
just from some experimentation then, i found that you can reference
the vertical scrollbar in a ScrollPane with the property
verticalScrollBar, and use this to move it, with something like:
scroller.verticalScrollBar.x=-20;
however, you'll need to wait for the content to render and the scrollbars to become active before trying to move the scrollbar. i used the 'added' even...
scroller.verticalScrollBar.x=-20;
however, you'll need to wait for the content to render and the scrollbars to become active before trying to move the scrollbar. i used the 'added' even...
Advisor
,
/t5/animate-discussions/as3-scrollpane-component-and-scrollbar-position/m-p/513860#M14335
Dec 18, 2007
Dec 18, 2007
Copy link to clipboard
Copied
which scroll component are you using? you can place a
UIScrollBar anywhere on screen and by specifying its
scrollTargetName, control a symbol such as a textfield elsewhere on
screen. so the scroller could be on the left, right, or even
rotated 180 degrees if you really want to confuse your
users!
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/animate-discussions/as3-scrollpane-component-and-scrollbar-position/m-p/513861#M14336
Dec 18, 2007
Dec 18, 2007
Copy link to clipboard
Copied
Hi Craig:
Sorry, my subject line said ScrollPane, the body of my post said scrollbar...
I understand I can add ScrollBars willy nilly to content on the screen & adjust their position. I'm currently using a ScrollPane component, and would like to set the ScrollPane's Scrollbar to the left side.
Do you know the easies way to do that?
I'm creating everything via AS3, rather than setting things 'physically' on the stage and referencing them.
Thanks!
Sorry, my subject line said ScrollPane, the body of my post said scrollbar...
I understand I can add ScrollBars willy nilly to content on the screen & adjust their position. I'm currently using a ScrollPane component, and would like to set the ScrollPane's Scrollbar to the left side.
Do you know the easies way to do that?
I'm creating everything via AS3, rather than setting things 'physically' on the stage and referencing them.
Thanks!
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Advisor
,
/t5/animate-discussions/as3-scrollpane-component-and-scrollbar-position/m-p/513862#M14337
Dec 18, 2007
Dec 18, 2007
Copy link to clipboard
Copied
oh okay. if you would like to adjust the position of the
scrollbar in a ScrollPane, it may be possible with a bit of work.
just from some experimentation then, i found that you can reference
the vertical scrollbar in a ScrollPane with the property
verticalScrollBar, and use this to move it, with something like:
scroller.verticalScrollBar.x=-20;
however, you'll need to wait for the content to render and the scrollbars to become active before trying to move the scrollbar. i used the 'added' event like so:(see attached code below)
the only problem is that the background of the scrollbar still exists, but you may be able to remove this with skins or fudge a graphic over the top of it to hide it.
scroller.verticalScrollBar.x=-20;
however, you'll need to wait for the content to render and the scrollbars to become active before trying to move the scrollbar. i used the 'added' event like so:(see attached code below)
the only problem is that the background of the scrollbar still exists, but you may be able to remove this with skins or fudge a graphic over the top of it to hide it.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/animate-discussions/as3-scrollpane-component-and-scrollbar-position/m-p/513863#M14338
Dec 19, 2007
Dec 19, 2007
Copy link to clipboard
Copied

Craig, it works! ...but you already knew that. Thanks for taking the time to tinker.
I had been playing with the BaseScrollPane.as, thinking that would affect the ScrollPane component, but altering drawLayout() had no effect.
From perusing BaseScrollPane, I'd been trying to target "_ verticalScrollBar"... Argh!
I would have never come up with listening for the event "added". That is not exactly obvious, from the Flash Help documentation, as being an available event for the ScrollPane.
I'll attach my current working code below.
Thanks again, and
Cheers,
Patrick
ps: I don't seem to have the issue with the scrollbar background -- the entire thing moves around for me.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Advisor
,
/t5/animate-discussions/as3-scrollpane-component-and-scrollbar-position/m-p/513864#M14339
Dec 19, 2007
Dec 19, 2007
Copy link to clipboard
Copied
no problem - glad its working sufficiently for you.
a little tip with flash help also - when you're looking at the methods, properties, events, styles for a class, click on 'Show Inherited ...' to see the complete list for this class. this is how you could have discovered 'added' for ScrollPane for example.
a little tip with flash help also - when you're looking at the methods, properties, events, styles for a class, click on 'Show Inherited ...' to see the complete list for this class. this is how you could have discovered 'added' for ScrollPane for example.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/animate-discussions/as3-scrollpane-component-and-scrollbar-position/m-p/513865#M14340
Dec 20, 2007
Dec 20, 2007
Copy link to clipboard
Copied
Hi Craig:
Thanks for the tip!
I wish I could set all those "Show Inherited" toggles to be down by default. :)
Cheers,
Patrick
ps: not sure how to edit the code above, but my code's got an error in it:
myScrollPane.removeEventListener(scrollbarAdded);
should be:
myScrollPane.removeEventListener("added",scrollbarAdded);
Thanks for the tip!
I wish I could set all those "Show Inherited" toggles to be down by default. :)
Cheers,
Patrick
ps: not sure how to edit the code above, but my code's got an error in it:
myScrollPane.removeEventListener(scrollbarAdded);
should be:
myScrollPane.removeEventListener("added",scrollbarAdded);
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

