Skip to main content
Participant
October 31, 2017
Answered

Load external textfile into animated textfield stops animation.

  • October 31, 2017
  • 2 replies
  • 2232 views

Hello,

I'm using the Animate CC timeline to create animated textfields.

Up to now I'm able to change content of dynamic textfields on the fly by inserting keyframes on a "actions" layer and writing this to actions:

--------------------------------------------

this.textBox01_txt.text = 'new text';

--------------------------------------------

In this case the animation still works.

As long as I don't use externally linked textfile the animation will play fine.

But if I try to load an external textfile into the textfield, the text will be displayed statically on the start position of the animation, while the other animations

in the background are running fine. The animation of that layer does not work with external file?!

I couldn't find any workaround for this in the internet.

Maybe someone can help me out.

This is my action that I have placed at the very first frame.

--------------------------------------

import flash.net.URLVariables;

import flash.net.URLRequest;

import flash.net.URLLoader;

import flash.events.Event;

var testTextLoader:URLLoader = new URLLoader();

testTextLoader.addEventListener(Event.COMPLETE, onLoaded);

function onLoaded(e:Event):void{

    textBox01_txt.text = e.target.data;

    addChild(textBox01_txt);

}

testTextLoader.load(new URLRequest("mytext.txt"));

---------------------------------------

This topic has been closed for replies.
Correct answer dmennenoh

Actually, I think the addChild(textBox01_txt) is the problem. Try removing that line...

2 replies

Participant
November 1, 2017

Thank you all for your support!!!

specially @dmennenoh !!!

kglad
Community Expert
Community Expert
October 31, 2017

there's no problem with your code (assuming that .txt file exists in the correct location and your textfield exists on stage).

Participant
October 31, 2017

I know there is no problem with code.

it works, but if I use external text the animation does not work. it just displays text without the movement.

Inspiring
November 1, 2017

I would suggest ditching the timeline animation and using TweenMax/Lite from Greensock. You have a lot more control and it's also a lot easier to change timing and such.