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

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

3069 posts
  • Has been a member for 6-7 years
  • Won a Competition
  • Sold between 50 000 and 100 000 dollars
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
  • Exclusive Author
  • Romania
wickedpixel says

mc.getInstanceAtDepth(234)

535 posts
  • Has been a member for 7-8 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

2309 posts
  • Beta Tester
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Referred between 10 and 49 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 100 and 1 000 dollars
  • United States
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?

2309 posts
  • Beta Tester
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Referred between 10 and 49 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 100 and 1 000 dollars
  • United States
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 ;)

535 posts
  • Has been a member for 7-8 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

535 posts
  • Has been a member for 7-8 years
  • Referred between 10 and 49 users
seifip says

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

by
by
by
by
by
by