Avatar of jasonbb
Flag for Australia

asked on 

How to set (or swap) depths of MovieClips in AS3

I want to ensure the correct movieclip is in front of another.

I was using getDepth() and swapDepths(...) functions in AS2 which are not supported in AS3.

Could someone please show me a similar version of code that will work the same way in AS3.
(ie. Some code that will work with my existing Movieclips)

This is an example version of my code that worked in AS2.
I had two movieclips on the same layer.
if( mcFightHero.getDepth() < mcFightEnemy.getDepth() )
	mcFightHero.swapDepths( mcFightEnemy );

Open in new window

Web Development SoftwareWeb Graphics Software

Avatar of undefined
Last Comment

8/22/2022 - Mon