我有以下两个回调函数。我想知道是否有可能在clipname和has_clip函数之间共享名称对象?这是为使用liveton而开发的,但是我确定它只是一个普通的javascript事物。跨回调函数共享数据
function loadclips() {
names = new LiveAPI(this.patcher, 1, clipname, “live_set tracks 0 clip_slots 1 clip”);
names.property = “name”;
slot = new LiveAPI(this.patcher, 1, has_clip, “live_set tracks 0 clip_slots 1”);
slot.property = “has_clip”;
}
function clipname(args) {
post(args);
}
function has_clip(args) {
post(args);
}
关注您的全球范围; '名称'是一个全球性的,但我怀疑你想要它。 – jcollum