ScrollPane, scrollbar and scroll to bottom
Today i made another one of those lovely discoveries... Maybe you recognize the situation, you know you did it right, but it just won't go.
Anyway, i was playing around with the Flash ScrollPane for the store builder. I want to use it for the "item editor" :)
So dynamically creating clips in a ScrollPane.
But then you also want the scrollbar to scroll to the bottom of the page where you newly placed item is.
After a while i figured it out.
This little line makes the Pane scroll to the bottom :
MyPane.vPosition = MyPane.maxVPosition;
But....
When you have just created a new clip in it's content. The *(%$%# doesn't update it's maxVPosition yet...
So, in order to make this work you need to use a setInterval (flash mx) and in flash 8 :
setTimeout(ScrollToBottom,100);
function ScrollToBottom()
{
MyPane.vPosition = MyPane.maxVPosition;
}
nice no? those undocumented thingys?
Hope it helps someone.
Oh, MyPane.invalidate(); helps with content masking stuff...
Anyway, i was playing around with the Flash ScrollPane for the store builder. I want to use it for the "item editor" :)
So dynamically creating clips in a ScrollPane.
But then you also want the scrollbar to scroll to the bottom of the page where you newly placed item is.
After a while i figured it out.
This little line makes the Pane scroll to the bottom :
MyPane.vPosition = MyPane.maxVPosition;
But....
When you have just created a new clip in it's content. The *(%$%# doesn't update it's maxVPosition yet...
So, in order to make this work you need to use a setInterval (flash mx) and in flash 8 :
setTimeout(ScrollToBottom,100);
function ScrollToBottom()
{
MyPane.vPosition = MyPane.maxVPosition;
}
nice no? those undocumented thingys?
Hope it helps someone.
Oh, MyPane.invalidate(); helps with content masking stuff...
8 Comments:
Another ScrollPane v2 component issue is scrollpane not (or stops) masking its content.
I've run into this issue occasionally.
After searching the internet, I haven't found a ready-to-use recipe so then I've found sure and legal my own way to fix it:
myScrollPane.content.setMask( myScrollPane.mask_mc );
myScrollPane.invalidate();
And all works good! Scrollpane starts masking its content as it must be.
I've decided to post it here because your blog entry is at the top in search results by "scrollpane masking content" request -- so i hope my 2 cents will help someone.
Thank you so much... this is a really old post but I just came across it and it saved me a lot of trouble.
Cheers!
Chris
Thanks@! helped me.
Prakashan
www.plashmaddy.blogspot.com
Thanks man! those damn undocumented buggy features take years off my life - Good Karma!
Dude - ran into this today. Thanks for posting!!
Just what I needed... TNX!
So that's why it didn't work.. Thanks for posting this!
Nice one there pal!
THankxs.
Post a Comment
<< Home