Copy link to clipboard
Copied
Hello everyone I'm really new to animate cc, I'm wondering what the easiest way to go about loading dynamic text in a empty txt field or empty MC. I'd like to be able to just upload and replace and or update .txt file to make site news updates easier.
Same with img, I'd like to just upload a external Img file into a blank container MC.
I used flash MX back in the day but that was years ago. Can anyone help? the coding is not as simplistic as MX
An example of how to load arbitrary string data into a Canvas document:
Copy link to clipboard
Copied
if as3 use the urlloader. if html5 use an XMLHttpRequest.
Copy link to clipboard
Copied
An example of how to load arbitrary string data into a Canvas document:
Copy link to clipboard
Copied
You can also use JSON or XML and an Ajax request.
Joseph Labrecque has a very good video about it on Lynda.com called data-driven Animation. This is a gallery that loads images and text dynamically.
Copy link to clipboard
Copied
resdesign wrote
You can also use JSON or XML and an Ajax request.
XMLHttpRequest IS an AJAX request. That's what the "X" stands for.
Despite the name, XMLHttpRequest can actually load any type of text resource. So Ton-Up's text could be in a TXT file, JSON, XML, whatever.
Copy link to clipboard
Copied
So I should research xmlHttpRequest?
Copy link to clipboard
Copied
var r = new XMLHttpRequest();
r.open("GET", "test.xml", true);
r.addEventListener("load", rF);
r.send();
function rF(e) {
parser = new DOMParser();
var xml = parser.parseFromString(e.target.response, "text/xml");
alert(xml.getElementsByTagName("whatevertag")[0].childNodes[0].nodeValue);
}
Copy link to clipboard
Copied
Thank you. So do you have all the commands memorized?? I'm having a hard time there's so many, Or what's a good Web site with a break down of the different JS categories and their commands... I should print them all out.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
no, i don't have them all memorized.
i keep a "resources" directory for a3 and one for html5/easeljs/javascript with fla files containing code snippets for things i don't use frequently enough to remember. but mostly i use google to search for things i need.
eg, here's a screenshot of some of my as3 'resources':
Copy link to clipboard
Copied
Yep and I particularly wanted to mention this tutorial which for a beginner is really helpful!
Copy link to clipboard
Copied
Thanks you guys I'll read up on all that you guys have provided. Also I'm just starting Udemy course and may get a few more since they are on sale cheap. Any other resources I should check out?
I seriously need to start coding, it seems that things are going that direction and moving away from drag and drop and gui visual designing.
Copy link to clipboard
Copied
Thank you all that replied. I am taking a online non accredited JS course. I was never a As3 pro or coder. I'm from back in the flash kit days and flash chain. A much simpler time. I want to keep this simple until I learn more. Basically, I will do this Web site in canvas html 5. Would love a big container maybe even the whole size of the background and want to load a flyer, jpg or png Img dynamically so when we update events we just upload a new jpg or png to the Web server.
And also like I said earlier I'd love to have a Web page just load news text that is a variable stored in a. Txt file ... They seemed to change how you do this since macromedia flash. Before you just would create dynamic txt field in flash name var, open. Txt file add var name& the text you wanted.
Sorry if I'm a newbie to coding I've always been a designer
Find more inspiration, events, and resources on the new Adobe Community
Explore Now