flash (macromedia):
I wonder if there is an alternative for the scrollpane component that comes with Flash MX 2004? I want to avoid using the components 'cause they make my flashmovie act strange, removeMovieClip() stops to work for example. Is there another way to create a scrollpane? I just need a textfield that can scroll. Cheers, //Erik
But I can't use the UI components, 'cause then the removeMovieClip() function stops to work and I can't remove movieclips from my flashfile. I've tried a lot of things like don't export in first frame for the components but the only solution is to not use the UI components. Is there an alternative for a scrollbar?
nsrgreg's suggestion sounds like MX rather than MX 2004. If all you want to do is scroll text, you can use the Text Area component as an alternative to the scrollpane - it is stil a component, however. If you want to avoid using components, the alternative is to make your own or else buy a third party scrollpane for $5 or so. If you use the MX 2004 components, you will not get around having to export in the first frame. I am curious about the interference you say the scrollpane causes. I have never had the scrollpane cause problems with the functionality of any other part of a movie. How do you know that the scrollpane is the culprit? What movie clip are you trying to remove? Is the clip you are trying to remove within the scrollpane?
The problem is when I put a component in a MovieClip then I can't remove MovieClips using target.removeMovieClip() With an easier example than the project I'm working on, lets say I got a MC named 'test' that is exported for actionscript and in first frame. Then in the first frame of my file I put this code: attachMovie("test", "test1", getNextHighestDepth()); test1.removeMovieClip(); stop(); It works great, but if I add a component to the stage the removeMovieClip function doesnt work anymore. The problem still exists if I remove the component so it's only in the library. But if I uncheck the export in first frame square then the code works. But if it's unchecked I can't attach the component later on in the code so it's for no use. I just don't understand why the components affect the removeMovieClip function. Is it a bug? I'm using Flash MX 2004 v7.2
What happens if you try: this.attachMovie("test", "test1", getNextHighestDepth()); test1.removeMovieClip(); stop(); -- Jim Fee Viking Electronic Services jfee (at) vikinges (dot) com [quoted text, click to view] "Ekur" <webforumsuser@macromedia.com> wrote in message news:cso7pv$q2e$1@forums.macromedia.com... > The problem is when I put a component in a MovieClip then I can't remove > MovieClips using target.removeMovieClip() > With an easier example than the project I'm working on, lets say I got a > MC > named 'test' that is exported for actionscript and in first frame. Then in > the > first frame of my file I put this code: > attachMovie("test", "test1", getNextHighestDepth()); > test1.removeMovieClip(); > stop(); > > It works great, but if I add a component to the stage the removeMovieClip > function doesnt work anymore. The problem still exists if I remove the > component so it's only in the library. But if I uncheck the export in > first > frame square then the code works. But if it's unchecked I can't attach the > component later on in the code so it's for no use. > > I just don't understand why the components affect the removeMovieClip > function. Is it a bug? I'm using Flash MX 2004 v7.2 >
Okay I can repeat exactly the problem. I only just recently upgraded from 7 to 7.2 but, regardless, it is the same as what you are running I think. I agree it is a strange problem. I cannot remove a movie clip created with getNextHighestDepth but I can remove a movie clip created at a specific depth. I don't understand why the component interferes with this but it does. I have tried about a half dozen different path alternatives and am still trying others so have not given up but this is what I have so far: I scrubbed the scrollpane from the FLA and brought in a scrollpane from a 7.0x movie and they are quite different (7.0 and 7.2). The 7.2 scrollpane, in addition to its instance name, creates two additional clips ('registered' and 'focusManager'). What I found strange was that the 7.0 scrollpane actually created TWO movieclips named 'focusManager'. I deleted those extra clips in both versions to see what effect it would have but the behavior remained the same (i.e. cannot remove clip). The other thing I tried was to load the component separately to a new level via loadMovieNum and this did allow me to remove a movie clip created in the original movie via getNextHighestDepth. Not being able to use getNextHighestDepth would cause me some serious problems so, if I had to, I would load the components in their own level and just talk back and forth between (among) the levels. Or I would get Flash to fix the problem - whichever comes first. The other option is just don't use the components and either make your own or buy a third party one. I have seen one somewhere for $5.00. Oh, and I think Jim Fee is right. It is better to use 'this' although it does not solve the problem.
Back to my movie: It is simple and just creates two MC buttons using getNextHighestDepth. If I do not include the component and, on the rollover, trace(this.getDepth());, I get 0 and 1. That makes sense. If I then drag an empty scrollpane onto the stage and repeat the exercise, the two MC button depths become 1048576 and 1048577. Now, in the help file under 'managing movie clip depths', it says the valid range for depths is -16384 to 1048575 so by adding the scrollpane (or any UI AS2 component), it has just pushed my movie clip over the top of the valid range which may be why I can't delete it. Now this is interesting. When I first use swapDepths to change the depth of my dynamically created MC to something within the valid range (I used swapDepths(1000), I was able to delete it handily enough. So maybe this is a simple workaround. Pick a depth you won't use for anything else and swap to that depth and then delete the MC. It still seems to be a bug in the component. Wait? A bug in an MM component????
Also, just for what it is worth: In my UI components now under V7.2, (I have not checked every single one) the data grid and color picker each create two focusManager's while all the other components create only one. The enhanced data grid only creates one focusManager. I am not sure if that is just because V7.2 replaced all but those two components or what. Just for the fun of it I pulled in a combobox from an older 7.0 movie and that older version of the combobox does create two focus managers which might explain some (but not all) of the problems I have had with the combobox. If you are upgrading movies from 7.0 to 7.2, even though the components have the same look, it might be a good idea to scrub your FLA's of the old version and import the newer components. Even with the upgraded components, it looks like every single one will shove your dynamically created movie clips right out of the allowable range of depth. It is funny that they still work - you just can't delete them.
This is my last one and I quit. If I do this: Load the components in frame 1 this.createEmptyMovieClip('tempclip',1048575);//overwrite what is at this depth removeMovieClip(tempclip'); this.createEmptyMovieClip('tempclip',1048574);//overwrite what is at this depth removeMovieClip(tempclip'); this.createEmptyMovieClip('whatever',this.getNextHighestDepth()); whatever.onRollOver = function() { trace(this.getdepth()); } This will trace a depth of '0' so deleting those to top depths seems to wrestle depth control back to reality. I have not tested the scrollpane to see what problems that will cause it but I am willing to bet it won't cause any. The scrollpane is grabbing those top two spots for its own reasons but it is not grabbing anything between -1 and those top two depths. I don't think that is anything specific to the scrollpane. It is just an inconvenience created somewhere in a class file by an inconsiderate MM programmer.
Just out of curiosity I did: trace(this.getInstanceAtDepth(1048575)._name); //returned 'reserved' trace(this.getInstanceAtDepth(1048574)._name); //returned 'focusManager' What I suggested before eliminates 'reserved' forever but the focusManager will reinvent itself but at a new depth of -1081343 (unless it was always there - I have not checked that yet). The fact that the older components created two focus managers makes me suspicious.
Okay here is what I suggest. Find two low depths that you will never use and use swapDepths to swap the depths of 'reserved' and 'focusManager' to those low depths. That will leave two undefined MC's at 1048575 and 1048574. I am not sure the best way to delete them since they are undefined but creating MC's at those depths and then removing will do the trick as I mentioned before. Then your getNextHighestDepth will have some room to work with. I tried to see what would happen if I placed the component in a MC (nest it) hoping the two clips would take on their depths within the contaxt of the MC but they always show up in _root. so that does not seem a good option (it would be a pain in the neck too). I have deleted the focusManager before. The components seem to still work but that did create problems with the halo scheme (appearance only).
Thanks for all the information you've given me. I did the same test as you did with the same results. Then I tried this code with a scrollpane added to the library and exported in the first frame: removeMovieClip("reserved"); removeMovieClip("focusManager"); trace(this.getInstanceAtDepth(1048575)._name); trace(this.getInstanceAtDepth(1048574)._name); It returns undefined for both the "reserved" and the "focusManager" MC but it doesn't restore the depth to 0, it still starts at 1048576, when I attach new MC:s, weird. So I'll go for the code you wrote, it restores the depth to 0 and solve my problem. I'm very thankful, 'cause this problem has been bothering me for so long and I for example had to create my own components for my forms. I wonder if Macromedia are aware of the problem 'cause I haven't seen a thread about this problem on the forum.
I tried the same with the same result. It seems you cannot just remove those clips - you have to replace them and remove the replacement. The problem seems to exist with the 7.0 components as well so this is not new to V7.2. Anyway, good luck.
Don't see what you're looking for? Try a search.
|