2309 posts
  • Has been part of the Envato Community for over 7 years
  • Has referred 10+ members
  • Has sold $100+ on Envato Market
  • Has been a beta tester for an Envato feature
+5 more
theflyingtinman says

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

3072 posts
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Had an item featured on Envato Market
+5 more
wickedpixel says

mc.getInstanceAtDepth(234)

535 posts
  • Has been part of the Envato Community for over 8 years
  • Has referred 10+ members
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
  • Has been part of the Envato Community for over 7 years
  • Has referred 10+ members
  • Has sold $100+ on Envato Market
  • Has been a beta tester for an Envato feature
+5 more
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
  • Has been part of the Envato Community for over 7 years
  • Has referred 10+ members
  • Has sold $100+ on Envato Market
  • Has been a beta tester for an Envato feature
+5 more
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 part of the Envato Community for over 8 years
  • Has referred 10+ members
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 part of the Envato Community for over 8 years
  • Has referred 10+ members
seifip says

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

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by