RE: [Flashcoders] Changing display index on the stage
Hi, //Assumes mc1 is on the stage and has linkage set to mc1 var mc2:MovieClip = new MovieClip(); addChild(mc2); addChild(mc1); hth, Bob -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of natalia Vikhtinskaya Sent: Wednesday, May 05, 2010 10:17 AM To: Flash Coders List Subject: [Flashcoders] Changing display index on the stage Hi Is it possible to have mc1 manually placed on stage be over mc2 created dynamically mc2=new MovieClip(); addChild(mc2) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Changing display index on the stage
Look into getChildByName to get a reference to the MC on the stage, ie getChildByName('instanceName').x. _ _ _ Erik Mattheis Senior Web Developer Minneapolis T 952 346 6610 C 612 377 2272 Weber Shandwick Advocacy starts here. PRWeek Global Agency Report Card 2009 - Gold Medal Winner The Holmes Report Global Agency of the Year PR News Agency of the Year -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of natalia Vikhtinskaya Sent: Wednesday, May 05, 2010 12:17 PM To: Flash Coders List Subject: [Flashcoders] Changing display index on the stage Hi Is it possible to have mc1 manually placed on stage be over mc2 created dynamically mc2=new MovieClip(); addChild(mc2) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Changing display index on the stage
My interpretation of the question was we want the depth of the added object to be lower than the object that is already on the stage. So I don't think the x coordinate is the answer. So the first answer where Robert re-addChilds mc1 technically works in the simple situation, but if you have other objects on the stage, you'll start to mess up the depth order of your stage objects. I would recommend using addChildAt and setting the depth of mc2 to that of mc1's: this.addChildAt(mc2, this.getChildIndex(mc1)); That way, everything in the stack from mc1 + up is promoted instead of mc1 being popped to the top of the stack. -jonathan On Wed, May 5, 2010 at 1:56 PM, Mattheis, Erik (MIN - WSW) ematth...@webershandwick.com wrote: Look into getChildByName to get a reference to the MC on the stage, ie getChildByName('instanceName').x. _ _ _ Erik Mattheis Senior Web Developer Minneapolis T 952 346 6610 C 612 377 2272 Weber Shandwick Advocacy starts here. PRWeek Global Agency Report Card 2009 - Gold Medal Winner The Holmes Report Global Agency of the Year PR News Agency of the Year -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto: flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of natalia Vikhtinskaya Sent: Wednesday, May 05, 2010 12:17 PM To: Flash Coders List Subject: [Flashcoders] Changing display index on the stage Hi Is it possible to have mc1 manually placed on stage be over mc2 created dynamically mc2=new MovieClip(); addChild(mc2) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- -jonathan howe ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Changing display index on the stage
Thank you very much! That is exactly what I need. 2010/5/5 jonathan howe jonathangh...@gmail.com: My interpretation of the question was we want the depth of the added object to be lower than the object that is already on the stage. So I don't think the x coordinate is the answer. So the first answer where Robert re-addChilds mc1 technically works in the simple situation, but if you have other objects on the stage, you'll start to mess up the depth order of your stage objects. I would recommend using addChildAt and setting the depth of mc2 to that of mc1's: this.addChildAt(mc2, this.getChildIndex(mc1)); That way, everything in the stack from mc1 + up is promoted instead of mc1 being popped to the top of the stack. -jonathan On Wed, May 5, 2010 at 1:56 PM, Mattheis, Erik (MIN - WSW) ematth...@webershandwick.com wrote: Look into getChildByName to get a reference to the MC on the stage, ie getChildByName('instanceName').x. _ _ _ Erik Mattheis Senior Web Developer Minneapolis T 952 346 6610 C 612 377 2272 Weber Shandwick Advocacy starts here. PRWeek Global Agency Report Card 2009 - Gold Medal Winner The Holmes Report Global Agency of the Year PR News Agency of the Year -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto: flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of natalia Vikhtinskaya Sent: Wednesday, May 05, 2010 12:17 PM To: Flash Coders List Subject: [Flashcoders] Changing display index on the stage Hi Is it possible to have mc1 manually placed on stage be over mc2 created dynamically mc2=new MovieClip(); addChild(mc2) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- -jonathan howe ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Changing display index on the stage
natalia Vikhtinskaya wrote: Hi Is it possible to have mc1 manually placed on stage be over mc2 created dynamically mc2=new MovieClip(); addChild(mc2) My recommendation: create a holder mc on the timeline and add stuff to the holder instead. The holder can be given a proper layer in the IDE and the code will be simple. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Changing display index on the stage
Please explain. Do you mean to create empty holder manually? How to add stuff to it? My first try was to add mc from the library with linkage class name. This is simple navigation bar with back next arrows. So in the library I have mc nav. Nav has two mcs (arrows). Each mc has two frames inside. Everything would be fine if I just add this in the beginning. But I add it after event. And after that everything becames crazy. This two-frame mc stops on frame 2. Here is fla http://www.mightybook.com/test/example.zip I could not solve this problem and decided that only what I can to add it on the stage. So solution was found with guru help. But I would want to understand why all this crazy things happened. It is really hard when simple things from AS2 are completly difficult in AS3. 2010/5/5 Henrik Andersson he...@henke37.cjb.net: natalia Vikhtinskaya wrote: Hi Is it possible to have mc1 manually placed on stage be over mc2 created dynamically mc2=new MovieClip(); addChild(mc2) My recommendation: create a holder mc on the timeline and add stuff to the holder instead. The holder can be given a proper layer in the IDE and the code will be simple. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Changing display index on the stage
natalia Vikhtinskaya wrote: Please explain. Do you mean to create empty holder manually? How to add stuff to it? Create a new empty movielclip symbol. Do not give it any class. Do not put any content in it. Now place an instance of this symbol on the timeline. Give this instance an instance name. Then use the instance name as a property to access the mc when adding: holder_mc.addChild(stuff); ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Changing display index on the stage
I would like to point out that use of empty clips is a polarizing technique in terms of public opinion. Some people find that they make projects difficult to maintain. -jonathan On Wed, May 5, 2010 at 4:12 PM, Henrik Andersson he...@henke37.cjb.netwrote: natalia Vikhtinskaya wrote: Please explain. Do you mean to create empty holder manually? How to add stuff to it? Create a new empty movielclip symbol. Do not give it any class. Do not put any content in it. Now place an instance of this symbol on the timeline. Give this instance an instance name. Then use the instance name as a property to access the mc when adding: holder_mc.addChild(stuff); ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- -jonathan howe ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders