简体   繁体   English

在Adobe Animate CC中访问外部JS函数

[英]Accessing external JS functions in Adobe Animate CC

In my Animate CC file I can handle the loading of external js files, but am struggling to understand how you access the functions in those external files from the timeline? 在我的Animate CC文件中,我可以处理外部js文件的加载,但是正在努力了解如何从时间轴访问那些外部文件中的函数? For example, if my external script has: 例如,如果我的外部脚本具有:

function videoPlay() {
    alert("Hello! I am some code!");
}

How would I call that function from a keyframe on the timeline? 如何从时间轴上的关键帧调用该函数?

this.videoPlay(); this.videoPlay(); or _root.videoPlay(); 或_root.videoPlay(); does not work 不起作用

videoPlay(); videoPlay(); is the correct way to call the method. 是调用该方法的正确方法。 I had an issue elsewhere in the code where I did not implicitly call this. 我在代码中的其他地方有一个问题,我没有隐式地称呼它。 on a variable. 在变量上。

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

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