AS3的StageVideo>多级视频实例的控制深度实例、深度、视频、StageVideo

2023-09-08 14:56:15 作者:我拿青春赌明天

http://www.adobe.com/devnet/flashplayer/articles/ stage_video.html

据StageVideo对象公开的深度属性,它允许你设置的Z深度的文档。

According to the documentation the stageVideo object exposes a depth property which allows you to set the z depth.

但很困惑如何实施。 有一个只读矢量对象

But am confused on how to implement. There is a read only vector object

stage.stageVideos[0];

但究竟是如何您填充这个向量与多个StageVideo对象?无处文档中没有说明这一点。

but how exactly do you populate this vector with more than one StageVideo object? Nowhere in the documentation does it explain this.

推荐答案

stage.stageVideos 数组pre-填充舞台视频的数量对象系统支持。所以,你不必做任何事情在那里。这个数字可以改变,虽然基于关闭的应用程序的大小和其他的东西,所以听的舞台视频可用性的事件,并作出相应的反应是很重要的。

The stage.stageVideos array is pre-populated with the amount of stage video objects the system supports. So you don't have to do anything there. That number can change though based off app size and other things, so it's important to listen for the stage video availability events and react accordingly.

要更改Z顺序,您可以使用的StageVideo 实例的深度属性:

To change the z-order, you use the depth property of a StageVideo instance:

var stgVideo1:StageVideo = stage.stageVideos[0];
stgVideo.depth = 2;

//if the system supports more than 1, lets grab a reference to another stage video
if(stage.stageVideos.length > 1){
    var stgVideo2:StageVideo = stage.stageVideos[1];
    stgVideo2.depth = 1;
}

这将使 stgVideo2 后面的第一个。所有条件都相同(相同的深度值,或者无指定)的深度将是相同的顺序作为stage.stageVideos阵列

This will make stgVideo2 behind the first one. All things being equal (same depth value, or none specified) the depth will be the same order as the stage.stageVideos array.

有关详细信息,阅读文档