简体   繁体   English

Flash AS3 FlvPlayback外观调用父SWF

[英]Flash AS3 FlvPlayback Skin calling parent swf

I have an FlvPlayback skin, which works really well, except the custom button. 我有一个FlvPlayback外观,除了自定义按钮外,它的效果非常好。 Basically this button needs to be able to call a function in the parent movieclip (that loaded the FlvPlayback, which in turn loaded the skin). 基本上,此按钮需要能够调用父movieclip中的函数(加载了FlvPlayback,后者又加载了皮肤)。

I am not really a Flash developer, and have not found anything on Google relating to this. 我实际上不是Flash开发人员,也没有在Google上找到与此相关的任何内容。 It seems like a simple issue, but I just do not have enough knowledge of flash. 看来这是一个简单的问题,但我只是没有足够的Flash知识。

Can anyone point me in the right direction? 谁能指出我正确的方向?

Summary: How to call a function in the base swf which has a FlvPlayback movieclip, from a custom button in the skin file. 摘要:如何从外观文件中的自定义按钮调用基本SWF中具有FlvPlayback影片剪辑的函数。

Thanks 谢谢

You can call just about any available method in the parent (or parent.parent) DisplayObject by using bracket syntax: 您可以使用方括号语法调用父(或parent.parent)DisplayObject中的几乎任何可用方法:

parent["name"]();

resp. 分别

parent.parent["name"]();

where name is the name of your method. 其中name是您的方法的名称。

If I remember correctly, your skin.swf's parent should be the FLVPlayback component, parent.parent the MovieClip containing it, and so forth. 如果我没记错的话,skin.swf的父级应该是FLVPlayback组件,父级应该是包含它的MovieClip,等等。 You can add a trace to the button's clickHandler to see which is correct. 您可以将跟踪添加到按钮的clickHandler,以查看正确的跟踪。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM