问题描述
我正在尝试为使用Adobe Animate CC 2020创建的HTML5 / JS电影的TextInput控件设置默认值。
// FRAME 0
var _this = this;
//this is the default approach from the "wizard" and does not work
_this.txtCompany.on('added',function() {
$('#txtCompany').val("Dunder Mifflin");
console.log("inside");
},_this,true);
// this also does not work with a single frame
$('#txtCompany').val('Acme Corp');
console.log("outside");
运行上面的简单电影会导致“外部”被放入控制台日志中,但是在表单字段中未设置任何文本值。
但是,如果我创建第二个框架并放入:
// FRAME 1
var _this = this;
_this.gotoAndStop(0);
以额外的帧运行此新影片并循环回到第一个,该值已正确设置为Acme Corp。console.log("inside")
从未执行,但是console.log("outside")
运行了两次。永远不会调用在帧added
事件上运行此事件的“正确”方式。
这为什么不起作用,为什么代码“向导”会建议一种不可用的实现?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)