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

Animate HTML5. How do I call a function written on a library symbol?

Community Beginner ,
Jan 05, 2019 Jan 05, 2019

Copy link to clipboard

Copied

Animate HTML5. I have a library symbol and an instance of it on the parent. The symbol contains a JS function. How do I call the function from a script on the parent?.  Symbols on AS3 have an option “export for ActionScript” .  I do not find anything similar on HTML5 symbols.

Views

680

Translate

Translate

Report

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 , Jan 05, 2019 Jan 05, 2019

The same way you access anything else in Animate. If your instance is named "foo" and your function is named "bar" just do:

this.foo.bar();

Of course, this only works if your function is defined as a method of the instance:

this.bar = function() {

     // bla bla bla

}

Votes

Translate

Translate
LEGEND ,
Jan 05, 2019 Jan 05, 2019

Copy link to clipboard

Copied

The same way you access anything else in Animate. If your instance is named "foo" and your function is named "bar" just do:

this.foo.bar();

Of course, this only works if your function is defined as a method of the instance:

this.bar = function() {

     // bla bla bla

}

Votes

Translate

Translate

Report

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
Community Beginner ,
Jan 06, 2019 Jan 06, 2019

Copy link to clipboard

Copied

Thank you for your help. Problem solved.

I followed your instructions and found out that the instance function can not be called while the page is loading. I moved the calling to frame 20 and it worked fine.

I understand you get points on this help. How should I proceed for you getting them?

Enviado desde Correo<https://go.microsoft.com/fwlink/?LinkId=550986> para Windows 10

Votes

Translate

Translate

Report

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
LEGEND ,
Jan 06, 2019 Jan 06, 2019

Copy link to clipboard

Copied

Just click the button under whichever post you think is the correct answer.

Votes

Translate

Translate

Report

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
Community Beginner ,
Jan 07, 2019 Jan 07, 2019

Copy link to clipboard

Copied

Sorry, the Correct Answer button does not show on my screen. All our transactions are there but the button or something similar. The reason may be that I am in Argentina. This happened to me before and would like to correct it. A sugestion?

Enviado desde Correo<https://go.microsoft.com/fwlink/?LinkId=550986> para Windows 10

Votes

Translate

Translate

Report

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
Community Expert ,
Jan 07, 2019 Jan 07, 2019

Copy link to clipboard

Copied

LATEST

Hi.

I marked Clay's answer as the correct one for you.

Regards,

JC

Votes

Translate

Translate

Report

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