I personally haven't done anything like this, but in theory, you should be able to just create your animation and use filler text where you want the PHP/mySQL data to go. Then, when you take the animation into Dreamweaver, or whichever text editor you use, you would need to dig into the HTML/JS that Animate outputs, and replace the filler text with the outputted data from PHP/mySQL.
Thanks for the reply, only just seen it. That was what I was thinking - shame it cannot be done directly, would make it so much more useful.
I am thinking of going down the text file route, even my user can update a text file (I think)...then use that to load in the text into the Animation.
As said though there are plenty of "tips" on how to do this with JSON etc but nothing really useful - would be a great feature/tutorial.
It's complicated, but you can use JSON to grab the data you need and feed it into placeholder text. It's not terribly hard to do, but it does require some knowledge of JSON. I'll look into posting a tutorial at some point, but it might take a while...
You can validate your json file here:
Also you should be able to do a AJAX request with jquery. See info here:
Thanks - I have already seen ths and have been a follower of Lee's work for a number of years
The tutorial does not cover how the Json files are "generated"!
These are not real world tutorials to me....I have a couple of ideas though.
Great topic and GREAT video tutorial!
If you are familiar with PHP, Lasso, ASP, etc this should not be too difficult. When I get a chance, I'll post a working example :-)
As for creating the JSON files, this has nothing to do with Edge itself. The files could be created with any scripting language.
Also, the same goes for using MySQL. MySQL is the database that is connected to via Lasso, PHP, etc...
It does not connect directly to create a JSON file or import info into anything - it just stores your information - You need the other languages to get the info from MySQL into your Edge animation.
For example, using whatever language (PHP, Lasso, Ruby, etc...), connect to your database (MySQL), gather the information you need, and write it to a file in a JSON format just like any other information you would write to a file.
I use Lasso (http://www.lassosoft.com) as my language of choice but this may give you an idea of what to do in any other language:
//create MySQL call & get info
var('prod_id') = 'xxx';
var('sql_listings') = 'SELECT
WHERE active = ""
AND prod_id >="' + $prod_id + '"
ORDER BY prod_id DESC';
// create JSON formatted variable
records (loops returned records and adds them to a variable called result in a JSON formatted file);
$result += '
\"image\" : \"images\/" + (field(\'prod_photo_url\') +
"\"title\" : \" + (field(\'prod_photo_url\')
}, + '+ '\r\n';'
'path'='/path to file location/';
File_Create: $path + $doc_name, -FileOverwrite;
File_Write: $path + $doc_name, $result,-FileOverwrite;
You only need to create ONE file and overwrite it each time.
The way servers work is this:
1. You request a file via your browser(http://www.yoursite.com/pagename.lasso)
2. That request is handed off to whatever language you use (pagename.lasso lets Apache know to send the page to Lasso first).
3. Lasso processes the request and creates the page in JSON format.
4. Lasso sends the page back to Apache and interprets the HTML code (including your animation).
Because of this, the JSON file is created first each time BEFORE Edge runs...
I hope that makes sense. I haven't tried it yet (I just discovered an hour ago how to send info to a MySQL database from Edge!) but I will be testing it out soon and let you know!
Hey James, this is cool! I know nothing about lasso. I guess I have some reading to do!
I'm glad you liked it!
I've been meaning to get into database connectivity with Edge (as a few already have!)
but it was actually your post on another similar thread with the download link to your email form in Edge that got me going. Once I saaw how easy it was to convert you code into something I could use to grab form info from within Edge and add it to a database (just a few hours ago!) I have been off and running! :-)
As for Lasso ( http://www.lassosoft.com ), it is like any other language: PHP, ASP, Ruby, etc...
It started as "Mac centric" software to connect FIleMaker to the web but has since become a robust language running on all major platforms and offering unparralled security and speed :-)
Since my last post, I am in the process of workig on moving info back and forth from a MySQL database into Edge! Again, thank you for the JSON link above!
I wasn't looking forward to learning how to move data in and out of Edge but the developers actually made it quite simple as far as these thing go!!!
I'm hoping to create a "mini" shopping cart using JSON and Edge and creating a video "tutorial" of the process for Edge users here (I've got a busy week so don't hold me to any timeframe!). It will show from begining to end (of course with download files) how to do this. I know it sounds daunting to many but it really isn't-believe it or not, my experience with JSON is that I've heard of it and know "kind of" what it does and yet I was able to create an "on the fly" JSON page with database info and upload it into Edge within an hour after watching the video link you posted above!
thanks for theses informations. I know now how to import data dynamicaly from a json file.
But if i need to use data from a MySQL database, with PHP, is there a way to do it without using a json file ?
Because i'm quite sure i can generate a json file in PHP, but if i can take a shortcut and call data directly in the database, it would be easier... any tutorial about that ?
really thanks for your help
no one can help me with this ?
yes, i've already read it but thanks.
but as usual, he used a json file again...
it seems to have no way to communicate between Edge and a database without generate a json file in php or others languages then
Same problems we used to have with Flash...
I am disappointed...
- I'm confused - jpbond13 clearly wants to connect to a database WITHOUT using a Json file and yet all the information has been to do with using a Json file...
The reason I am saying this is because I am also looking for a way to connect to a database WITHOUT a Json file...
I am like you. I just watched it and the title is misleading!
yes again, thanks PeteM71...
As we used to do with Flash, Actionscript and database, because it was not possible to communicate natively between them, we used to create a xml file (with php or others...) with the data in it, and Flash read the xml file.
10 years later, other soft (edge) but same process, with json and not xml...
That's why not so much Flash dynamic websites exist...
...and why i will forget about using edge in my development for the moment...
Maybe this isn'r a bug, but a feature? EA ultimatly creates a set of HTML, CSS and js files that can all be easily read. So granting direct access to the mySQL database from them does not seem like a good idea. Reading and writing a JSON file at least adds a layer abstraction from direct access to the database.
I would say the closest I've seen anyone come to pulling live, dynamic, data into the Edge Animate timeline is the Edge Suite tool for Drupal and Wordpress. With that, someone can use a CMS to manage and select content and build query lists. It has a feature to allow "data injection" into the EA files. Although at the end of the day, I think it is still creating a JSON file for the data injection.
Hi jpbond 13,
This is the answer I received from the product team:
You can add a jQuery SQL plug in by loading the library dynamically within the project. There are a couple of ways to do that:
- Load the library in the compositionReady using jquery’s getScript() call: http://api.jquery.com/jQuery.getScript/
I have solve the problem using php and mysql db...you can update the db throught a form in php and you can see the result in edge animate site...in this day i create a short guide