scroll pane wont scroll with dynamic content

  • susancbk
  • Proficient
  • Proficient
  • susancbk
  • Posts: 293
  • Loc: New York City

Post 3+ Months Ago

based on my searches- this is a common problem- however I havent been able to turn up a solution- so i thought id see if anyone had come across one here.

I have a movie clip in a scroll pane. when I manually place anything ( a line, a circle, etc) in that movie clip it turns on the scrollers as neccesary.

The problem is- the content I actually need to put in the scroll pane is dynamic- it's images created using the createEmptyMovieClip which picks up picture paths from an xml file. It dosent seem to recognize this dynamic content at all - unless i manually put something into the MC- which is fine I can put in as a mask and it won't show up....

but i need the scroll pane to resize how much it scrolls based on the dynamic content (ie..i put in more pictures-- it gets bigger) right now i can only get it bigger by making that static object longer- which defeats the purpose of dynamic content and avoiding editing your fla to make updates.

i even wrote a code that would dynamically resize that static object based on how many images there were--- but this obviously didnt work because that technqiue itself was also dynamic.

any suggestions? im stumpted.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Posts: 1402
  • Loc: Philadelphia, PA

Post 3+ Months Ago

Have you tried running an
Code: [ Select ]
scrollPaneInstance.refreshPane()
upon completion of dynamic content being displayed?
  • susancbk
  • Proficient
  • Proficient
  • susancbk
  • Posts: 293
  • Loc: New York City

Post 3+ Months Ago

yup--- another website explained why that wouldnt work but i couldnt remember the explanation..
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Posts: 1402
  • Loc: Philadelphia, PA

Post 3+ Months Ago

*slaps forhead*... could be because it refreshes dynamic content so its just starting over again. Sorry, it was late and I wasn't thinking clearly.

Hmm... I know Flash MX 2004 fixed this problem with redraw(true); lemme see if I can find something for MX.

[edit]
Ok, I did my own research and found that MX2004 changed the way refreshPane() worked.

In Flash MX refreshPane() resizes the scrollbar if the height or width of your content changes. Which is what you are looking for.

In Flash MX2004 refreshPane() refreshes dynamic content in a scrollPane to update it's values. Flash MX2004 instead developed new methods of adjusting the scrollbars and that was called redraw().


So if I remember correctly from a previous post, you use MX. In which case refreshPane() is exactly what you are looking for.
  • susancbk
  • Proficient
  • Proficient
  • susancbk
  • Posts: 293
  • Loc: New York City

Post 3+ Months Ago

ok ok im getting closer--

I could only get the refresh pane to work when i put it in the button and therefor could manually call it after it was loaded.

it dosent work when i put it in a frame action- so im assuming it has to do with timing-- its being called before the content is loaded..even if i put it after that code that generates the content....
is this a safe assumption?

is there any way to control the order of operation ?

edit - also ive noticed that this refreshPane eliminates the need for me to have to manually put something in there- which is obvious and makes sense- but I just thought id mention it in case someone in the future reads this for reference :)
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Posts: 1402
  • Loc: Philadelphia, PA

Post 3+ Months Ago

How are you loading the content?

Are you parsing in a for loop?

If so, place the actions after the foor loop.
  • amur
  • Born
  • Born
  • amur
  • Posts: 1

Post 3+ Months Ago

Hi guys use scrollPane.invalidate() instead of refreshPane()
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

Thanks for the tip amur, but it's sort of a four year old post.
  • SkyL4rk
  • Born
  • Born
  • SkyL4rk
  • Posts: 1

Post 3+ Months Ago

Thanks a million for this. I have been searching and scavaging. None of the advanced AS cookbooks or any reference I have mentiones .invalidate() in stead of refresh, and it works like a dream.

4 years later ... Kudus bud, kudus!

:-)

Post Information

  • Total Posts in this topic: 9 posts
  • Users browsing this forum: No registered users and 16 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.