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

Read html form control data in Adobe Animate

Community Beginner ,
Dec 05, 2020 Dec 05, 2020

Copy link to clipboard

Copied

Hello,

My Adobe Animate canvas animation is sitting on a html page named index.html.

The index.html page has a html form with name and ID "form1" and this form contains a hidden field form control with name and ID: hfYear

Is it possible to get the text value of the form control 'hfYear' in Adobe Animate and display it in Adobe Animate using the Actions panel scripts?

Views

317

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

Community Expert , Dec 06, 2020 Dec 06, 2020

Hi.

 

Yeah, it is. The code written in the Actions Panel is pure JavaScript and it will be output as-is. Which means there's no compilation/transpilation process. It's like when you write code in any JS or HTML file.

 

So something like this should work:

console.log("from Animate", window.parent.parent.document.getElementById("hfYear").value);

 

Please let us know it this is what you want.

 

Regards,

JC

Votes

Translate

Translate
Community Expert ,
Dec 06, 2020 Dec 06, 2020

Copy link to clipboard

Copied

Hi.

 

Yeah, it is. The code written in the Actions Panel is pure JavaScript and it will be output as-is. Which means there's no compilation/transpilation process. It's like when you write code in any JS or HTML file.

 

So something like this should work:

console.log("from Animate", window.parent.parent.document.getElementById("hfYear").value);

 

Please let us know it this is what you want.

 

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
Community Beginner ,
Dec 06, 2020 Dec 06, 2020

Copy link to clipboard

Copied

Thank you very much for your help!

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 ,
Dec 06, 2020 Dec 06, 2020

Copy link to clipboard

Copied

LATEST

Why the "window.parent.parent"?

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