I have a frame script in my Clip “Puzzle
” that defines some variables:
this.question = "What are all these emoji describing?";
this.correctAnswers = ["watermelon"];
this.incorrectAnswers = ["recycling", "greenness", "tree", "sync", "syncing", "bush"];
But when I try to access them on the main timeline (in a frame script)…
var answer = Puzzle.correctAnswers[random.integer(0, Puzzle.correctAnswers.length-1)];
…I get an error:
Puzzle.correctAnswers is undefined
I thought maybe it was because the frame script accessing Puzzle.correctAnswers
was being run before Puzzle’s code, so I moved the frame script to the following frame. This didn’t help.
I also put that script in Load instead of Default, but that didn’t help either.
I also tried declaring Puzzle’s variables with var
, but that had the same result.
How can I safely access a child Clip’s variables from the main timeline?
Example file: Emoji_BugReport.wick (97.2 KB)