我有以下兩個回調函數。我想知道是否有可能在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