ActiveDen

What is the AS2 equiv of AS3's "getChildAt()" method?

2309 posts
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Beta Tester
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
  • Bought between 1 and 9 items
  • United States
  • Referred between 10 and 49 users
theflyingtinman says

I need an as2 method to invoke from one movieclip to find all (unknown) sibling movieclips and return their instance names.

4 years ago
2350 posts
  • Has been a member for 4-5 years
  • Won a Competition
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Europe
  • Referred between 50 and 99 users
wickedpixel says

mc.getInstanceAtDepth(234)

4 years ago
535 posts
  • Has been a member for 5-6 years
  • Referred between 10 and 49 users
seifip says

This works very differently in AS3 vs. AS2 … AS2 has depths, AS3 hasn’t so you simply can’t do the same thing in AS2 …

But getInstanceAtDepth(); is the thing you’ll need to accomplish what you need

4 years ago
2309 posts
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Beta Tester
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
  • Bought between 1 and 9 items
  • United States
  • Referred between 10 and 49 users
theflyingtinman says

Thanks. but I had tried geInstanceAt Depth(), and figured that I’d just iterate through all depths from zero to getDepth() (since I only wanted to find instances which I was sure were below the depth of my calling movie clip.) Trouble is in a test situation it didn’t work – so I did a trace to find the actual depth of a movie clip (instance name, mcClip) I had placed on the stage below my calling clip and mcClip.getDepth() returned a value of -16381! and my calling clips depth was 0 when I had placed it at the top) so how do I know what range of depths I need to iterate through to be sure I get them all?

4 years ago
2309 posts
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Beta Tester
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
  • Bought between 1 and 9 items
  • United States
  • Referred between 10 and 49 users
theflyingtinman says

Never mind! – I guess I should have read the documentation a little deeper I now see that depths start at -16381 – so -16383 is actually depth 0!

I should have stuck with AS3 . That’s what I started with when I “discovered” Flash late last year but due to what I perceived as a lack of popularity for AS3 files on FlashDen I decided to try writing an AS2 file for my first FD submission. (I figured how different can it be :) )

It’s funny how I see people here talking about “getting their hands dirty” on AS3 – I tell you, when I’ve finished with this one I can’t wait to wipe the AS2 off my hands and get back to AS3 ;)

4 years ago
535 posts
  • Has been a member for 5-6 years
  • Referred between 10 and 49 users
seifip says

AS2 is terrible in comparison with AS3 … Yep, the code is longer with AS3 but it is much cleaner, easier to debug, easier to use and more powerful

4 years ago
535 posts
  • Has been a member for 5-6 years
  • Referred between 10 and 49 users
seifip says

2theflyingtinman: You’re lucky you haven’t met AS1 ;)

4 years ago
by
by
by
by
by