If each of the columns has .name='column1' etc:
e.target.getChildByName("column10").gotoAndStop(5);
should do it.
But personally I'd at least do some type-checking on all that, and
would probably create a method inside an AllColumns class to handle
changeChar(). (Obviously I don't know what you're doing, though...)
Ian
On Tue, Dec 16, 2008 at 7:59 PM, Mendelsohn, Michael
<[email protected]> wrote:
> Wow, AS3 is different, even after reading Moock's book. I'm sure this
> is an easy question:
>
> How do you reference sprites within a sprite in an event listener?
>
> I have a child "allcolumns" within a sprite. Within "allcolumns" are 50
> columns (sprites), each named column1, column2, etc.
>
> Allcolumns has an event listener:
>
> private function changeChar(e:Event):void {
> e.target["column10"].gotoAndStop(5);
> }
>
>
> Result: ReferenceError: Error #1069: Property column10 not found on
> flash.display.Sprite and there is no default value.
>
> How to drill into what's in the e.target?
>
> Thanks,
> - Michael M.
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders