AS3:通过它找到一个对象动态添加的子实例名称实例、对象、名称、动态

由网友(无情★无义)分享简介:我在做一个Adobe AIR应用程序亭,但我有一个小问题。I am doing an Adobe AIR Kiosk app but I am having a little problem.第一步骤是生成一个摄像头容器First step is to generate a webcam container:v...

我在做一个Adobe AIR应用程序亭,但我有一个小问题。

I am doing an Adobe AIR Kiosk app but I am having a little problem.

第一步骤是生成一个摄像头容器

First step is to generate a webcam container:

var bandwidth:int = 0; 
var quality:int = 100;
var camera:Camera = Camera.getCamera();
camera.setQuality(bandwidth, quality);
camera.setMode(885,575,30,true);
var video:Video = new Video(885,575);
video.attachCamera(camera);
video.name = "camara";
webcam.addChild(video);

它工作正常,问题是,我想申请到它的自定义过滤器

It works ok, the problem is that I want to apply to it a custom filter

它的工作原理确定,如果我把它写这样的:

It works ok if I write it this way:

MovieClip(parent).contenedor_postal.postal.webcam.filters = [filter];

但我想只影响孩子的夹子网络摄像头里,而不会影响其他MC的,所以我把它写这样的:

But I want to affect only the child inside the clip "webcam" without affecting other MC's, so I write it like this:

MovieClip(parent).contenedor_postal.postal.webcam.camara.filters = [filter];

和不工作。我曾经在AS2编程,所以也许诀窍很简单,但我无法找到任何工作。在此先感谢!

and does not work. I used to program in AS2, so maybe the trick is very simple but I can't find anything that works. Thanks in advance!

推荐答案

如果该视频有一个名称属性丹,那么这应该工作:

If the video has a name property "camara" then this should work:

MovieClip(parent).contenedor_postal.postal.webcam.getChildByName("camara").filters = [filter];
阅读全文

相关推荐

最新文章