Highlighted

Receiving posted html form data and printing part of the animate canvas area

New Here ,
Jun 27, 2019

Copy link to clipboard

Copied

Hello,
In Adobe Animate, is it possible to receive html form data posted? If so please show me the code for getting the html form data, for example getting the data inputted by the user to the text box named 'txtName'.
Another question is, is it possible to let users print some part of the Adobe Animate canvas area by clicking a button on the stage/canvas?

Adobe Community Professional
Correct answer by kglad | Adobe Community Professional

1. append a query string to the url of the redirect page. eg. stead of thank_you.html, use

thank_you.html&username=txtName.text;

2. on the main timeline of thank_you use

var username=parseF(document.location.href)['username'];

function parseF(s){

var a=s.split('&');

var obj = {}

for(i=1;i<a.length;i++){

a=a.split('=');

obj[a[0]]=a[1];

}

return obj;

}

Views

123

Likes

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

Receiving posted html form data and printing part of the animate canvas area

New Here ,
Jun 27, 2019

Copy link to clipboard

Copied

Hello,
In Adobe Animate, is it possible to receive html form data posted? If so please show me the code for getting the html form data, for example getting the data inputted by the user to the text box named 'txtName'.
Another question is, is it possible to let users print some part of the Adobe Animate canvas area by clicking a button on the stage/canvas?

Adobe Community Professional
Correct answer by kglad | Adobe Community Professional

1. append a query string to the url of the redirect page. eg. stead of thank_you.html, use

thank_you.html&username=txtName.text;

2. on the main timeline of thank_you use

var username=parseF(document.location.href)['username'];

function parseF(s){

var a=s.split('&');

var obj = {}

for(i=1;i<a.length;i++){

a=a.split('=');

obj[a[0]]=a[1];

}

return obj;

}

Views

124

Likes

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
Jun 27, 2019 0
Adobe Community Professional ,
Jun 27, 2019

Copy link to clipboard

Copied

1. you need server-side code if you want user input emailed to you or stored in a database.

2. yes, you can use window.print() to print a window object.  because you can create a window object using javascript you can print a recreation of part of the animate canvas.

i don't think either task is suitable for novices.

Likes

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
Reply
Loading...
Jun 27, 2019 0
New Here ,
Jun 27, 2019

Copy link to clipboard

Copied

Thank you for your reply.

Is there a way to get the posted form data from the previous html page in Adobe CC timeline of the movie and store that value in the variable? How can I get the value inputted by the user on the txtName text box on the previous html page? Is there a simple code such as window.RequestForm()  ???

Likes

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
Reply
Loading...
Jun 27, 2019 0
Adobe Community Professional ,
Jun 28, 2019

Copy link to clipboard

Copied

you want to get a value from animate to the 'previous' page?  how do you get to the 'previous' page from animate?

p.s. you can get the value to the 'next' page if you open that page from animate.

Likes

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
Reply
Loading...
Jun 28, 2019 0
New Here ,
Jun 29, 2019

Copy link to clipboard

Copied

What I meant was,

Let's say, I have a html page with a html form with a text box named "txtName" on it and a user entered "Sam" on the text box "txtName" then pressed the submit button on the form.

Then on the next page (the web page which the user has been redirected to after submitting the form), if there's a Adobe animate movie on the page, how can I receive the value inputted by the user "Sam" on the main timeline of the movie?
Are there any simple codes such as window.RequestForm("txtName") to get the value inputted by the user?

Likes

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
Reply
Loading...
Jun 29, 2019 0
Adobe Community Professional ,
Jun 30, 2019

Copy link to clipboard

Copied

1. append a query string to the url of the redirect page. eg. stead of thank_you.html, use

thank_you.html&username=txtName.text;

2. on the main timeline of thank_you use

var username=parseF(document.location.href)['username'];

function parseF(s){

var a=s.split('&');

var obj = {}

for(i=1;i<a.length;i++){

a=a.split('=');

obj[a[0]]=a[1];

}

return obj;

}

Likes

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
Reply
Loading...
Jun 30, 2019 0
New Here ,
Jun 30, 2019

Copy link to clipboard

Copied

Thank you so much for your help

Likes

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
Reply
Loading...
Jun 30, 2019 0
Adobe Community Professional ,
Jun 30, 2019

Copy link to clipboard

Copied

you’re welcome.

Likes

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
Reply
Loading...
Jun 30, 2019 0
ClayUUID LATEST
Adobe Community Professional ,
Jul 01, 2019

Copy link to clipboard

Copied

kglad  wrote

1. append a query string to the url of the redirect page. eg. stead of thank_you.html, use

thank_you.html&username=txtName.text;

The beginning of a query string is marked with a question mark, not an ampersand. The ampersand is used to separate fields within the query string.

URL.search - Web APIs | MDN

You should also be using decodeURIComponent() in your code, in case any of ZKM's users have non-ASCII characters in their name.

Likes

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
Reply
Loading...
Jul 01, 2019 0