Ultrashock Forums > Flash > ActionScript
AS3 - numChildren level?

You are currently viewing our website as a guest which gives you limited access to forums, files and other resources.

Click here to join now for free, and start interacting with our members, download files and much more!

Click here if you are looking for our Flash files and other professional assets.
 
Post Reply | View first unread | Rate Thread Search this Thread | Thread Tools | Display Modes

#1
Bookmark and Share!
AS3 - numChildren level?
Old 2008-08-12

Dear Flashers,

I'm not desperate in need of a solution, but enlightenment is needed.

I'm colorizing a grayscale image with a Sprite and a Blend.OVERLAY.
Which works fine. Since the Sprite is on top and the Bitmap below - i'm using addChildAt().

The problem arises when i want to check if there's Sprite/Bitmap at a level already. The numChildren returns the amount of children in the object but i cannot find a way to do the same on different levels?

Can I check the names of the objects added or is there a sweeter solution?

Thanks in advance,
Tor
postbit arrow 1 comment | 2152 views postbit arrow Reply: with Quote   
Registered User
TorDK is offline
seperator
Posts: 35
2003-02-03
Age: 31
TorDK lives in Denmark
seperator

Ultrashock Member Comments:
Isocase's Avatar Isocase Isocase is offline Isocase lives in United States 2008-08-12 #2 Old  
If I am correct each level can only have one DisplayObject. If you wanted to know what DisplayObject is at a certain level you could:


getChildAt(index:int)isplayObject
Returns the child display object instance that exists at the specified index.


getChildIndex(childisplayObject):int
Returns the index position of a child DisplayObject instance.

Not sure if you just need to check if there is a DisplayObject at that level or if you need the name or index.
Reply With Quote  
Thread Tools
Display Modes Rate This Thread
Rate This Thread: