PDA

View Full Version : ScrollPane and dynamicaly resizing clips


koed
04-29-2004, 06:50 AM
I have a MX 2004 ScrollPane with a movieclip attached as it's content. This movieclip builds a graph by copying movieclips embedded inside, so it will dynamically grow larger, depending on the graph displayed.
The ScrollPane doesn't like this and will not start scrolling when the graph get's bigger. I've tried to do a refreshPane() after the graph is done building , but this ofcourse resets the movieclip.
I've even tried to set the ScrollPane's content to the movieclip after it builds. But this only works with clips from the library and not active clips, so no solutions there either. Anyone have an idea or will this not work?

A simple command to have the pane check it's content size would have been the answer...

koed
04-29-2004, 08:09 AM
Just to make sure I didn't make any mistakes I tried a workaround. I placed two pixels in the graph clip, one on each extreme edge it will ever copy itself to.
The scrollpane now loads the graphclip with the scrollbars already present in case it get's too big. It's not pretty and defintely not what I want, but it works.

So remains the question, how do I tell the ScrollPane that it's content has changes size, without completely reloading the content and thus loosing the dynamic graph.

drisner
05-06-2004, 05:33 PM
There was a recent discussion of this on the Macromedia Flash Support Forums (http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=288&threadid=816970).

The answer is to call ScrollPane.invalidate(). I did this by making it so everytime the content could possibly change size, I call _parent.invalidate() from the MovieClip that is the content of the ScrollPane.