is something being loaded in MenuItemRenderer?
Thanks for taking the time to look at this. I'm a bit baffled.
Yes, a thumbnail and some text description are dynamically being loaded into the itemRenderer. That seems to work fine as when I have 10 menu items they load the appropriate thumbnail based on a source url (haven't done the text yet but should be fine) and those are loaded into the menuHolder movieClip which starts out as a new MovieClip. When I do then go and make menuHolder (the movieClip with the itemRenderers) the source of the scrollPane, they appear in what seems to be the correct location the navigation panel (this is a slide up tray that has this scrollpane inside another movieclip) so visually everything looks right. However, the scrollbar is never enabled and if I trace the code it things the scrollpane.source movieClip height and width are 0, which might explain why the scrollbar never enables because it doesn't think the movieclip content is outside the mask area. At least that's my intuitive take on it.
PS, if I load an external SWF into the scrollPane using the exact same method, it works properly, so it has something to do with dynamically creating movieClips within the new source movieClip. If I try to set the height or width of that moveClip (menuHolder) before adding it to the pane, nothing renders. So, in summary, if I simply add the itemRenderers to a blank movieClip they render OK in what appears to be the scrollPane but width and height trace as 0 despite obviously taking up something like 600 x 800 when all the itemRenderers are done being inserted.
Message was edited by: John Hall to add PS
after loading is complete (use a listener or listeners), you'll need to invalidate() the scrollpane so it can be redrawn with the loaded content.
That was part of the original problem. Since I'm doing all of this in AS3, including creating the new instance of the scrollpane, I tried to addEventListener(Event.COMPLETE) to scrollpane but it never fires. I've also, for diagnostic grins, started a timer after the load for a second later then fire scrollpane.refreshPane() and scrollpane.update(), neither of which does anything.
So maybe there's a principle that I'm missing. What is the significant difference between a movieClip created with AS3 and an externally loaded SWF that might account for that, if you have any ideas?
1 person found this helpful
there are so many differences i don't even know where to start. but, more importantly, i don't think it's related to the problem.
you need to dispatch an event from the class that's loading external swfs to the class that contains your scrollpane. that doesn't have to be direct.
you may dispatch from one class, listen in another, dispatch from that other and eventually notify your scrollpane it should invalidate().