Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How do I access variable in movieclip?

Contributor ,
Nov 15, 2016 Nov 15, 2016

In AnimateCC I've added a clip called myClip and in it I place this code:

var myVar= true;

In te main timeline I want to access that variable so there I use this:

console.log(this.myClip.myVar);

But this keeps showing 'undefined'.

How can I read a variable from within a movieclip then?

The source file can be downloaded at:

https://we.tl/hPJLtuZfAJ

505
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Nov 15, 2016 Nov 15, 2016

var only declares a private variable for use by the current frame of a movieclip. To store a variable for an entire clip, use this.

Translate
LEGEND ,
Nov 15, 2016 Nov 15, 2016
LATEST

var only declares a private variable for use by the current frame of a movieclip. To store a variable for an entire clip, use this.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines