Copy link to clipboard
Copied
How to save the coordinates of a movieclip that has been moved to be read the next time you visit the canvas page?
or/and
How to save the content of a dynamic text field to be read the next time you visit the canvas page?
nothing above is correct with your latest request. you're going to have a lot to learn to do what you described.
first, you'll need to use ajax in animate to communicate with your server-side code (eg, php) and you'll need server-side code to communicate with your database.
you'll need to learn some javascript so you can understand ajax and you'll need to understand some php so you can login and query your database and return data to your ajax function to be used in animate. (and you'll need to
...Copy link to clipboard
Copied
use cookies, JavaScript Cookies
Copy link to clipboard
Copied
In scene, I have an instance (on_off) of a movie clip, a dynamic text field (operator_name) and a save button (save_btn).
Each time "on_off" is pressed (it is a square of 100px with two frames) it changes color alternately between green and red.
The "operator_name" is to write a name.
Finally the "save_btn" button is to save the changes.
Copy link to clipboard
Copied
I mean some lines of code as an example assuming access to a mysql database or a json file.
Copy link to clipboard
Copied
Having in scene a dynamic text field ("name") and a button ("save_btn")
How to write the code to save in an external document the name that is written in "name" dynamic text field?
The approach can be synchronous or asynchronous and the external document can be json or mysql.
Copy link to clipboard
Copied
How to store session data on a server is a question that has nothing to do with Animate. You would have better luck asking this question elsewhere, like on Stack Exchange.
Copy link to clipboard
Copied
you changed your request from something simple (saving user data to be used by a user when a user returns) to something more complicated (saving data to a database to be used by database owner).
Copy link to clipboard
Copied
Thank you, kglad.
Yes, it should have been more specific. The canvas page contains tons of graphics created with Animate cc and is to be seen online and by different users. The idea is to save the name that a user writes in the "dynamic text field" until another user decides to rewrite it with their name.
If you want, I'll write your answer as correct and write a new query.
Regards
Copy link to clipboard
Copied
nothing above is correct with your latest request. you're going to have a lot to learn to do what you described.
first, you'll need to use ajax in animate to communicate with your server-side code (eg, php) and you'll need server-side code to communicate with your database.
you'll need to learn some javascript so you can understand ajax and you'll need to understand some php so you can login and query your database and return data to your ajax function to be used in animate. (and you'll need to create your database if that's not already done.)
Copy link to clipboard
Copied
Thanks for your clarification.
In the case you mention, I would only need the js code lines to be inserted in "Animate CC" and see if it works.
Copy link to clipboard
Copied
yes, to use cookies you only need javascript.
Copy link to clipboard
Copied
?