`
steely816
  • 浏览: 129375 次
  • 性别: 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, ...

    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 ...

    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 ...

    NIIT SM3 ISAS

    提供的文件列表包括关于Jini的文档、幻灯片和图片,这些资源可能涵盖了Jini体系的详细描述、Jini系统深度分析以及与NIIT SM3 ISAS相关的具体应用示例。例如,“深入Jini体系及Jini体系的组成.doc”可能详细解释了...

    「基础架构安全」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...

    AS_SSD_Benchmark

    3. **64K QD1和QD32随机读写测试**:在不同队列深度(Queue Depth,即同时处理的I/O请求数量)下测试硬盘性能。QD1代表单个任务,QD32则模拟多任务并行情况。这对于服务器和高性能计算环境特别重要。 4. **压缩率...

    ASSSD硬盘检测.rar

    "ASSSD硬盘检测.rar" 是一个用于检测SSD性能的工具包,它可以帮助用户了解SSD的健康状况、性能表现和潜在问题。 ASSSD,全称为Advanced SSD Benchmark,是一款专业的SSD基准测试软件。它提供了全面的SSD性能测试,...

    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 ...

    使用python批量修改XML文件中图像的depth值

    depth[i].firstChild.data = '3' # 将depth值改为3 with open(os.path.join(path,xmlFile),'w') as fh: dom.writexml(fh) print('修改depth成功!') ``` 这个脚本首先遍历指定路径下的所有文件,如果文件不是...

Global site tag (gtag.js) - Google Analytics