[Flashcoders] targeting sprite
How would I do the following: function fname(sparent:Sprite) { sparent.addChildAt(childSprite,2); } fname(spriteParent); It does not seem to like this ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] targeting sprite
Lehr, Theodore wrote: How would I do the following: function fname(sparent:Sprite) { sparent.addChildAt(childSprite,2); } fname(spriteParent); It does not seem to like this Not like is a very vague description. Your error can be anything. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] targeting sprite
Please clarify. Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for Bank of America employees only) -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Lehr, Theodore Sent: Thursday, February 25, 2010 12:09 PM To: Flash Coders List Subject: [Flashcoders] targeting sprite How would I do the following: function fname(sparent:Sprite) { sparent.addChildAt(childSprite,2); } fname(spriteParent); It does not seem to like this ___ 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] targeting sprite
I'm not entirely sure what error you're getting, but if I were to take a wild guess, I'd say the problem is that your sprite doesn't have enough children for you to add anything at index 2. For instance, if your sprite only had 1 child, it would occupy index 0 of your sprite, meaning you'd only be allowed to add children at index 0 and 1. (Don't forget that Flash starts counting at 0) If you're looking to add a child to the top layer of your sprite, probably the better way of doing this would be... sparent.addChildAt(childSprite, sparent.numChildren - 1); Good luck! --Todd On Thu, Feb 25, 2010 at 9:09 AM, Lehr, Theodore ted_l...@federal.dell.comwrote: How would I do the following: function fname(sparent:Sprite) { sparent.addChildAt(childSprite,2); } fname(spriteParent); It does not seem to like this ___ 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