Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Dynamic txt and img

New Here ,
Dec 02, 2018 Dec 02, 2018

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

830
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Dec 03, 2018 Dec 03, 2018

An example of how to load arbitrary string data into a Canvas document:

Re: Assigning XML content to dynamic text fields

Translate
Community Expert ,
Dec 02, 2018 Dec 02, 2018

if as3 use the urlloader.  if html5 use an XMLHttpRequest.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 03, 2018 Dec 03, 2018

An example of how to load arbitrary string data into a Canvas document:

Re: Assigning XML content to dynamic text fields

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 03, 2018 Dec 03, 2018

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 03, 2018 Dec 03, 2018

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 09, 2018 Dec 09, 2018

So I should research xmlHttpRequest?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 10, 2018 Dec 10, 2018

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);

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 10, 2018 Dec 10, 2018

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. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 10, 2018 Dec 10, 2018
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 10, 2018 Dec 10, 2018
LATEST

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':

Screenshot - 12_10_2018 , 2_45_43 PM.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 10, 2018 Dec 10, 2018

Yep and I particularly wanted to mention this tutorial which for a beginner is really helpful!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 10, 2018 Dec 10, 2018

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 09, 2018 Dec 09, 2018

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines