Arrange (z) order of objects in Flash with ActionScript 3?

前端 未结 2 381
眼角桃花
眼角桃花 2021-01-12 04:10

Is it possible to arrange (z) order of objects in Flash with ActionScript 3?

e.g. I have 3 symbol instances on a given layer, and I want to perform the equivalent of

2条回答
  •  旧巷少年郎
    2021-01-12 04:54

    Bring to front would be something like:

    myObject.parent.setChildIndex( myObject, myObject.parent.numChildren - 1);

    Bring forward would be something like:

    myObject.parent.setChildIndex( myObject, myObject.parent.getChildIndex( myObject ) + 1);

    Setting a specific z index would be:

    myObject.parent.setChildIndex( myObject, newZIndex);

提交回复
热议问题