flash actionscript:
Working in Flash MX 2004, I have a page w/ which I have loaded 3 movies into different emptyMovieClips. One movie is a scrolling navigation whose buttons load a product ID variable. This variable affects which frame labels of the other two movies get played. My problem is that one of the other two movies has rollover states that should show above the other movie. I have loaded this third movie with rollovers into an emptyMovieClip on depth 3, while the second movie is on depth 2. However, no matter what other adjustments I have made to movie depths (2:3, 0:100, or 1:1), the third movie still loads below the second. Any suggestions of something I have overlooked will be rewarded with good karma.
each timeline has it's own set of depths. a movieclip at depth 3 will always be above a movieclip at depth 2 IF both those depths are relative to the same timeline. however, if those two movieclips have two different parents the depths of the parents will take priority in the apparent z-order of the movieclips. there's no adjustment you can make to the movieclips depths that will overcome the different depths of the parent movieclips. so, it's the depth of the oldest ancestor (where those movieclips first have a different lineage) that deteremines the z-order of the movieclips.
OK. First step, I created 3 emptyMovieClips at depths 1, 2, 3. Depth 1 = navigation Depth 2 = product image Depth 3 = product info (including rollover) Upon button click, a user sets a productID that loads movies into both Depths 2 & 3. All these movies are now within the same timeline, but still the movie on Depth 3 is hidden by the movie on Depth 2. --page script-- // scrolling thumbnails createEmptyMovieClip("lThumbs_mc",1); lThumbs_mc._x=14.5; lThumbs_mc._y=0; // image viewer createEmptyMovieClip("imgViewer_mc",2); imgViewer_mc._x=200; imgViewer_mc._y=0; // cutouts createEmptyMovieClip("cutouts_mc",3); cutouts_mc._x=200; cutouts_mc._y=350; --button script-- on (release) { _root.viewer_mc.lThumbs_mc.loadMovie("tBar.swf", 1); _root.viewer_mc.imgViewer_mc.loadMovie("imgBar.swf", 1); _root.viewer_mc.cutouts_mc.loadMovie("cBar.swf",1); }
The second parameter specifies the depth within the emptyMovieClip which each movie loads into. This shouldn't conflict with the depths of the 3 emptyMovieClips in the original timeline. Sorry, but I cannot publish the .fla file at this time.
did you make that up about a 2nd parameter specifying a depth in a target movieclip? the target movieclip doesn't have any children after it's used as a target (and in your case it has no children before, either) and so there are no movieclips at any depths after a loadMovie() statement executes. the 2nd parameter in the loadMovie() method can be a "GET" or "POST", but not a 1.
Yah, my bad on the second parameters of the loadMovie() function. However that did not prove to be an issue. Until I find a solution, I've just combined the second & third movies into a single .swf. I will forgo my attempts at dynamic loading for now.
Don't see what you're looking for? Try a search.
|