From the help files and modified a bit. It is probably more efficient
to keep track of names and the do a getChildByName(string)
function traceDisplayList(container:DisplayObjectContainer,
DispObjToCheck:DisplayObject) : Boolean
{
var child:DisplayObject;
for (var i:uint=0; i < container.numChildren; i++)
{
child = container.getChildAt(i);
if(child == DispObjToCheck){
//found it and break out of the loop
return true;
}
if (container.getChildAt(i) is DisplayObjectContainer)
{
traceDisplayList(DisplayObjectContainer(child), DispObjToCheck)
}
}
return false
}
Jiri
Allandt Bik-Elliott (Receptacle) wrote:
that said, i'd still like to know how to determine if a display object
is in the current display list?
thanks
a
On 2 Apr 2008, at 16:35, Kenneth Kawamoto wrote:
Place outside of the function -> private var eventList:Sprite;
Kenneth Kawamoto
http://www.materiaprima.co.uk/
Allandt Bik-Elliott (Receptacle) wrote:
hmmm - i'm a little stuck on this
i'm trying to create a pop-up (will tween but i want to get it
working first) but i want it to kill any previous one that's up - how
would i go about this please?
here's my current code:
CODE
private function createEventList(pbList_xl:XMLList):void
{
if (this.contains(eventList)) removeChild(eventList); //
remove previous eventList if it's available - this is the bit that
needs fixing
var listLength:int = pbList_xl.length();
var listentryHeight:int = 15;
var listHeight:int = listLength * listentryHeight;
var listWidth:int = 50;
var mousePoint:Point = new Point(root.mouseX,
root.mouseY); // will tween from this point to a central point on the
stage
var eventList:Sprite = new Sprite();
eventList.graphics.beginFill(commonGrey, 1);
eventList.graphics.drawRoundRect(0, 0, listWidth,
listHeight, 10);
eventList.x = mousePoint.x;
eventList.y = mousePoint.y;
addChild(eventList);
}
/CODE
hope you can help
a
Allandt Bik-Elliott
thefieldcomic.com
e [EMAIL PROTECTED]
_______________________________________________
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