In this tutorial we will se how to pass variable data to an animation made with Adobe Edge Animate.
Sometime you need an animation that changes its status based on specific parameters,
In this example a parameter param having value “variable value” is passed inside the url and it’s retrieved using PHP.
In this tutorial we will retrieve data using PHP because it’s an easy and quick language,
The tutorial is divided into two parts:
- retrieving the data sent to the page;
- use the data inside the animation made with Edge Animate.
1. RETRIEVING THE DATA SENT TO THE PAGE
Preamble: when I talk about “the page” I mean the page where your Edge Animate animation is included.
Let’s pass a parameter via get inserting it in the url of our page:
var paramValue = ‘<?php echo $_GET[‘param’]; ?>’;
2. USE THE DATA INSIDE THE ANIMATION MADE WITH EDGE ANIMATE
Nothing easier! We just need to call the variable inside an Edge Animate script.
As example if we create a dynamic text field and we want that the content of this it’s the value of our paramValue variable, write down this line of code
Now the content of the text field dynamicText will be equal to our variable paramValue set inside our page.
You can download the Edge Animate .an and the compiled version of this tutorial clicking the link below:
Tutorial package Edge Animate: passing data to animation
As you has seen, you can pass to your Edge Animate animation any kind of data using get, post, put or whatever method or language you want.
If you have any questions about this tutorial or topics directly related to it, like retrieving of post data or the use of a different programming languages, leave a comment below.
A thanks to Carla for the comment on Edge Animate Tutorial: contenuto dinamico utilizzando Ajax that has inspired this tutorial.