我有一个FlvPlayback皮肤,除了自定义按钮外,效果非常好。 基本上这个按钮需要能够调用父动画片段中的一个函数(它加载了FlvPlayback,后者又加载了皮肤)。
我不是真正的Flash开发人员,也没有在Google上找到与此相关的任何内容。 这似乎是一个简单的问题,但我对Flash没有足够的了解。
谁能指出我正确的方向?
简介:如何从外观文件中的自定义按钮调用具有FlvPlayback动画片段的基本swf中的函数。
谢谢
I have an FlvPlayback skin, which works really well, except the custom button. 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).
I am not really a Flash developer, and have not found anything on Google relating to this. It seems like a simple issue, but I just do not have enough knowledge of 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.
Thanks
最满意答案
您可以使用括号语法调用父(或parent.parent)DisplayObject中的任何可用方法:
parent["name"]();RESP。
parent.parent["name"]();其中name是方法的名称。
如果我没记错的话,你的skin.swf的父亲应该是FLVPlayback组件,parent.parent是包含它的MovieClip,依此类推。 您可以向按钮的clickHandler添加跟踪以查看哪个是正确的。
You can call just about any available method in the parent (or parent.parent) DisplayObject by using bracket syntax:
parent["name"]();resp.
parent.parent["name"]();where name is the name of your method.
If I remember correctly, your skin.swf's parent should be the FLVPlayback component, parent.parent the MovieClip containing it, and so forth. You can add a trace to the button's clickHandler to see which is correct.
更多推荐
发布评论