`
steely816
  • 浏览: 127212 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

AS3 关于Depth的问题

    博客分类:
  • as3
阅读更多

As2里面里有关于深度的函数方法 SwapDepths,getNextHighestDepth.但AS3里没有这样的函数来处理.所以AS2 转AS3 关于深度很多朋友不适应.

AS3里的深度其实处理起来并不复杂,不过得弄清楚机制.

对于已经在舞台存在的对象,不管你文档原来有多少个层,AS3只会看对象的数量,每多一个对象,层的序数自动加1.
比 方说,你在Flash里面有3个层,第一层(最低的),有1个MC,叫AAAA,和一些用绘图工具画的东西,第二层,也有一个MC ,叫BBBB,同样也有一些绘图工具画的东西。第三层,有个MC叫CCCC .好了,那么不管你第一层 用绘图工具画了什么东西,有多少个组,组的层叠情况怎样,统统都只属于一个 Shape 对象,AAAA是一个MC对象,那么第一层就有2个对象了,他们分别获得0和1的序数顺序,第二层也是,无论用绘图工具画了什么也被视作一个Shape对 象,还有一个 BBBB的MC对象,他们获得,2和3序数,第三层CCCC获得 4。那么这个文件就一共有5个对象。 所谓深度自动分配,就是中间不会出现空的索引,都是连续的序数来的。不象AS2那样可以随便指定深度。 AS3要卸载任何显示对象,都可以用removeChild来从显示列表中删除。但removeChild不会把对象完全销毁。可以用AddChild来 重新加载他。

所以实际上AS3里已经把深度变成索引的概念. DisplayObject 对象也就是 MovieClip, Sprite 里提供一些函数了,改变或者获取这个索引.

例如:

getChildAt:DisplayObject
返回位于指定索引处的子显示对象实例。

getChildIndex:int
返回 DisplayObject 的 child 实例的索引位置。

setChildIndex:void
更改现有子项在显示对象容器中的位置。

swapChildren:void
交换两个指定子对象的 Z 轴顺序(从前到后顺序)。

swapChildrenAt:void
在子级列表中两个指定的索引位置,交换子对象的 Z 轴顺序(前后顺序)。

removeChildAt:DisplayObject
从 DisplayObjectContainer 的子列表中指定的 index 位置删除子 DisplayObject。

分享到:
评论

相关推荐

    DFS.zip_As One_depth first search_dfs backtracking_tree dfs

    Depth-first search (DFS) is an algorithm for traversing or searching a tree, tree structure, or graph. One starts at the root (selecting some node as the root in the graph case) and explores as far as...

    3-D Depth Reconstruction from a Single Still Image

    We consider the task of 3-d depth estimation from a single still image. We take a supervised learning approach to this problem, in which we begin by collecting a training set of monocular images (of ...

    C# in Depth, Second Edition

    C# in Depth, Second Edition is a thoroughly revised, up-to-date book that covers the new features of C# 4 as well as Code Contracts. In it, you’ll see the subtleties of C# programming in action, ...

    Database in Depth

    Database in Depth will appeal not only to database developers and designers, but also to a diverse field of professionals and academics, including database administrators (DBAs), information modelers,...

    Excel 2010 In Depth PDF

    As with all In Depth books, Excel 2010 In Depth presents comprehensive coverage, breakthrough techniques, exclusive shortcuts, quick access to information, troubleshooting help for tough problems, ...

    2D/3D Mixed Service in T-DMB System Using Depth Image Based Rendering

    using depth-image-based rendering (DIBR). The 2D/3D mixed service is the 3D service type that 3D contents are shown partially while a 2D video sequence is displayed in the entire screen, or vice versa...

    Efficient Human Pose Estimation from Single Depth Images

    This allows us to learn models that are largely invariant to factors such as pose, body shape, field-of-view cropping, and clothing. Our first approach employs an intermediate body parts ...

    Microsoft Windows 7 In Depth.pdf

    Depth. It’s amazing the changes that 20-odd years can bring to a com- puter product such as Windows. When we wrote our first Windows book back in the mid-1980s, our publisher didn’t even think the ...

    CSS in Depth.

    CSS was proposed in 1994 and first implemented (partially) by Internet Explorer 3 in 1996. It was somewhere around that time I discovered the wonderful View Source but- ton and realized all the ...

    C-Sharp in Depth

    gives me much more room to expand on the details of C# 2, 3, and 4, which is what I hope you’re reading the book for. I believe that many developers would be less frustrated with their work if they ...

    RabbitMQ in Depth.pdf

    ent libraries in Java, .NET, Erlang, as well as libraries for most other popular program- ming languages. This book is up-to-date with RabbitMQ 3.6.3, so with the erratic release schedule of RabbitMQ...

    Time-of-Flight and Structured Light Depth Cameras

    Processing methods required by the 3D nature of the data are presented within general frameworks purposely as independent as possible from the technological characteristics of the measurement ...

    CSS in Depth-Manning(2018).pdf

    More and more web developers in the industry are real- izing that while they “know” CSS, they don’t know it as deeply as they probably should. In recent years, the language has evolved, so even ...

    「基础架构安全」Cybersecurity:Federalism_as_Defense-in-Depth - 安全防护.zip

    「基础架构安全」Cybersecurity:Federalism_as_Defense-in-Depth - 安全防护 访问管理 安全众测 等级保护 业务风控 NGFW

    3D Pose Estimation and 3D Model Retrieval for Objects in the Wild

    the estimated pose as a prior to retrieve 3D models which accurately represent the geometry of objects in RGB im- ages. For this purpose, we render depth images from 3D models under our predicted pose...

    Make3D: Learning 3D Scene Structure from a Single Still Image

    The MRF, trained via supervised learning, models both image depth cues as well as the relationships between different parts of the image. Other than assuming that the environment is made up of a ...

    filemaker 12 in depth

    Drawing on his unsurpassed real-world experience as a FileMaker user, consultant, and developer, Jesse Feiler helps you gain practical mastery of today’s newest, most advanced FileMaker tools and ...

    Pro Spring 5 An In-Depth Guide -Apress(2017)

    Covering version 5 of the Spring Framework, this book is the most comprehensive Spring reference and ...We truly hope you will enjoy using this book to learn Spring as much as we enjoyed writing it.

    The Android graphics path in depth

    Bean as a result of project Butter • This presentation describes the current (JB) graphics stack from top to bottom • Main topics covered • The application layer • SurfaceFlinger, interfaces and ...

Global site tag (gtag.js) - Google Analytics