You can use the addChildAt method and tell it where to add the object in the 
displaylist. 

addChildAt(objectName, 0); will add the objectName to the bottom of the display 
list. 


Nathan Mynarcik
Interactive Web Developer
nat...@mynarcik.com
254.749.2525
www.mynarcik.com

-----Original Message-----
From: "Lehr, Theodore" <ted_l...@federal.dell.com>
Date: Tue, 23 Feb 2010 12:28:39 
To: Flash Coders List<flashcoders@chattyfig.figleaf.com>
Subject: RE: [Flashcoders] Finding and Removing a Sprite: PART II

A peculair twist now is that these bar sprites are being sent to the back 
(meaning I have other sprites - lines) showing on top when they were and should 
showing in the back... imagine if you will a bar chart - that has horizontal 
lines in the back... these lines now show on top of the bars... anyway to force 
them to be on the bottom "layer"?

________________________________________
From: flashcoders-boun...@chattyfig.figleaf.com 
[flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Keith Reinfeld 
[keithreinf...@comcast.net]
Sent: Tuesday, February 23, 2010 12:10 PM
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Finding and Removing a Sprite: PART II

You could parent them.

Var barMom:Sprite = new Sprite();
addChild(barMom);
function createBars():void
{
     for (var i:int=0; i<totalbars; i++)
     {
           var bar:Sprite = new Sprite();
                bar.name = "barBrat"+i;
              ...............

           barMom.addChild(bar);

     {
}

This way at least you know where they live.


Regards,

Keith Reinfeld
Home Page: http://keithreinfeld.home.comcast.net

> -----Original Message-----
> From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-
> boun...@chattyfig.figleaf.com] On Behalf Of Lehr, Theodore
> Sent: Tuesday, February 23, 2010 10:55 AM
> To: Flash Coders List
> Subject: RE: [Flashcoders] Finding and Removing a Sprite: PART II
>
> So here is my next issue... One of the functions creates a dynamic
> amount sprites based on an xml feed, like so
>
>
> function createBars():void
> {
>      for (var i:int=0; i<totalbars; i++)
>      {
>            var bar:Sprite = new Sprite();
>
>               ...............
>
>            addChild(bar);
>
>      {
> }
>
> And see this this is where my ears start to bleed... this is seemingly
> creating, say, 9 Sprites ALL with the same name "bar".... I need to
> keep the new Sprite() line in the loop for them to be created... but
> then I need some way to access them to delete them....
>
> Any ideas?
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.733 / Virus Database: 271.1.1/2705 - Release Date:
> 02/23/10 01:34:00

_______________________________________________
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

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to