change temp.attachMovie("themask", "idono"+k, this.getNextHighestDepth());
for temp.attachMovie("themask", "idono"+k, temp.getNextHighestDepth()); you need the next depth inside the empty movieclip. And you also need a reference to the empty movieclip: //target_mc.addMask = function() { temp = "wrapper" + k; mcTemp = target_mc.createEmptyMovieClip(temp, this.getNextHighestDepth()); mcTemp.attachMovie("themask", "idono"+k, this.getNextHighestDepth()); mcTemp.blendMode = "layer"; trace(k); //}; in your code, temp is a string, not a movieclip. This may be the problem. []'s andrei On 2/4/07, Teresa Hardy <[EMAIL PROTECTED]> wrote:
I ditched the function() since it wasn't executing and tried your suggestion. The debugger now shows the "wrapper"..s getting added to the movieclips. Hmm...progress. But the temp.attachMovie is not executing on any layer anywhere. I just don't see why. Thanks, T //target_mc.addMask = function() { temp = "wrapper" + k; target_mc.createEmptyMovieClip(temp, this.getNextHighestDepth()); temp.attachMovie("themask", "idono"+k, this.getNextHighestDepth()); temp.blendMode = "layer"; trace(k); //}; On 2/4/07, Andrei Thomaz <[EMAIL PROTECTED]> wrote: > > I guess you have to create an empty movie clip inside target_mc, and > attach > the mask to it. > > []'s > andrei > > > On 2/4/07, Teresa Hardy <[EMAIL PROTECTED]> wrote: > > > > Just joined... and by reading today's posts, it looks like I am in the > > right > > place to get help on this. > > > > I am dynamically creating movie clips and loading each with a .jpg and a > > layer with a mask. It is the addMask step that doesn't work. I have > > written > > this a dozen different ways and have only confused myself. Stepping > > through > > the code I learned that it creates all the movie clips first and then > goes > > to the onLoadInit and sets all the properties. It skips my attempt at an > > addMask function. The linkage id of the mask in the library is > "themask". > > I > > tested this line separately in a different file. It sort of works > although > > I > > couldn't tell if it was loading the mask into the movie clip or the main > > timeline. Yes, I am a beginner. And yes, I am going to go out and get > the > > Flash 8 Essentials book based on the posts I read today. Any suggestions > > greatly appreciated!!! > > > > Thanks, > > T > > > > ... > > max = 12; > > //array of positions for x and y > > var pos_x:Array = new Array(0, 200, 400, 600, 0, 200, 400, 600, 0, 200, > > 400, > > 600, 0); > > var pos_y:Array = new Array(0, 0, 0, 0, 200, 200, 200, 200, 400, 400, > 400, > > 400, 600); > > k = 0; > > var mcl_obj:Object = new Object(); > > mcl_obj.onLoadInit = function(target_mc:MovieClip):Void { > > target_mc._x = pos_x[k]; > > target_mc._y = pos_y[k]; > > if (target_mc._width>200) { > > ratio = target_mc._width/200; > > target_mc._width = target_mc._width/ratio; > > target_mc._height = target_mc._height/ratio; > > } > > //-----------broken part starts here-------------- > > target_mc.addMask = function() { > > target_mc.attachMovie("themask", "idono"+i, > > this.getNextHighestDepth > > ()); > > target_mc.blendMode = "layer"; > > trace(i); > > }; > > //----------end of broken part ------------------ > > //trace ("x "+pos_x[k]); > > //trace ("y "+pos_y[k]); > > target_mc.onPress = function() { > > trace("drag goes here"); > > }; > > k = k+1; > > }; > > for (var i = 0; i<=max; i++) { > > //trace(i); > > j = 10+i; > > var instofimg = new Object(); > > instofimg = "img_mc"+i; > > this.createEmptyMovieClip(instofimg, j); > > var img_mcl:MovieClipLoader = new MovieClipLoader(); > > img_mcl.addListener(mcl_obj); > > //load image into movieclip > > img_mcl.loadClip("image"+i+".jpg", instofimg); > > > > } > > _______________________________________________ > > Flashcoders@chattyfig.figleaf.com > > To change your subscription options or search the archive: > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > Brought to you by Fig Leaf Software > > Premier Authorized Adobe Consulting and Training > > http://www.figleaf.com > > http://training.figleaf.com > > > _______________________________________________ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com > _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
_______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com