flash actionscript:
I am pulling a bunch of images into a scrollPane. And they are importing fine. The problem comes when I call the refreshPane(); to reset the scroller to scroll thru the images. As soon and I use scrollInstance.refreshPane(); the images nolonger load into the pane. anyone know why?
You must be using MX 2004. In MX, refreshPane() would update the scrollpane after you loaded content. MM deviously changed the functionality of refreshPane() in MX 2004. Now what refreshPane() should really be called is: completelyWipeOutallMyGoodThatIspentSoMuchTimeDoingandStartAllOverwithNewContent FrustratingMeIntheProcess(); But, since they took away novice mode, that would be too much to remember to type in the action script panel so they called it refreshPane() instead. What you want is: mypaneinstance.redraw(true); That will update the pane's awareness that you have new content and it will adjust the scroll bars accordingly.
[quoted text, click to view] > refreshPane() in MX 2004. Now what refreshPane() should really be called > is: > completelyWipeOutallMyGoodThatIspentSoMuchTimeDoingandStartAllOverwithNewContent > FrustratingMeIntheProcess(); But, since they took away novice mode, that > would ...
lol
No that should work assuming it is MX 2004, the path is right and you wait for the content to be loaded before executing it. The only other thing I can think of is to try to use the 'invalidate' method before the redraw but, according to the Flash documentation, you shouldn't need to. If you place dynamic content into the scrollpane, the scrollpane is only aware of the X,Y registration points of the dynamic content. If you have a scrollpane that is 200 pixels wide and place a clip in that is 300 pixels wide with its registration point in the middle, the scrollpane will think your content is only 150 pixels wide and not draw any scrollbar. It does not examine the size of the content - only its location.
I am going to take back what I said about the registration points. I think the scrollpane can determine the overall size of its content but it does seem to be time-dependent. I was looking at an old project where I was loading objects from the library. If I add dynamic content and immediately redraw, it behaves differently than if I wait a bit to do the redraw. So it looks like the scrollpane needs time to understand its content. That makes sense. I guess you could place a progess listener on it and redraw after all is complete but I have some doubts that it would always work. If I load empty clip holders into the pane and then fill those clips, the listener might only pick up the load of the empty clips. It can be gotten around with a custom listener that would ensure all added content had _width and _height before doing the redraw.
I am inserting dynamic content. Unfortunate that all this extra code has to be used to make a component work when it is meant to be drop and go. THis is my first experience with MX 2004, and every time I have used a component I have run into these obsticles. I am frustrated to the core.
I was looking at an fla I did a while ago. I stopped using the components for all the problems they have but in that movie I added dynamic content larger than the pane's normal area. I added a small background rectangle that I later resized to be larger than my content and did a redraw four times consecutively and it eventually came out the right size. When I did not add the background clip, the scrollpane only expanded to cover the mc registration points. I was digging around in the scrollpane today and it has its own load listener embedded. There are third party components and I remember a scrollpane that cost $5. At that price, the MM UI components are just not worth the time and effort. I do like MX 2004 but I don't like messing with the components any more (except for the data grid).
the completelyWipeOutallMyGoodThatIspentSoMuchTimeDoingandStartAllOverwithNewContent FrustratingMeIntheProcess(); method of the new components is what has made me just rewrite my own ones. they always work, and if I need aded functionality it is easy to add
I was looking again at my old file this AM which was created in V7.01 to see what I could find out about the load listener in the scrollpane. Now I am using V7.2. Long story short is that I was starting to trace through all the objects/functions and then decided to start all over with a new file. The V7.01 scrollpane and the V7.2 scrollpane are very different even though they look identical. I think I remember seeing this before on other components. Just be aware that if you have files created in 7.01 with components that you will not be using the 7.2 components unless you expunge the old ones from the fla in some manner (and I am not convinced that just deleting and replacing from the library alone actually works). Anyway, I am going to dig around on the 7.2 scrollpane a bit.
Don't see what you're looking for? Try a search.
|