To expand on this (since I'm now awake!) what method I use depends on
how I want to access the child objects.
If I just want a list to iterate over/trawl through, I use an Array.
If I want to access by name, I use an Object.
The reasons I don't normally directly rely on the the childlist of the
Thanks, but what I'm more interested in was the statement that
getChildByName is very slow, which others seemed to agree with. I
guess I understood that as meaning that using gCBN can actually cause
a performance hit. Is that the case?
.m
On 12/17/08, Ian Thomas i...@eirias.net wrote:
To expand
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
Hey Michael, seeing as you can't create Sprites on the timeline, the
following won't work because your sprites don't have instance names.
Thus when you are creating your sprites, you have to add them all to an
array.
i.e.
var columns:Array = new Array();
for(var i:int = 0; i = 50; i ++){
var
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
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
.currentTarget ?
On Tue, Dec 16, 2008 at 4:51 PM, Ian Thomas i...@eirias.net wrote:
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
So as a general question, what is the preferred method if you're
trying to get, say, dynamically generated children, eg
image1image20 etc, from a container?
.m
On Tue, Dec 16, 2008 at 4:51 PM, Ian Thomas i...@eirias.net wrote:
Yes.
On Tue, Dec 16, 2008 at 9:08 PM, Anthony Pace
I use the method I gave you earlier, adding elements to an array and
accessing them that way.
Also, you can use getChildAt() if you know the index of the children, which
it sounds like you do if you have them named as you do... i.e. column1,
column2, column3
On Tue, Dec 16, 2008 at 2:17 PM, Matt
On Tue, Dec 16, 2008 at 10:57 PM, Taka Kojima t...@gigafied.com wrote:
I use the method I gave you earlier, adding elements to an array and
accessing them that way.
As do I.
Ian
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
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
I wasnt actually the original question-asker, but thanks :)
I was just curious about the actual performance hit from getChild.
.m
On Tue, Dec 16, 2008 at 5:57 PM, Taka Kojima t...@gigafied.com wrote:
I use the method I gave you earlier, adding elements to an array and
accessing them that way.
12 matches
Mail list logo