Yes.

However, it was the simplest answer to Michael's question.

I'm afraid I didn't (and still don't) have time to answer the question
with a long 'here's how I'd actually do it and why it's a good idea
not to refer to nested clips like this' email, unfortunately. :-) It
was a quick fix for Michael, and in the long term, you're right - the
wrong answer.

Perhaps I shouldn't comment at all when I'm this short of time. :-)

But feel free to write your own answer, Anthony...

Ian

On Tue, Dec 16, 2008 at 9:08 PM, Anthony Pace <anthony.p...@utoronto.ca> wrote:
> isn't getting a child by name very slow?
>
> Ian Thomas wrote:
>>
>> 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
>> <michael.mendels...@fmglobal.com> 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
>>> 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
>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to