I'm using the MX components (scrollbar) to load text in my projector. When the lower (main) level loads the text into the text field all is well. Then the upper level loads it's text...again...all is well.
However, when I close the upper level and go back to my original text file in the lower movie, the scrollbar is deactivated. You can see it, but the scroller is gone and the text just flows to the bottom of the text field with no ability to scroll it.
I've tried all kinds of solutions...naming each element a unique name (scrollbar instance, text variable, etc)
I believe the issue is when the upper level gets UNLOADED. WHEN I DON'T UNLOAD THE UPPER MOVIE EVERYTHING WORKS FINE. However, It must be unloaded to view the lower level.
Here is my code:
------------------------------------------
myData1 = new LoadVars();
myData1.load("main.txt");
myData1.onLoad = addItems;
function addItems() {
mainStory.multiline = true;
mainStory.wordWrap = true;
mainStory.type = "dynamic";
mainStory.border = false;
mainStory.html = true;
mainStory.htmlText = myData1.myTextmain;
ScrollBar1.setScrollTarget(mainStory);
}
------------------------------------------
Not sure if this is the best way to handle this, but it just might work. Since you are unloading the movie in order to view the content beneath, why not just set the visibility or the alpha of the movie so that the content beneath it is visible again, as opposed to unloading the content?
If you need to show other content in that same level again, the next movie you load into that level will automatically unload the previously loaded content. Just don't forget to change the property (listed above) back to visible or alpha=100 again, so that the new content is visible.
I've already tried going that route, but I would have to rebuild much of the presentation. Each upper movie goes through a close sequence before unloading and other elements relate to it as well. It's just not an option.
Does anyone know why this is happening? Seems like it should be a simple fix.
well, if you don't want to go about the problems of changing your code so unloading does not occur, it sounds to me like you have incorporated the scrollbar component in the external movies that you are loading and NOT in the main movie...this is why you are losing the component.
To solve, make sure that the scrollbar that you are using in your main movie is in the library of your main movie and that the instance of it in that movie is brought in from it's OWN library, not that of the loaded sub-movie.
Actually, I'm using the same scrollbar component in the loaded movies as well as the main movie. . .and even the main movie is a loaded movie.
You're saying I shouldn't use the same scrollbar library item from another movie. In order to do that, I would have to share library items, right? Because I AM using the same component (scrollbar), but they are both from their respective movies. I have already tried renaming NOT JUST THE INSTANCE NAME, but also the actual names in the library.
Well, you've got me stumped for now. Anyone else? I will think about this more...if I come up with anything else, I will repost. If you get a solution, I would be interested in what it is.
I'm really the one that is stumped here. I still don't know why a MM component is giving me so much trouble. I don't see where I've done anything wrong.
So I decided to lose the component scrollbar in the upper movie and add my own. However, I'm used to the old F5 method:
loadVariablesNum("info.txt", 0);
This works fine when the swf just loads text in the same directory, but I've spent hours just trying to get this to work using subdirectories:
loadVariablesNum("support/desc/info.txt", 0);
To complicate matters, I'm loading the movie itself from within a subdirectory. So:
/projector_file
loads:
/support/mov/loadedMov.swf
which then loads:
/support/desc/myText.swf
Now, shouldn't the "loadedMov.swf" load a text file using this path:
/support/desc/myText.swf
I've tried placing the support text file everywhere but nothing works.
Is your textfield on the main timeline, or nested in some movie clip?
How are you sure the text is not loading from the paths you've tried?
Is it a long text? Have you given it enough time to load? Using any masking or tween?
There can be a lot of reasons the text is not showing up!
Have you tried typing some small text in the textfield, to start with, and does that text at least show up? If it doesn't then your problem is not necessarily your paths!
Oldnewbie-
Thanks so much for your troubleshooting suggestions. I'm pulling my hair out over here.
1) Is your textfield on the main timeline, or nested in some movie clip?
Yes, on the main timeline. No MC.
2) How are you sure the text is not loading from the paths you've tried?
Not sure, maybe I'm wrong here. Still testing.
3) Is it a long text? Have you given it enough time to load? Using any masking or tween?
No, yes, no.
4) Have you tried typing some small text in the textfield, to start with, and does that text at least show up?
Yes, and that text DOES show up. I know my swf files are loading, too, because I'll make graphical changes just to show the changes are taking place.
--
I've duped the whole setup elsewhere simplifying everything and it DOES WORK. Paths and all. So either there is some kind of complexity that is not allowing it to show or I'm just going nuts from lack of sleep.
Well, I know I'm crazy for sure. I checked just now and the thing works. After all that I don't know what happened, but plan B (using f5 scrollers) is working.
HOWEVER, I still don't understand why the flash components cancel each other out. I just realized that, after being loaded and unloaded, even the SCROLLPANE in an upper level will hide the scrollbar for a text field in a lower level.